~theo/public-inbox

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch

[PATCH emacs] * lisp/mh-e: Enable lexical-binding in all the files

Details
Message ID
<163015123386.28116.9846105443279418210-0@git.sr.ht>
DKIM signature
missing
Download raw message
Patch: +114 -113
From: Stefan Monnier <monnier@iro.umontreal.ca>

* lisp/mh-e/mh-alias.el: Use lexical-binding.
(mh-alias-insert-file): Completion tables can be mere lists of strings.

* lisp/mh-e/mh-mime.el: Use lexical-binding.
(mh-mm-inline-message): Remove always-nil var `visible-headers`.

* lisp/mh-e/mh-search.el: Use lexical-binding.
(mh-search-folder): Remove unused var `pick-folder`.

* lisp/mh-e/mh-show.el: Use lexical-binding.
(mh-display-msg): Remove always-nil var `visible-headers`.

* lisp/mh-e/mh-utils.el: Use lexical-binding.
(completion-root-regexp): Always declare var.

* lisp/mh-e/mh-buffers.el: Use lexical-binding.
* lisp/mh-e/mh-comp.el: Use lexical-binding.
* lisp/mh-e/mh-folder.el: Use lexical-binding.
* lisp/mh-e/mh-funcs.el: Use lexical-binding.
* lisp/mh-e/mh-gnus.el: Use lexical-binding.
* lisp/mh-e/mh-identity.el: Use lexical-binding.
* lisp/mh-e/mh-inc.el: Use lexical-binding.
* lisp/mh-e/mh-junk.el: Use lexical-binding.
* lisp/mh-e/mh-letter.el: Use lexical-binding.
* lisp/mh-e/mh-limit.el: Use lexical-binding.
* lisp/mh-e/mh-print.el: Use lexical-binding.
* lisp/mh-e/mh-scan.el: Use lexical-binding.
* lisp/mh-e/mh-seq.el: Use lexical-binding.
* lisp/mh-e/mh-speed.el: Use lexical-binding.
* lisp/mh-e/mh-thread.el: Use lexical-binding.
* lisp/mh-e/mh-tool-bar.el: Use lexical-binding.
* lisp/mh-e/mh-xface.el: Use lexical-binding.
---
 lisp/mh-e/mh-alias.el    | 19 +++++++++----------
 lisp/mh-e/mh-buffers.el  |  2 +-
 lisp/mh-e/mh-comp.el     | 20 +++++++++++---------
 lisp/mh-e/mh-compat.el   |  2 +-
 lisp/mh-e/mh-e.el        | 22 +++++++++++-----------
 lisp/mh-e/mh-folder.el   | 24 ++++++++++++------------
 lisp/mh-e/mh-funcs.el    |  4 ++--
 lisp/mh-e/mh-gnus.el     |  2 +-
 lisp/mh-e/mh-identity.el | 12 ++++++------
 lisp/mh-e/mh-inc.el      |  4 ++--
 lisp/mh-e/mh-junk.el     |  2 +-
 lisp/mh-e/mh-letter.el   | 10 +++++-----
 lisp/mh-e/mh-limit.el    |  4 ++--
 lisp/mh-e/mh-mime.el     | 20 ++++++++++----------
 lisp/mh-e/mh-print.el    |  7 ++++---
 lisp/mh-e/mh-scan.el     |  4 ++--
 lisp/mh-e/mh-search.el   | 12 ++++++------
 lisp/mh-e/mh-seq.el      | 12 ++++++------
 lisp/mh-e/mh-show.el     |  8 ++++----
 lisp/mh-e/mh-speed.el    | 12 ++++++------
 lisp/mh-e/mh-thread.el   |  2 +-
 lisp/mh-e/mh-tool-bar.el |  6 +++---
 lisp/mh-e/mh-utils.el    | 15 +++++++--------
 lisp/mh-e/mh-xface.el    |  2 +-
 24 files changed, 114 insertions(+), 113 deletions(-)

diff --git a/lisp/mh-e/mh-alias.el b/lisp/mh-e/mh-alias.el
index 012725cab6..67c019aa17 100644
--- a/lisp/mh-e/mh-alias.el
+++ b/lisp/mh-e/mh-alias.el
@@ -1,4 +1,4 @@
;;; mh-alias.el --- MH-E mail alias completion and expansion
;;; mh-alias.el --- MH-E mail alias completion and expansion  -*- lexical-binding: t; -*-

;; Copyright (C) 1994-1997, 2001-2021 Free Software Foundation, Inc.

@@ -42,8 +42,8 @@
  "Time aliases were last loaded.")
