From ea9e4eff75cdab15590e3fd08dd5b90a5df9513a Mon Sep 17 00:00:00 2001 From: djcb Date: Sun, 29 Apr 2012 17:32:34 +0300 Subject: [PATCH] * make the msg2pdf action a bit more robust --- emacs/mu4e-actions.el | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/emacs/mu4e-actions.el b/emacs/mu4e-actions.el index 0dd27e5c..45b7762e 100644 --- a/emacs/mu4e-actions.el +++ b/emacs/mu4e-actions.el @@ -52,9 +52,12 @@ view." (let* ((pdf (shell-command-to-string (concat mu4e-msg2pdf " " - (shell-quote-argument (plist-get msg :path))))) - (pdf (and pdf (substring pdf 0 -1)))) ;; chop \n - (unless (file-exists-p pdf) + (shell-quote-argument (mu4e-msg-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)) + (message "==> %S %S" pdf (mu4e-msg-field msg :path)) (error "Failed to create PDF file")) (find-file pdf)))