]> git.notmuchmail.org Git - notmuch/blobdiff - emacs/notmuch-print.el
emacs: use lexical-bindings in all libraries
[notmuch] / emacs / notmuch-print.el
index 6653d97782c4c6a046679f8da99ceec73611989b..8da9a0918e7701c1b66f647e16bc523bbfd53974 100644 (file)
@@ -1,4 +1,4 @@
-;; notmuch-print.el --- printing messages from notmuch.
+;;; notmuch-print.el --- printing messages from notmuch  -*- lexical-binding: t -*-
 ;;
 ;; Copyright © David Edmondson
 ;;
 ;; General Public License for more details.
 ;;
 ;; You should have received a copy of the GNU General Public License
-;; along with Notmuch.  If not, see <http://www.gnu.org/licenses/>.
+;; along with Notmuch.  If not, see <https://www.gnu.org/licenses/>.
 ;;
 ;; Authors: David Edmondson <dme@dme.org>
 
+;;; Code:
+
 (require 'notmuch-lib)
 
 (declare-function notmuch-show-get-prop "notmuch-show" (prop &optional props))
 
+;;; Options
+
 (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)
@@ -34,7 +38,7 @@
          (function :tag "Use muttprint then evince" notmuch-print-muttprint/evince)
          (function :tag "Using a custom function")))
 
-;; Utility functions:
+;;; Utility functions
 
 (defun notmuch-print-run-evince (file)
   "View FILE using 'evince'."
@@ -52,7 +56,7 @@ Optional OUTPUT allows passing a list of flags to muttprint."
         "--printed-headers" "Date_To_From_CC_Newsgroups_*Subject*_/Tags/"
         output))
 
-;; User-visible functions:
+;;; User-visible functions
 
 (defun notmuch-print-lpr (msg)
   "Print a message buffer using lpr."
@@ -67,7 +71,7 @@ Optional OUTPUT allows passing a list of flags to muttprint."
 
 (defun notmuch-print-ps-print/evince (msg)
   "Preview a message buffer using ps-print and evince."
-  (let ((ps-file (make-temp-file "notmuch"))
+  (let ((ps-file (make-temp-file "notmuch" nil ".ps"))
        (subject (notmuch-prettify-subject
                  (plist-get (notmuch-show-get-prop :headers msg) :Subject))))
     (rename-buffer subject t)
@@ -80,7 +84,7 @@ Optional OUTPUT allows passing a list of flags to muttprint."
 
 (defun notmuch-print-muttprint/evince (msg)
   "Preview a message buffer using muttprint and evince."
-  (let ((ps-file (make-temp-file "notmuch")))
+  (let ((ps-file (make-temp-file "notmuch" nil ".ps")))
     (notmuch-print-run-muttprint (list "--printer" (concat "TO_FILE:" ps-file)))
     (notmuch-print-run-evince ps-file)))
 
@@ -89,4 +93,8 @@ Optional OUTPUT allows passing a list of flags to muttprint."
   (set-buffer-modified-p nil)
   (funcall notmuch-print-mechanism msg))
 
+;;; _
+
 (provide 'notmuch-print)
+
+;;; notmuch-print.el ends here