X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=emacs%2Fnotmuch-print.el;h=bca759fafaa373878971624a6b18e522ec368ae5;hp=880f96d9053f38c3e7ad5a0837e874db7b8a89d2;hb=4f2a7993a54dacbe5699f3d6195e13de2c1af2b5;hpb=6f388fa711188813d670aa086f2a6acdbeead69a diff --git a/emacs/notmuch-print.el b/emacs/notmuch-print.el index 880f96d9..bca759fa 100644 --- a/emacs/notmuch-print.el +++ b/emacs/notmuch-print.el @@ -1,4 +1,4 @@ -;; notmuch-print.el --- printing messages from notmuch. +;;; notmuch-print.el --- printing messages from notmuch. ;; ;; Copyright © David Edmondson ;; @@ -15,15 +15,19 @@ ;; General Public License for more details. ;; ;; You should have received a copy of the GNU General Public License -;; along with Notmuch. If not, see . +;; along with Notmuch. If not, see . ;; ;; Authors: David Edmondson +;;; Code: + +(require 'notmuch-lib) + (declare-function notmuch-show-get-prop "notmuch-show" (prop &optional props)) (defcustom notmuch-print-mechanism 'notmuch-print-lpr "How should printing be done?" - :group 'notmuch + :group 'notmuch-show :type '(choice (function :tag "Use lpr" notmuch-print-lpr) (function :tag "Use ps-print" notmuch-print-ps-print) @@ -58,14 +62,16 @@ Optional OUTPUT allows passing a list of flags to muttprint." (defun notmuch-print-ps-print (msg) "Print a message buffer using the ps-print package." - (let ((subject (plist-get (notmuch-show-get-prop :headers msg) :Subject))) + (let ((subject (notmuch-prettify-subject + (plist-get (notmuch-show-get-prop :headers msg) :Subject)))) (rename-buffer subject t) (ps-print-buffer))) (defun notmuch-print-ps-print/evince (msg) "Preview a message buffer using ps-print and evince." (let ((ps-file (make-temp-file "notmuch")) - (subject (plist-get (notmuch-show-get-prop :headers msg) :Subject))) + (subject (notmuch-prettify-subject + (plist-get (notmuch-show-get-prop :headers msg) :Subject)))) (rename-buffer subject t) (ps-print-buffer ps-file) (notmuch-print-run-evince ps-file))) @@ -86,3 +92,5 @@ Optional OUTPUT allows passing a list of flags to muttprint." (funcall notmuch-print-mechanism msg)) (provide 'notmuch-print) + +;;; notmuch-print.el ends here