X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=emacs%2Fnotmuch-print.el;h=8c18f4bd63da4d0fa9a1d30c6272c8667f671bdb;hb=8d7afd0f45c2ce4d54ec475bb53528eadefa6697;hp=f96ccbeb2428425169ea21d3fd80f44a67a1ab82;hpb=05f4904616b95a17332d7573e44a4aad2dc4033e;p=notmuch diff --git a/emacs/notmuch-print.el b/emacs/notmuch-print.el index f96ccbeb..8c18f4bd 100644 --- a/emacs/notmuch-print.el +++ b/emacs/notmuch-print.el @@ -19,9 +19,13 @@ ;; ;; Authors: David Edmondson +(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) @@ -56,14 +60,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))) @@ -80,6 +86,7 @@ Optional OUTPUT allows passing a list of flags to muttprint." (defun notmuch-print-message (msg) "Print a message using the user-selected mechanism." + (set-buffer-modified-p nil) (funcall notmuch-print-mechanism msg)) (provide 'notmuch-print)