(defvar mh-alias-read-address-map
  (let ((map (copy-keymap minibuffer-local-completion-map)))
    (define-key map "," 'mh-alias-minibuffer-confirm-address)
    (define-key map " " 'self-insert-command)
    (define-key map "," #'mh-alias-minibuffer-confirm-address)
    (define-key map " " #'self-insert-command)
    map))

(defcustom mh-alias-system-aliases
@@ -270,9 +270,9 @@ Blind aliases or users from /etc/passwd are not expanded."
                  (t (split-string
                      (completing-read prompt mh-alias-alist nil nil) ",")))))
      (if (not mh-alias-expand-aliases-flag)
          (mapconcat 'identity the-answer ", ")
          (mapconcat #'identity the-answer ", ")
        ;; Loop over all elements, checking if in passwd alias or blind first
        (mapconcat 'mh-alias-expand the-answer ",\n ")))))
        (mapconcat #'mh-alias-expand the-answer ",\n ")))))

;;;###mh-autoload
(defun mh-alias-minibuffer-confirm-address ()
@@ -427,10 +427,10 @@ contains it."
      (if (or (not alias)
              (string-equal alias (mh-alias-ali alias))) ;alias doesn't exist
          (completing-read "Alias file: "
                           (mapcar 'list mh-alias-insert-file) nil t)
                           (mapcar #'list mh-alias-insert-file) nil t)
        (or (mh-alias-which-file-has-alias alias mh-alias-insert-file)
            (completing-read "Alias file: "
                             (mapcar 'list mh-alias-insert-file) nil t)))))
                             (mapcar #'list mh-alias-insert-file) nil t)))))
   ((and mh-alias-insert-file (stringp mh-alias-insert-file))
    mh-alias-insert-file)
   (t
@@ -449,11 +449,10 @@ set `mh-alias-insert-file' or the \"Aliasfile:\" profile component"))
        (car autolist))
       ((or (not alias)
            (string-equal alias (mh-alias-ali alias))) ;alias doesn't exist
        (completing-read "Alias file: " (mapcar 'list autolist) nil t))
        (completing-read "Alias file: " autolist nil t))
       (t
        (or (mh-alias-which-file-has-alias alias autolist)
            (completing-read "Alias file: "
                             (mapcar 'list autolist) nil t))))))))
            (completing-read "Alias file: " autolist nil t))))))))

;;;###mh-autoload
(defun mh-alias-address-to-alias (address)
diff --git a/lisp/mh-e/mh-buffers.el b/lisp/mh-e/mh-buffers.el
index 55f74b6585..a32f61c82e 100644
--- a/lisp/mh-e/mh-buffers.el
+++ b/lisp/mh-e/mh-buffers.el
@@ -1,4 +1,4 @@
;;; mh-buffers.el --- MH-E buffer constants and utilities
;;; mh-buffers.el --- MH-E buffer constants and utilities  -*- lexical-binding: t; -*-

;; Copyright (C) 1993, 1995, 1997, 2000-2021 Free Software Foundation,
;; Inc.
diff --git a/lisp/mh-e/mh-comp.el b/lisp/mh-e/mh-comp.el
index 0dedb7e0ad..c1cd6c1a9e 100644
--- a/lisp/mh-e/mh-comp.el
+++ b/lisp/mh-e/mh-comp.el
@@ -1,4 +1,4 @@
;;; mh-comp.el --- MH-E functions for composing and sending messages
;;; mh-comp.el --- MH-E functions for composing and sending messages  -*- lexical-binding: t; -*-

;; Copyright (C) 1993, 1995, 1997, 2000-2021 Free Software Foundation,
;; Inc.
@@ -719,12 +719,14 @@ message and scan line."
               (mh-insert-fields field value)))))
         (mh-components-to-list components-file))
        (delete-file components-file))
      (mh-insert-fields "Resent-To:" (mapconcat 'identity (list to comp-to) ", ")
                        "Resent-Cc:" (mapconcat 'identity (list cc comp-cc) ", ")
                        "Resent-Fcc:" (mapconcat 'identity (list fcc
                                                                 comp-fcc) ", ")
                        "Resent-Bcc:" (mapconcat 'identity (list bcc
                                                                 comp-bcc) ", ")
      (mh-insert-fields "Resent-To:" (mapconcat #'identity (list to comp-to)
                                                ", ")
                        "Resent-Cc:" (mapconcat #'identity (list cc comp-cc)
                                                ", ")
                        "Resent-Fcc:" (mapconcat #'identity (list fcc comp-fcc)
                                                 ", ")
                        "Resent-Bcc:" (mapconcat #'identity (list bcc comp-bcc)
                                                 ", ")
                        "Resent-From:" from)
      (save-buffer)
      (message "Redistributing...")
@@ -1096,7 +1098,7 @@ letter."
  (setq mode-line-buffer-identification (list "    {%b}"))
  (mh-logo-display)
  (mh-make-local-hook 'kill-buffer-hook)
  (add-hook 'kill-buffer-hook 'mh-tidy-draft-buffer nil t)
  (add-hook 'kill-buffer-hook #'mh-tidy-draft-buffer nil t)
  (run-hook-with-args 'mh-compose-letter-function to subject cc))

(defun mh-insert-x-mailer ()
@@ -1165,7 +1167,7 @@ This should be the last function called when composing the draft."
MSG can be a message number, a list of message numbers, or a sequence.
The hook `mh-annotate-msg-hook' is run after annotating; see its
documentation for variables it can use."
  (apply 'mh-exec-cmd "anno" folder
  (apply #'mh-exec-cmd "anno" folder
         (if (listp msg) (append msg args) (cons msg args)))
  (save-excursion
    (cond ((get-buffer folder)          ; Buffer may be deleted
diff --git a/lisp/mh-e/mh-compat.el b/lisp/mh-e/mh-compat.el
index 6d657afa3e..0363c5aada 100644
--- a/lisp/mh-e/mh-compat.el
+++ b/lisp/mh-e/mh-compat.el
@@ -42,7 +42,7 @@
(eval-when-compile (require 'mh-acros))

(mh-do-in-gnu-emacs
  (defalias 'mh-require 'require))
  (defalias 'mh-require #'require))

(mh-do-in-xemacs
  (defun mh-require (feature &optional filename noerror)
diff --git a/lisp/mh-e/mh-e.el b/lisp/mh-e/mh-e.el
index eaf8eb5565..11296a53b9 100644
--- a/lisp/mh-e/mh-e.el
+++ b/lisp/mh-e/mh-e.el
@@ -522,7 +522,7 @@ parsed by MH-E."
    (let* ((initial-size (mh-truncate-log-buffer))
           (start (point))
           (args (mh-list-to-string args)))
      (apply 'call-process (expand-file-name command mh-progs) nil t nil args)
      (apply #'call-process (expand-file-name command mh-progs) nil t nil args)
      (when (> (buffer-size) initial-size)
        (save-excursion
          (goto-char start)
@@ -560,7 +560,7 @@ ARGS are passed to COMMAND as command line arguments."
  (with-current-buffer (get-buffer-create mh-log-buffer)
    (mh-truncate-log-buffer))
  (let* ((process-connection-type nil)
         (process (apply 'start-process
         (process (apply #'start-process
                         command nil
                         (expand-file-name command mh-progs)
                         (mh-list-to-string args))))
@@ -602,7 +602,7 @@ RAISE-ERROR is non-nil, in which case an error is signaled if
  (set-buffer (get-buffer-create mh-temp-buffer))
  (erase-buffer)
  (let ((value
         (apply 'call-process
         (apply #'call-process
                (expand-file-name command mh-progs) nil t nil
                args)))
    (goto-char (point-min))
@@ -616,7 +616,7 @@ Put the output into buffer after point.
Set mark after inserted text.
Output is expected to be shown to user, not parsed by MH-E."
  (push-mark (point) t)
  (apply 'call-process
  (apply #'call-process
         (expand-file-name command mh-progs) nil t display
         (mh-list-to-string args))

@@ -650,7 +650,7 @@ preserves whether the mark is active or not."
  "Execute MH library command COMMAND with ARGS.
Put the output into buffer after point.
Set mark after inserted text."
  (apply 'mh-exec-cmd-output (expand-file-name command mh-lib-progs) nil args))
  (apply #'mh-exec-cmd-output (expand-file-name command mh-lib-progs) nil args))

(defun mh-handle-process-error (command status)
  "Raise error if COMMAND returned non-zero STATUS, otherwise return STATUS."
@@ -974,7 +974,7 @@ necessary and can actually cause problems."
  :set (lambda (symbol value)
         (set-default symbol value)     ;Done in mh-variant-set-variant!
         (mh-variant-set value))
  :initialize 'custom-initialize-default
  :initialize #'custom-initialize-default
  :group 'mh-e
  :package-version '(MH-E . "8.0"))

@@ -1548,7 +1548,7 @@ as the result is undefined."
                                 '(radio)
                                 (mapcar
                                  (lambda (arg) `(const ,arg))
                                  (mapcar 'car mh-identity-list))))
                                  (mapcar #'car mh-identity-list))))
                         (cons :tag "Fcc Field"
                               (const "fcc")
                               (string :tag "Value"))
@@ -1575,7 +1575,7 @@ See `mh-identity-list'."
         '(radio)
         (cons '(const :tag "None" nil)
               (mapcar (lambda (arg) `(const ,arg))
                       (mapcar 'car mh-identity-list))))
                       (mapcar #'car mh-identity-list))))
  :group 'mh-identity
  :package-version '(MH-E . "7.1"))

@@ -1744,7 +1744,7 @@ bogofilter, then you can set this option to \"Bogofilter\"."
                 (const :tag "SpamAssassin" spamassassin)
                 (const :tag "Bogofilter" bogofilter)
                 (const :tag "SpamProbe" spamprobe))
  :set 'mh-junk-choose
  :set #'mh-junk-choose
  :group 'mh-junk
  :package-version '(MH-E . "7.3"))

@@ -2005,7 +2005,7 @@ call `mh-set-cmd-note' with the width specified by your format file
you would use \"(mh-set-cmd-note 4)\"."
  :type 'boolean
  :group 'mh-scan-line-formats
  :set 'mh-adaptive-cmd-note-flag-check
  :set #'mh-adaptive-cmd-note-flag-check
  :package-version '(MH-E . "7.0"))

(defun mh-scan-format-file-check (symbol value)
@@ -2044,7 +2044,7 @@ Emacs start with 0)."
                 (const :tag "Use Default scan Format" nil)
                 (file  :tag "Specify a scan Format File"))
  :group 'mh-scan-line-formats
  :set 'mh-scan-format-file-check
  :set #'mh-scan-format-file-check
  :package-version '(MH-E . "6.0"))

(defun mh-adaptive-cmd-note-flag-check (symbol value)
diff --git a/lisp/mh-e/mh-folder.el b/lisp/mh-e/mh-folder.el
index 555d13d723..2e288064f1 100644
--- a/lisp/mh-e/mh-folder.el
+++ b/lisp/mh-e/mh-folder.el
@@ -1,4 +1,4 @@
;;; mh-folder.el --- MH-Folder mode
;;; mh-folder.el --- MH-Folder mode  -*- lexical-binding: t; -*-

;; Copyright (C) 2002-2003, 2005-2021 Free Software Foundation, Inc.

@@ -209,10 +209,10 @@ annotation.")

;; Use defalias to make sure the documented primary key bindings
;; appear in menu lists.
(defalias 'mh-alt-show 'mh-show)
(defalias 'mh-alt-refile-msg 'mh-refile-msg)
(defalias 'mh-alt-send 'mh-send)
(defalias 'mh-alt-visit-folder 'mh-visit-folder)
(defalias 'mh-alt-show #'mh-show)
(defalias 'mh-alt-refile-msg #'mh-refile-msg)
(defalias 'mh-alt-send #'mh-send)
(defalias 'mh-alt-visit-folder #'mh-visit-folder)

;; Save the "b" binding for a future `back'. Maybe?
(gnus-define-keys  mh-folder-mode-map
@@ -650,11 +650,11 @@ perform the operation on all messages in that region.
  (auto-save-mode -1)
  (setq buffer-offer-save t)
  (mh-make-local-hook (mh-write-file-functions))
  (add-hook (mh-write-file-functions) 'mh-execute-commands nil t)
  (add-hook (mh-write-file-functions) #'mh-execute-commands nil t)
  (make-local-variable 'revert-buffer-function)
  (make-local-variable 'hl-line-mode)   ; avoid pollution
  (mh-funcall-if-exists hl-line-mode 1)
  (setq revert-buffer-function 'mh-undo-folder)
  (setq revert-buffer-function #'mh-undo-folder)
  (add-to-list 'minor-mode-alist '(mh-showing-mode " Show"))
  (mh-do-in-xemacs
    (easy-menu-add mh-folder-sequence-menu)
@@ -1117,7 +1117,7 @@ called interactively."
         (message "Destination folder: %s" (cdr mh-last-destination)))
        (t
         (mh-iterate-on-range msg range
           (apply 'mh-write-msg-to-file msg (cdr mh-last-destination)))
           (apply #'mh-write-msg-to-file msg (cdr mh-last-destination)))
         (mh-next-msg interactive-flag))))

;;;###mh-autoload
@@ -1606,7 +1606,7 @@ after the commands are processed."
      ;; Now delete messages
      (cond (mh-delete-list
             (setq redraw-needed-flag t)
             (apply 'mh-exec-cmd "rmm" folder
             (apply #'mh-exec-cmd "rmm" folder
                    (mh-coalesce-msg-list mh-delete-list))
             (mh-delete-scan-msgs mh-delete-list)
             (setq mh-delete-list nil)))
@@ -1620,8 +1620,8 @@ after the commands are processed."
          ;; (mh-refile-a-msg nil (intern dest))
          ;; (mh-delete-a-msg nil)))
          (if (null dest)
              (apply 'mh-exec-cmd "rmm" folder msg-list)
            (apply 'mh-exec-cmd "refile" "-src" folder dest msg-list)
              (apply #'mh-exec-cmd "rmm" folder msg-list)
            (apply #'mh-exec-cmd "refile" "-src" folder dest msg-list)
            (push dest folders-changed))
          (setq redraw-needed-flag t)
          (mh-delete-scan-msgs mh-blacklist)
@@ -1703,7 +1703,7 @@ after the commands are processed."
      (mh-recenter nil)))

;;;###mh-autoload
(defun mh-make-folder-mode-line (&optional ignored)
(defun mh-make-folder-mode-line (&optional _ignored)
  "Set the fields of the mode line for a folder buffer.
The optional argument is now obsolete and IGNORED. It used to be
used to pass in what is now stored in the buffer-local variable
diff --git a/lisp/mh-e/mh-funcs.el b/lisp/mh-e/mh-funcs.el
index 309bcb4b49..38ba43188d 100644
--- a/lisp/mh-e/mh-funcs.el
+++ b/lisp/mh-e/mh-funcs.el
@@ -1,4 +1,4 @@
;;; mh-funcs.el --- MH-E functions not everyone will use right away
;;; mh-funcs.el --- MH-E functions not everyone will use right away  -*- lexical-binding: t; -*-

;; Copyright (C) 1993, 1995, 2001-2021 Free Software Foundation, Inc.

@@ -348,7 +348,7 @@ See `mh-store-msg' for a description of DIRECTORY."
        (error "Error occurred during execution of %s" command)))))

;;;###mh-autoload
(defun mh-undo-folder (&rest ignored)
(defun mh-undo-folder (&rest _ignored)
  "Undo all refiles and deletes in the current folder.
Arguments are IGNORED (for `revert-buffer')."
  (interactive)
diff --git a/lisp/mh-e/mh-gnus.el b/lisp/mh-e/mh-gnus.el
index 6a9851662a..ab65637157 100644
--- a/lisp/mh-e/mh-gnus.el
+++ b/lisp/mh-e/mh-gnus.el
@@ -1,4 +1,4 @@
;;; mh-gnus.el --- make MH-E compatible with various versions of Gnus
;;; mh-gnus.el --- make MH-E compatible with various versions of Gnus  -*- lexical-binding: t; -*-

;; Copyright (C) 2003-2004, 2006-2021 Free Software Foundation, Inc.

diff --git a/lisp/mh-e/mh-identity.el b/lisp/mh-e/mh-identity.el
index 1844399217..aeab049756 100644
--- a/lisp/mh-e/mh-identity.el
+++ b/lisp/mh-e/mh-identity.el
@@ -1,4 +1,4 @@
;;; mh-identity.el --- multiple identify support for MH-E
;;; mh-identity.el --- multiple identify support for MH-E  -*- lexical-binding: t; -*-

;; Copyright (C) 2002-2021 Free Software Foundation, Inc.

@@ -50,7 +50,7 @@ This is normally set as part of an Identity in
(defvar mh-identity-menu nil
  "The Identity menu.")

(defalias 'mh-identity-make-menu-no-autoload 'mh-identity-make-menu)
(defalias 'mh-identity-make-menu-no-autoload #'mh-identity-make-menu)

;;;###mh-autoload
(defun mh-identity-make-menu ()
@@ -74,7 +74,7 @@ See `mh-identity-add-menu'."
     (mapcar (lambda (arg)
               `[,arg  (mh-insert-identity ,arg) :style radio
                       :selected (equal mh-identity-local ,arg)])
             (mapcar 'car mh-identity-list))
             (mapcar #'car mh-identity-list))
     '(["None"
        (mh-insert-identity "None") :style radio
        :selected (not mh-identity-local)]
@@ -142,7 +142,7 @@ See `mh-identity-list'."
          (completing-read
           "Identity: "
           (cons '("None")
                 (mapcar 'list (mapcar 'car mh-identity-list)))
                 (mapcar #'list (mapcar #'car mh-identity-list)))
           nil t default nil default))
    (if (eq identity "None")
        nil
@@ -171,8 +171,8 @@ See `mh-identity-list'."
          "Identity: "
          (if mh-identity-local
              (cons '("None")
                    (mapcar 'list (mapcar 'car mh-identity-list)))
            (mapcar 'list (mapcar 'car mh-identity-list)))
                    (mapcar #'list (mapcar #'car mh-identity-list)))
            (mapcar #'list (mapcar #'car mh-identity-list)))
          nil t)
         nil))

diff --git a/lisp/mh-e/mh-inc.el b/lisp/mh-e/mh-inc.el
index 32f731799b..90d5489526 100644
--- a/lisp/mh-e/mh-inc.el
+++ b/lisp/mh-e/mh-inc.el
@@ -1,4 +1,4 @@
;;; mh-inc.el --- MH-E "inc" and separate mail spool handling
;;; mh-inc.el --- MH-E "inc" and separate mail spool handling  -*- lexical-binding: t; -*-

;; Copyright (C) 2003-2004, 2006-2021 Free Software Foundation, Inc.

@@ -58,7 +58,7 @@
                    (mh-inc-spool-generator folder spool)
                    (mh-inc-spool-def-key key folder))))))

(defalias 'mh-inc-spool-make-no-autoload 'mh-inc-spool-make)
(defalias 'mh-inc-spool-make-no-autoload #'mh-inc-spool-make)

(defun mh-inc-spool-generator (folder spool)
  "Create a command to inc into FOLDER from SPOOL file."
diff --git a/lisp/mh-e/mh-junk.el b/lisp/mh-e/mh-junk.el
index b49c632249..5a407947a0 100644
--- a/lisp/mh-e/mh-junk.el
+++ b/lisp/mh-e/mh-junk.el
@@ -1,4 +1,4 @@
;;; mh-junk.el --- MH-E interface to anti-spam measures
;;; mh-junk.el --- MH-E interface to anti-spam measures  -*- lexical-binding: t; -*-

;; Copyright (C) 2003-2021 Free Software Foundation, Inc.

diff --git a/lisp/mh-e/mh-letter.el b/lisp/mh-e/mh-letter.el
index f5ad73d800..c44b78ad12 100644
--- a/lisp/mh-e/mh-letter.el
+++ b/lisp/mh-e/mh-letter.el
@@ -1,4 +1,4 @@
;;; mh-letter.el --- MH-Letter mode
;;; mh-letter.el --- MH-Letter mode  -*- lexical-binding: t; -*-

;; Copyright (C) 1993, 1995, 1997, 2000-2021 Free Software Foundation,
;; Inc.
@@ -334,15 +334,15 @@ order).
  ;; Maybe we want to use the existing Mail menu from mail-mode in
  ;; 9.0; in the mean time, let's remove it since the redundancy will
  ;; only produce confusion.
  (define-key mh-letter-mode-map [menu-bar mail] 'undefined)
  (define-key mh-letter-mode-map [menu-bar mail] #'undefined)
  (mh-do-in-xemacs (easy-menu-remove mail-menubar-menu))
  (setq fill-column mh-letter-fill-column)
  (add-hook 'completion-at-point-functions
            'mh-letter-completion-at-point nil 'local)
            #'mh-letter-completion-at-point nil 'local)
  ;; If text-mode-hook turned on auto-fill, tune it for messages
  (when auto-fill-function
    (make-local-variable 'auto-fill-function)
    (setq auto-fill-function 'mh-auto-fill-for-letter)))
    (setq auto-fill-function #'mh-auto-fill-for-letter)))



@@ -851,7 +851,7 @@ body."
             (forward-line)))))

;;;###mh-autoload
(defun mh-position-on-field (field &optional ignored)
(defun mh-position-on-field (field &optional _ignored)
  "Move to the end of the FIELD in the header.
Move to end of entire header if FIELD not found.
Returns non-nil if FIELD was found.
diff --git a/lisp/mh-e/mh-limit.el b/lisp/mh-e/mh-limit.el
index 036522f3dd..08f1b4093f 100644
--- a/lisp/mh-e/mh-limit.el
+++ b/lisp/mh-e/mh-limit.el
@@ -1,4 +1,4 @@
;;; mh-limit.el --- MH-E display limits
;;; mh-limit.el --- MH-E display limits  -*- lexical-binding: t; -*-

;; Copyright (C) 2001-2003, 2006-2021 Free Software Foundation, Inc.

@@ -237,7 +237,7 @@ Return number of messages put in the sequence:
              (setq list (cons (mh-get-msg-num t) list)))
          (if (assoc 'subject mh-seq-list) (mh-delete-seq 'subject))
          ;; sort the result into a sequence
          (let ((sorted-list (sort (copy-sequence list) 'mh-lessp)))
          (let ((sorted-list (sort (copy-sequence list) #'mh-lessp)))
            (while sorted-list
              (mh-add-msgs-to-seq (car sorted-list) 'subject nil)
              (setq sorted-list (cdr sorted-list)))
diff --git a/lisp/mh-e/mh-mime.el b/lisp/mh-e/mh-mime.el
index 70df9e6b0f..bf63ac36cf 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.

@@ -190,9 +190,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 +214,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))


@@ -413,7 +413,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 +452,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 +474,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)))
@@ -1225,7 +1225,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))
diff --git a/lisp/mh-e/mh-print.el b/lisp/mh-e/mh-print.el
index 513a1bc953..d084cf63e9 100644
--- a/lisp/mh-e/mh-print.el
+++ b/lisp/mh-e/mh-print.el
@@ -1,4 +1,4 @@
;;; mh-print.el --- MH-E printing support
;;; mh-print.el --- MH-E printing support  -*- lexical-binding: t; -*-

;; Copyright (C) 2003-2021 Free Software Foundation, Inc.

@@ -207,8 +207,9 @@ Consider using \\[mh-ps-print-msg] instead."
    ;; Print scan listing if we have more than one message.
    (if (> (length msgs) 1)
        (let* ((msgs-string
                (mapconcat 'identity (mh-list-to-string
                                      (mh-coalesce-msg-list msgs)) " "))
                (mapconcat #'identity (mh-list-to-string
                                       (mh-coalesce-msg-list msgs))
                           " "))
               (lpr-command
                (format mh-lpr-command-format
                        (cond ((listp range)
diff --git a/lisp/mh-e/mh-scan.el b/lisp/mh-e/mh-scan.el
index cec331389b..f00ab22958 100644
--- a/lisp/mh-e/mh-scan.el
+++ b/lisp/mh-e/mh-scan.el
@@ -1,4 +1,4 @@
;;; mh-scan.el --- MH-E scan line constants and utilities
;;; mh-scan.el --- MH-E scan line constants and utilities  -*- lexical-binding: t; -*-

;; Copyright (C) 1993, 1995, 1997, 2000-2021 Free Software Foundation,
;; Inc.
@@ -497,7 +497,7 @@ with `mh-scan-msg-format-string'."
        (width 0))
    (with-current-buffer tmp-buffer
      (erase-buffer)
      (apply 'call-process
      (apply #'call-process
             (expand-file-name mh-scan-prog mh-progs) nil '(t nil) nil
             (list folder "last" "-format" "%(msg)"))
      (goto-char (point-min))
diff --git a/lisp/mh-e/mh-search.el b/lisp/mh-e/mh-search.el
index 05ba12d761..aece03ef0f 100644
--- a/lisp/mh-e/mh-search.el
+++ b/lisp/mh-e/mh-search.el
@@ -1,4 +1,4 @@
;;; mh-search  ---  MH-Search mode
;;; mh-search  ---  MH-Search mode  -*- lexical-binding: t; -*-

;; Copyright (C) 1993, 1995, 2001-2021 Free Software Foundation, Inc.

@@ -332,7 +332,7 @@ configuration and is used when the search folder is dismissed."
  (interactive (list (mh-prompt-for-folder "Search" mh-current-folder nil nil t)
                     (current-window-configuration)))
  ;; FIXME: `pick-folder' is unused!
  (let ((pick-folder (if (equal folder "+") mh-current-folder folder)))
  (let () ;; (pick-folder (if (equal folder "+") mh-current-folder folder))
    (switch-to-buffer-other-window "search-pattern")
    (if (or (zerop (buffer-size))
            (not (y-or-n-p "Reuse pattern? ")))
@@ -356,7 +356,7 @@ configuration and is used when the search folder is dismissed."
          "---------\n")
  (mh-search-mode)
  (goto-char (point-min))
  (dotimes (i 5)
  (dotimes (_ 5)
    (add-text-properties (point) (1+ (point)) '(front-sticky t))
    (add-text-properties (- (mh-line-end-position) 2)
                         (1- (mh-line-end-position))
@@ -453,7 +453,7 @@ search all folders."

(defvar mh-flists-search-folders)

(defun mh-flists-execute (&rest ignored)
(defun mh-flists-execute (&rest _ignored)
  "Execute flists.
Search for messages belonging to `mh-flists-sequence' in the
folders specified by `mh-flists-search-folders'. If
@@ -880,7 +880,7 @@ used to search."
              folder-path
            (format "%s/" folder-path)))))

(defalias 'mh-swish++-next-result 'mh-swish-next-result)
(defalias 'mh-swish++-next-result #'mh-swish-next-result)

(defun mh-swish++-regexp-builder (regexp-list)
  "Generate query for swish++.
@@ -1853,7 +1853,7 @@ PROC is used to convert the value to actual data."
                                    (1+ last-slash) (1- last-space)))
                 (buffer-substring-no-properties (1+ last-space) end))))))

(defalias 'mh-md5-parser 'mh-openssl-parser)
(defalias 'mh-md5-parser #'mh-openssl-parser)

;;;###mh-autoload
(defun mh-index-update-maps (folder &optional origin-map)
diff --git a/lisp/mh-e/mh-seq.el b/lisp/mh-e/mh-seq.el
index e8a03f6704..f4b02c1974 100644
--- a/lisp/mh-e/mh-seq.el
+++ b/lisp/mh-e/mh-seq.el
@@ -1,4 +1,4 @@
;;; mh-seq.el --- MH-E sequences support
;;; mh-seq.el --- MH-E sequences support  -*- lexical-binding: t; -*-

;; Copyright (C) 1993, 1995, 2001-2021 Free Software Foundation, Inc.

@@ -156,7 +156,7 @@ The list appears in a buffer named \"*MH-E Sequences*\"."
          (let ((name (mh-seq-name (car seq-list)))
                (sorted-seq-msgs
                 (mh-coalesce-msg-list
                  (sort (copy-sequence (mh-seq-msgs (car seq-list))) '<)))
                  (sort (copy-sequence (mh-seq-msgs (car seq-list))) #'<)))
                name-spec)
            (insert (setq name-spec (format (format "%%%ss:" max-len) name)))
            (while sorted-seq-msgs
@@ -191,7 +191,7 @@ MESSAGE appears."
             (cond (dest-folder (format " (to be refiled to %s)" dest-folder))
                   (deleted-flag (format " (to be deleted)"))
                   (t ""))
             (mapconcat 'concat
             (mapconcat #'concat
                        (mh-list-to-string (mh-seq-containing-msg message t))
                        " "))))

@@ -494,13 +494,13 @@ folder buffer are not updated."
  ;; Add to a SEQUENCE each message the list of MSGS.
  (if (and (mh-valid-seq-p seq) (not (mh-folder-name-p seq)))
      (if msgs
          (apply 'mh-exec-cmd "mark" mh-current-folder "-add"
          (apply #'mh-exec-cmd "mark" mh-current-folder "-add"
                 "-sequence" (symbol-name seq)
                 (mh-coalesce-msg-list msgs)))))

(defun mh-canonicalize-sequence (msgs)
  "Sort MSGS in decreasing order and remove duplicates."
  (let* ((sorted-msgs (sort (copy-sequence msgs) '>))
  (let* ((sorted-msgs (sort (copy-sequence msgs) #'>))
         (head sorted-msgs))
    (while (cdr head)
      (if (= (car head) (cadr head))
@@ -565,7 +565,7 @@ OP is one of `widen' and `unthread'."
(defvar mh-range-seq-names)
(defvar mh-range-history ())
(defvar mh-range-completion-map (copy-keymap minibuffer-local-completion-map))
(define-key mh-range-completion-map " " 'self-insert-command)
(define-key mh-range-completion-map " " #'self-insert-command)

;;;###mh-autoload
(defun mh-interactive-range (range-prompt &optional default)
diff --git a/lisp/mh-e/mh-show.el b/lisp/mh-e/mh-show.el
index 1d25b14732..cb9819f17c 100644
--- a/lisp/mh-e/mh-show.el
+++ b/lisp/mh-e/mh-show.el
@@ -1,4 +1,4 @@
;;; mh-show.el --- MH-Show mode
;;; mh-show.el --- MH-Show mode  -*- lexical-binding: t; -*-

;; Copyright (C) 1993, 1995, 1997, 2000-2021 Free Software Foundation,
;; Inc.
@@ -195,7 +195,7 @@ Sets the current buffer to the show buffer."
    (let ((formfile mh-mhl-format-file)
          (clean-message-header mh-clean-message-header-flag)
          (invisible-headers mh-invisible-header-fields-compiled)
          (visible-headers nil)
          ;; (visible-headers nil)
          (msg-filename (mh-msg-filename msg-num folder-name))
          (show-buffer mh-show-buffer)
          (mm-inline-media-tests mh-mm-inline-media-tests))
@@ -241,7 +241,7 @@ Sets the current buffer to the show buffer."
             (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)))
@@ -862,7 +862,7 @@ See also `mh-folder-mode'.
      (turn-on-font-lock))
  (when mh-decode-mime-flag
    (mh-make-local-hook 'kill-buffer-hook)
    (add-hook 'kill-buffer-hook 'mh-mime-cleanup nil t))
    (add-hook 'kill-buffer-hook #'mh-mime-cleanup nil t))
  (mh-do-in-xemacs
    (easy-menu-add mh-show-sequence-menu)
    (easy-menu-add mh-show-message-menu)
diff --git a/lisp/mh-e/mh-speed.el b/lisp/mh-e/mh-speed.el
index 7cbd42c8ea..b2deacf6a7 100644
--- a/lisp/mh-e/mh-speed.el
+++ b/lisp/mh-e/mh-speed.el
@@ -1,4 +1,4 @@
;;; mh-speed.el --- MH-E speedbar support
;;; mh-speed.el --- MH-E speedbar support  -*- lexical-binding: t; -*-

;; Copyright (C) 2002-2021 Free Software Foundation, Inc.

@@ -100,9 +100,9 @@

;; Alphabetical.

(defalias 'mh-speed-contract-folder 'mh-speed-toggle)
(defalias 'mh-speed-contract-folder #'mh-speed-toggle)

(defalias 'mh-speed-expand-folder 'mh-speed-toggle)
(defalias 'mh-speed-expand-folder #'mh-speed-toggle)

(defun mh-speed-refresh ()
  "Regenerates the list of folders in the speedbar.
@@ -202,9 +202,9 @@ created."
      (mh-speed-flists nil))))

;;;###mh-autoload
(defalias 'mh-show-speedbar-buttons 'mh-folder-speedbar-buttons)
(defalias 'mh-show-speedbar-buttons #'mh-folder-speedbar-buttons)
;;;###mh-autoload
(defalias 'mh-letter-speedbar-buttons 'mh-folder-speedbar-buttons)
(defalias 'mh-letter-speedbar-buttons #'mh-folder-speedbar-buttons)

(defmacro mh-speed-select-attached-frame ()
  "Compatibility macro to handle speedbar versions 0.11a and 0.14beta4."
@@ -431,7 +431,7 @@ flists is run only for that one folder."
               (setq mh-speed-flists-folder nil)
               (mh-process-kill-without-query mh-speed-flists-process)
               (set-process-filter mh-speed-flists-process
                                   'mh-speed-parse-flists-output)))))))
                                   #'mh-speed-parse-flists-output)))))))

;; Copied from mh-make-folder-list-filter...
;; XXX Refactor to use mh-make-folder-list-filer?
diff --git a/lisp/mh-e/mh-thread.el b/lisp/mh-e/mh-thread.el
index 365746259a..a7878aaae9 100644
--- a/lisp/mh-e/mh-thread.el
+++ b/lisp/mh-e/mh-thread.el
@@ -1,4 +1,4 @@
;;; mh-thread.el --- MH-E threading support
;;; mh-thread.el --- MH-E threading support  -*- lexical-binding: t; -*-

;; Copyright (C) 2002-2004, 2006-2021 Free Software Foundation, Inc.

diff --git a/lisp/mh-e/mh-tool-bar.el b/lisp/mh-e/mh-tool-bar.el
index 7dbddbc891..40a430b964 100644
--- a/lisp/mh-e/mh-tool-bar.el
+++ b/lisp/mh-e/mh-tool-bar.el
@@ -1,4 +1,4 @@
;;; mh-tool-bar.el --- MH-E tool bar support
;;; mh-tool-bar.el --- MH-E tool bar support  -*- lexical-binding: t; -*-

;; Copyright (C) 2002-2003, 2005-2021 Free Software Foundation, Inc.

@@ -356,7 +356,7 @@ Use SEQUENCE-MAP if display is limited; DEFAULT-MAP otherwise."
        '(list ,@(mapcar (lambda (x) `(quote ,x)) folder-defaults))
        "List of buttons to include in MH-Folder tool bar."
        :group 'mh-tool-bar
        :set 'mh-tool-bar-folder-buttons-set
        :set #'mh-tool-bar-folder-buttons-set
        :type '(set ,@(cl-loop for x in folder-buttons
                               for y in folder-docs
                               collect `(const :tag ,y ,x)))
@@ -367,7 +367,7 @@ Use SEQUENCE-MAP if display is limited; DEFAULT-MAP otherwise."
        '(list ,@(mapcar (lambda (x) `(quote ,x)) letter-defaults))
        "List of buttons to include in MH-Letter tool bar."
        :group 'mh-tool-bar
        :set 'mh-tool-bar-letter-buttons-set
        :set #'mh-tool-bar-letter-buttons-set
        :type '(set ,@(cl-loop for x in letter-buttons
                               for y in letter-docs
                               collect `(const :tag ,y ,x)))
diff --git a/lisp/mh-e/mh-utils.el b/lisp/mh-e/mh-utils.el
index d7c607df5c..9497ba0d11 100644
--- a/lisp/mh-e/mh-utils.el
+++ b/lisp/mh-e/mh-utils.el
@@ -1,4 +1,4 @@
;;; mh-utils.el --- MH-E general utilities
;;; mh-utils.el --- MH-E general utilities  -*- lexical-binding: t; -*-

;; Copyright (C) 1993, 1995, 1997, 2000-2021 Free Software Foundation,
;; Inc.
@@ -268,7 +268,7 @@ and displayed in a help buffer."
  (interactive)
  (let* ((help (or help-messages
                  (cdr (assoc nil (assoc major-mode mh-help-messages)))))
         (text (substitute-command-keys (mapconcat 'identity help ""))))
         (text (substitute-command-keys (mapconcat #'identity help ""))))
    (with-electric-help
     (lambda ()
       (insert text))
@@ -298,7 +298,7 @@ and displayed in a help buffer."
This is the inverse of `mh-read-msg-list', which expands ranges.
Message lists passed to MH programs should be processed by this
function to avoid exceeding system command line argument limits."
  (let ((msgs (sort (copy-sequence messages) 'mh-greaterp))
  (let ((msgs (sort (copy-sequence messages) #'mh-greaterp))
        (range-high nil)
        (prev -1)
        (ranges nil))
@@ -669,7 +669,7 @@ three arguments so we bind this variable to t or nil.
This variable should never be set.")

(defvar mh-folder-completion-map (copy-keymap minibuffer-local-completion-map))
(define-key mh-folder-completion-map " " 'minibuffer-complete)  ;Why???
(define-key mh-folder-completion-map " " #'minibuffer-complete)  ;Why???

(defvar mh-speed-flists-inhibit-flag nil)

@@ -730,8 +730,7 @@ See Info node `(elisp) Programmed Completion' for details."
                   (t (file-directory-p path))))))))

;; Shush compiler.
(mh-do-in-xemacs
  (defvar completion-root-regexp))
(defvar completion-root-regexp) ;; Apparently used in XEmacs

(defun mh-folder-completing-read (prompt default allow-root-folder-flag)
  "Read folder name with PROMPT and default result DEFAULT.
@@ -925,10 +924,10 @@ Handle RFC 822 (or later) continuation lines."
(defvar mh-hidden-header-keymap
  (let ((map (make-sparse-keymap)))
    (mh-do-in-gnu-emacs
      (define-key map [mouse-2] 'mh-letter-toggle-header-field-display-button))
      (define-key map [mouse-2] #'mh-letter-toggle-header-field-display-button))
    (mh-do-in-xemacs
      (define-key map '(button2)
        'mh-letter-toggle-header-field-display-button))
        #'mh-letter-toggle-header-field-display-button))
    map))

;;;###mh-autoload
diff --git a/lisp/mh-e/mh-xface.el b/lisp/mh-e/mh-xface.el
index 036575a8e6..bf704c1857 100644
--- a/lisp/mh-e/mh-xface.el
+++ b/lisp/mh-e/mh-xface.el
@@ -1,4 +1,4 @@
;;; mh-xface.el --- MH-E X-Face and Face header field display
;;; mh-xface.el --- MH-E X-Face and Face header field display  -*- lexical-binding: t; -*-

;; Copyright (C) 2002-2003, 2005-2021 Free Software Foundation, Inc.

-- 
2.32.0
Reply to thread Export thread (mbox)