summaryrefslogtreecommitdiff
path: root/lisp/mh-e/mh-mime.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/mh-e/mh-mime.el')
-rw-r--r--lisp/mh-e/mh-mime.el60
1 files changed, 24 insertions, 36 deletions
diff --git a/lisp/mh-e/mh-mime.el b/lisp/mh-e/mh-mime.el
index 70df9e6b0f2..ef702525b7b 100644
--- a/lisp/mh-e/mh-mime.el
+++ b/lisp/mh-e/mh-mime.el
@@ -1,4 +1,4 @@
-;;; mh-mime.el --- MH-E MIME support
+;;; mh-mime.el --- MH-E MIME support -*- lexical-binding: t; -*-
;; Copyright (C) 1993, 1995, 2001-2021 Free Software Foundation, Inc.
@@ -36,8 +36,6 @@
;; MIME option to mh-forward command to move to content-description
;; insertion point.
-;;; Change Log:
-
;;; Code:
(require 'mh-e)
@@ -190,9 +188,9 @@ Set from last use.")
;; XEmacs doesn't care.
(set-keymap-parent map mh-show-mode-map))
(mh-do-in-gnu-emacs
- (define-key map [mouse-2] 'mh-push-button))
+ (define-key map [mouse-2] #'mh-push-button))
(mh-do-in-xemacs
- (define-key map '(button2) 'mh-push-button))
+ (define-key map '(button2) #'mh-push-button))
(dolist (c mh-mime-button-commands)
(define-key map (cadr c) (car c)))
map))
@@ -214,11 +212,11 @@ Set from last use.")
(let ((map (make-sparse-keymap)))
(unless (>= (string-to-number emacs-version) 21)
(set-keymap-parent map mh-show-mode-map))
- (define-key map "\r" 'mh-press-button)
+ (define-key map "\r" #'mh-press-button)
(mh-do-in-gnu-emacs
- (define-key map [mouse-2] 'mh-push-button))
+ (define-key map [mouse-2] #'mh-push-button))
(mh-do-in-xemacs
- (define-key map '(button2) 'mh-push-button))
+ (define-key map '(button2) #'mh-push-button))
map))
@@ -259,9 +257,7 @@ usually reads the file \"/etc/mailcap\"."
(methods (mapcar (lambda (x) (list (cdr (assoc 'viewer x))))
(mailcap-mime-info type 'all)))
(def (caar methods))
- (prompt (format "Viewer%s: " (if def
- (format " (default %s)" def)
- "")))
+ (prompt (format-prompt "Viewer" def))
(method (completing-read prompt methods nil nil nil nil def))
(folder mh-show-folder-buffer)
(buffer-read-only nil))
@@ -395,9 +391,9 @@ do the work."
((and (or prompt
(equal t mh-mime-save-parts-default-directory))
mh-mime-save-parts-directory)
- (read-directory-name (format
- "Store in directory (default %s): "
- mh-mime-save-parts-directory)
+ (read-directory-name (format-prompt
+ "Store in directory"
+ mh-mime-save-parts-directory)
"" mh-mime-save-parts-directory t ""))
((stringp mh-mime-save-parts-default-directory)
mh-mime-save-parts-default-directory)
@@ -413,7 +409,7 @@ do the work."
(cd directory)
(setq mh-mime-save-parts-directory directory)
(let ((initial-size (mh-truncate-log-buffer)))
- (apply 'call-process
+ (apply #'call-process
(expand-file-name command mh-progs) nil t nil
(mh-list-to-string (list folder msg "-auto"
(if (not (mh-variant-p 'nmh))
@@ -452,7 +448,7 @@ decoding the same message multiple times."
(let ((b (point))
(clean-message-header mh-clean-message-header-flag)
(invisible-headers mh-invisible-header-fields-compiled)
- (visible-headers nil))
+ ) ;; (visible-headers nil)
(save-excursion
(save-restriction
(narrow-to-region b b)
@@ -474,7 +470,7 @@ decoding the same message multiple times."
(cond (clean-message-header
(mh-clean-msg-header (point-min)
invisible-headers
- visible-headers)
+ nil) ;; visible-headers
(goto-char (point-min)))
(t
(mh-start-of-uncleaned-message)))
@@ -489,15 +485,11 @@ decoding the same message multiple times."
(mh-display-emphasis)
(mm-handle-set-undisplayer
handle
- `(lambda ()
- (let (buffer-read-only)
- (if (fboundp 'remove-specifier)
- ;; This is only valid on XEmacs.
- (mapcar (lambda (prop)
- (remove-specifier
- (face-property 'default prop) (current-buffer)))
- '(background background-pixmap foreground)))
- (delete-region ,(point-min-marker) ,(point-max-marker)))))))))
+ (let ((beg (point-min-marker))
+ (end (point-max-marker)))
+ (lambda ()
+ (let ((inhibit-read-only t))
+ (delete-region beg end)))))))))
;;;###mh-autoload
(defun mh-decode-message-header ()
@@ -783,7 +775,7 @@ This is only useful if a Content-Disposition header is not present."
(funcall media-test handle) ; Since mm-inline-large-images is T,
; this only tells us if the image is
; something that emacs can display
- (let* ((image (mm-get-image handle)))
+ (let ((image (mm-get-image handle)))
(or (mh-do-in-xemacs
(and (mh-funcall-if-exists glyphp image)
(< (glyph-width image)
@@ -792,7 +784,7 @@ This is only useful if a Content-Disposition header is not present."
(or mh-max-inline-image-height
(window-pixel-height)))))
(mh-do-in-gnu-emacs
- (let ((size (mh-funcall-if-exists image-size image)))
+ (let ((size (and (fboundp 'image-size) (image-size image))))
(and size
(< (cdr size) (or mh-max-inline-image-height
(1- (window-height))))
@@ -1225,7 +1217,7 @@ The option `mh-compose-insertion' controls what type of tags are inserted."
t)
t t)))
(list description folder range)))
- (let ((messages (mapconcat 'identity (mh-list-to-string range) " ")))
+ (let ((messages (mapconcat #'identity (mh-list-to-string range) " ")))
(dolist (message (mh-translate-range folder messages))
(if (equal mh-compose-insertion 'mml)
(mh-mml-forward-message description folder (format "%s" message))
@@ -1258,11 +1250,7 @@ See also \\[mh-mh-to-mime]."
(interactive (list
(mml-minibuffer-read-description)
(mh-prompt-for-folder "Message from" mh-sent-from-folder nil)
- (read-string (concat "Messages"
- (if (numberp mh-sent-from-msg)
- (format " (default %d): "
- mh-sent-from-msg)
- ": ")))))
+ (read-string (format-prompt "Messages" mh-sent-from-msg))))
(beginning-of-line)
(insert "#forw [")
(and description
@@ -1596,7 +1584,7 @@ the possible security methods (see `mh-mml-method-default')."
(if current-prefix-arg
(let ((def (or (car mh-mml-cryptographic-method-history)
mh-mml-method-default)))
- (completing-read (format "Method (default %s): " def)
+ (completing-read (format-prompt "Method" def)
'(("pgp") ("pgpmime") ("smime"))
nil t nil 'mh-mml-cryptographic-method-history def))
mh-mml-method-default))
@@ -1731,7 +1719,7 @@ Optional argument DEFAULT is returned if a type isn't entered."
(type (or (and (not (equal probed-type "application/octet-stream"))
probed-type)
(completing-read
- (format "Content type (default %s): " default)
+ (format-prompt "Content type" default)
(mapcar #'list (mailcap-mime-types))))))
(if (not (equal type ""))
type