首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何从mu4e mu4e-action-view-as-pdf函数中更改查找目录

如何从mu4e mu4e-action-view-as-pdf函数中更改查找目录
EN

Stack Overflow用户
提问于 2014-02-18 18:22:41
回答 1查看 941关注 0票数 0

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

代码语言:javascript
复制
(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所在的路径。问题是我从调试器中看到

代码语言:javascript
复制
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忽略了我,有人知道我如何设置正确的查找路径吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-02-18 19:38:20

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

代码语言:javascript
复制
(setq mu4e-msg2pdf "/path/to/msg2pdf")
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/21862241

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档