我试图在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忽略了我,有人知道我如何设置正确的查找路径吗?
发布于 2014-02-18 19:38:20
通过在init文件中添加以下内容,可以将变量mu4e-msg2pf设置为可执行msg2pdf的路径
(setq mu4e-msg2pdf "/path/to/msg2pdf")https://stackoverflow.com/questions/21862241
复制相似问题