0

我试图在 mu4e 中将视图作为 pdf 函数工作,我猜问题是可执行文件的查找目录msg2pdf。从我看到的函数定义

(defvar mu4e-msg2pdf "/usr/bin/msg2pdf" "Path to the msg2pdf toy.")

(defun mu4e-action-view-as-pdf (msg)
  "Convert the message to pdf, then show it.
Works for the message view."
  (unless (file-executable-p mu4e-msg2pdf)
    (mu4e-error "msg2pdf not found; please set `mu4e-msg2pdf'"))
  (let* ((pdf
      (shell-command-to-string
        (concat mu4e-msg2pdf " "
          (shell-quote-argument (mu4e-message-field msg :path))
          " 2> /dev/null")))
     (pdf (and pdf (> (length pdf) 5)
        (substring pdf 0 -1)))) ;; chop \n
    (unless (and pdf (file-exists-p pdf))
      (mu4e-warn "Failed to create PDF file"))
    (find-file pdf)))

我更改了(defvar mu4e-msg2pdf "/usr/bin/msg2pdf" "Path to the msg2pdf toy.") 其中的路径以匹配路径msg2pdf。问题是我从调试器中看到

Debugger entered--returning value: nil
  file-executable-p("/build/buildd/maildir-utils-0.9.9.5/toys/msg2pdf/msg2pdf")
* #[(msg) "\305!\204\n ......
* mu4e-action-view-as-pdf((.....
  mu4e-view-action()
  call-interactively(mu4e-view-action nil nil)

查找路径不是我指定的。由于我试图以不同的方式对其进行更改并且显然mu4e忽略了我,所以有人知道我该如何设置正确的查找路径吗?

4

1 回答 1

2

您可以通过将以下内容添加到您的 init 文件来将变量设置mu4e-msg2pf为可执行文件的路径msg2pdf

(setq mu4e-msg2pdf "/path/to/msg2pdf")
于 2014-02-18T19:38:20.023 回答