Emacs mu4e如何将mu4e操作视图的查找目录更改为pdf函数
我试图在mu4e中使用view as pdf函数,我猜问题在于可执行文件Emacs mu4e如何将mu4e操作视图的查找目录更改为pdf函数,emacs,elisp,mu,Emacs,Elisp,Mu,我试图在mu4e中使用view as 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
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“”路径更改为msg2pdf玩具。)
以匹配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
忽略了我,有人知道我如何设置正确的查找路径吗?您可以通过在init文件中添加以下内容,将变量mu4e-msg2pf
设置为可执行文件的路径msg2pdf
(setq mu4e-msg2pdf "/path/to/msg2pdf")