emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

scratch/lexical-gnus 7ccd21c 6/6: Convert `lisp/gnus` to lexical-binding


From: Stefan Monnier
Subject: scratch/lexical-gnus 7ccd21c 6/6: Convert `lisp/gnus` to lexical-binding
Date: Sat, 30 Jan 2021 12:35:26 -0500 (EST)

branch: scratch/lexical-gnus
commit 7ccd21c6abbcacc96c8f89917d0be99c25e4ba7d
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>

    Convert `lisp/gnus` to lexical-binding
---
 lisp/gnus/canlock.el            |  11 +-
 lisp/gnus/deuglify.el           |  32 ++--
 lisp/gnus/gmm-utils.el          |  10 +-
 lisp/gnus/gnus-agent.el         |  63 +++----
 lisp/gnus/gnus-art.el           | 155 ++++++++--------
 lisp/gnus/gnus-bcklg.el         |   2 +-
 lisp/gnus/gnus-bookmark.el      |  31 ++--
 lisp/gnus/gnus-cache.el         |  12 +-
 lisp/gnus/gnus-cite.el          |  74 +++-----
 lisp/gnus/gnus-cloud.el         |  16 +-
 lisp/gnus/gnus-cus.el           |  11 +-
 lisp/gnus/gnus-delay.el         |  18 +-
 lisp/gnus/gnus-demon.el         |   4 +-
 lisp/gnus/gnus-diary.el         |   8 +-
 lisp/gnus/gnus-dired.el         |   2 +-
 lisp/gnus/gnus-draft.el         |  15 +-
 lisp/gnus/gnus-dup.el           |   3 -
 lisp/gnus/gnus-eform.el         |   4 +-
 lisp/gnus/gnus-fun.el           |   2 +-
 lisp/gnus/gnus-gravatar.el      |   9 +-
 lisp/gnus/gnus-group.el         | 103 ++++++-----
 lisp/gnus/gnus-html.el          | 126 ++++++-------
 lisp/gnus/gnus-int.el           | 398 ++++++++++++++++++++++------------------
 lisp/gnus/gnus-kill.el          |  24 ++-
 lisp/gnus/gnus-logic.el         |   2 +-
 lisp/gnus/gnus-mh.el            |   6 +-
 lisp/gnus/gnus-ml.el            |   2 +-
 lisp/gnus/gnus-mlspl.el         |   2 +-
 lisp/gnus/gnus-msg.el           | 238 ++++++++++++------------
 lisp/gnus/gnus-notifications.el |  14 +-
 lisp/gnus/gnus-picon.el         |   6 +-
 lisp/gnus/gnus-range.el         |   4 +-
 lisp/gnus/gnus-registry.el      |  13 +-
 lisp/gnus/gnus-rfc1843.el       |   2 +-
 lisp/gnus/gnus-salt.el          |   4 +-
 lisp/gnus/gnus-score.el         |  89 +++++----
 lisp/gnus/gnus-search.el        |  91 +++------
 lisp/gnus/gnus-sieve.el         |  20 +-
 lisp/gnus/gnus-spec.el          |  44 ++---
 lisp/gnus/gnus-srvr.el          |  14 +-
 lisp/gnus/gnus-start.el         | 116 ++++++------
 lisp/gnus/gnus-sum.el           |  95 +++++-----
 lisp/gnus/gnus-topic.el         |  32 ++--
 lisp/gnus/gnus-undo.el          |   8 +-
 lisp/gnus/gnus-util.el          |  51 ++---
 lisp/gnus/gnus-uu.el            |  21 ++-
 lisp/gnus/gnus-vm.el            |   2 +-
 lisp/gnus/gnus-win.el           |  14 +-
 lisp/gnus/gnus.el               |   2 +-
 lisp/gnus/gssapi.el             |   2 +-
 lisp/gnus/legacy-gnus-agent.el  |   4 +-
 lisp/gnus/mail-source.el        | 107 +++++------
 lisp/gnus/message.el            |  17 +-
 lisp/gnus/mm-archive.el         |  12 +-
 lisp/gnus/mm-bodies.el          |   2 +-
 lisp/gnus/mm-encode.el          |   2 +-
 lisp/gnus/mm-partial.el         |  19 +-
 lisp/gnus/mm-url.el             |  11 +-
 lisp/gnus/mm-util.el            |   8 +-
 lisp/gnus/mm-view.el            |  57 +++---
 lisp/gnus/mml-sec.el            |   6 +-
 lisp/gnus/mml-smime.el          |  23 +--
 lisp/gnus/mml.el                |  73 +++++---
 lisp/gnus/mml1991.el            |  13 +-
 lisp/gnus/mml2015.el            |  30 +--
 lisp/gnus/nnagent.el            |  14 +-
 lisp/gnus/nnbabyl.el            |  38 ++--
 lisp/gnus/nndiary.el            |  31 ++--
 lisp/gnus/nndir.el              |   2 +-
 lisp/gnus/nndoc.el              |  31 ++--
 lisp/gnus/nndraft.el            |  24 ++-
 lisp/gnus/nneething.el          |  16 +-
 lisp/gnus/nnfolder.el           |  24 +--
 lisp/gnus/nngateway.el          |   2 +-
 lisp/gnus/nnheader.el           |   2 +-
 lisp/gnus/nnimap.el             |   9 +-
 lisp/gnus/nnmail.el             |  47 ++---
 lisp/gnus/nnmairix.el           | 113 +++++-------
 lisp/gnus/nnmbox.el             |  46 ++---
 lisp/gnus/nnmh.el               |  25 +--
 lisp/gnus/nnml.el               |  26 +--
 lisp/gnus/nnnil.el              |  22 +--
 lisp/gnus/nnoo.el               | 114 ++++++------
 lisp/gnus/nnregistry.el         |  13 +-
 lisp/gnus/nnrss.el              |  23 ++-
 lisp/gnus/nnspool.el            |  28 +--
 lisp/gnus/nntp.el               |  14 +-
 lisp/gnus/nnvirtual.el          |  32 ++--
 lisp/gnus/nnweb.el              |  23 ++-
 lisp/gnus/score-mode.el         |   2 +-
 lisp/gnus/smiley.el             |   2 +-
 lisp/gnus/smime.el              |  27 +--
 lisp/gnus/spam-report.el        |  20 +-
 lisp/gnus/spam-stat.el          |  43 ++---
 lisp/gnus/spam-wash.el          |   5 +-
 lisp/gnus/spam.el               | 192 +++++++++----------
 96 files changed, 1651 insertions(+), 1770 deletions(-)

diff --git a/lisp/gnus/canlock.el b/lisp/gnus/canlock.el
index e203ebc..dbdbaa8 100644
--- a/lisp/gnus/canlock.el
+++ b/lisp/gnus/canlock.el
@@ -1,4 +1,4 @@
-;;; canlock.el --- functions for Cancel-Lock feature
+;;; canlock.el --- functions for Cancel-Lock feature  -*- lexical-binding: t; 
-*-
 
 ;; Copyright (C) 1998-1999, 2001-2021 Free Software Foundation, Inc.
 
@@ -52,20 +52,17 @@
 (defcustom canlock-password nil
   "Password to use when signing a Cancel-Lock or a Cancel-Key header."
   :type '(radio (const :format "Not specified " nil)
-               (string :tag "Password"))
-  :group 'canlock)
+               (string :tag "Password")))
 
 (defcustom canlock-password-for-verify canlock-password
   "Password to use when verifying a Cancel-Lock or a Cancel-Key header."
   :type '(radio (const :format "Not specified " nil)
-               (string :tag "Password"))
-  :group 'canlock)
+               (string :tag "Password")))
 
 (defcustom canlock-force-insert-header nil
   "If non-nil, insert a Cancel-Lock or a Cancel-Key header even if the
 buffer does not look like a news message."
-  :type 'boolean
-  :group 'canlock)
+  :type 'boolean)
 
 (defun canlock-sha1 (message)
   "Make a SHA-1 digest of MESSAGE as a unibyte string of length 20 bytes."
diff --git a/lisp/gnus/deuglify.el b/lisp/gnus/deuglify.el
index 4f9ac26..08beef7 100644
--- a/lisp/gnus/deuglify.el
+++ b/lisp/gnus/deuglify.el
@@ -1,4 +1,4 @@
-;;; deuglify.el --- deuglify broken Outlook (Express) articles
+;;; deuglify.el --- deuglify broken Outlook (Express) articles  -*- 
lexical-binding: t; -*-
 
 ;; Copyright (C) 2001-2021 Free Software Foundation, Inc.
 
@@ -234,20 +234,17 @@
 (defcustom gnus-outlook-deuglify-unwrap-min 45
   "Minimum length of the cited line above the (possibly) wrapped line."
   :version "22.1"
-  :type 'integer
-  :group 'gnus-outlook-deuglify)
+  :type 'integer)
 
 (defcustom gnus-outlook-deuglify-unwrap-max 95
   "Maximum length of the cited line after unwrapping."
   :version "22.1"
-  :type 'integer
-  :group 'gnus-outlook-deuglify)
+  :type 'integer)
 
 (defcustom gnus-outlook-deuglify-cite-marks ">|#%"
   "Characters that indicate cited lines."
   :version "22.1"
-  :type 'string
-  :group 'gnus-outlook-deuglify)
+  :type 'string)
 
 (defcustom gnus-outlook-deuglify-unwrap-stop-chars nil ;; ".?!" or nil
   "Characters that, when at end of cited line, inhibit unwrapping.
@@ -255,44 +252,38 @@ When one of these characters is the last one on the cited 
line
 above the possibly wrapped line, it disallows unwrapping."
   :version "22.1"
   :type '(radio (const :format "None  " nil)
-               (string :value ".?!"))
-  :group 'gnus-outlook-deuglify)
+               (string :value ".?!")))
 
 (defcustom gnus-outlook-deuglify-no-wrap-chars "`"
   "Characters that, when at beginning of line, inhibit unwrapping.
 When one of these characters is the first one in the possibly
 wrapped line, it disallows unwrapping."
   :version "22.1"
-  :type 'string
-  :group 'gnus-outlook-deuglify)
+  :type 'string)
 
 (defcustom  gnus-outlook-deuglify-attrib-cut-regexp
   "\\(On \\|Am \\)?\\(Mon\\|Tue\\|Wed\\|Thu\\|Fri\\|Sat\\|Sun\\),[^,]+, "
   "Regexp matching beginning of attribution line that should be cut off."
   :version "22.1"
-  :type 'regexp
-  :group 'gnus-outlook-deuglify)
+  :type 'regexp)
 
 (defcustom gnus-outlook-deuglify-attrib-verb-regexp
   "wrote\\|writes\\|says\\|schrieb\\|schreibt\\|meinte\\|skrev\\|a 
écrit\\|schreef\\|escribió"
   "Regular expression matching the verb used in an attribution line."
   :version "22.1"
-  :type 'regexp
-  :group 'gnus-outlook-deuglify)
+  :type 'regexp)
 
 (defcustom  gnus-outlook-deuglify-attrib-end-regexp
   ": *\\|\\.\\.\\."
   "Regular expression matching the end of an attribution line."
   :version "22.1"
-  :type 'regexp
-  :group 'gnus-outlook-deuglify)
+  :type 'regexp)
 
 (defcustom gnus-outlook-display-hook nil
   "A hook called after a deuglified article has been prepared.
 It is run after `gnus-article-prepare-hook'."
   :version "22.1"
-  :type 'hook
-  :group 'gnus-outlook-deuglify)
+  :type 'hook)
 
 ;; Functions
 
@@ -345,7 +336,8 @@ NODISPLAY is non-nil, don't redisplay the article buffer."
   "Put text from ATTR-START to the end of buffer at the top of the article 
buffer."
   ;; FIXME: 1.  (*) text/plain          ( ) text/html
   (let ((inhibit-read-only t)
-       (cite-marks gnus-outlook-deuglify-cite-marks))
+       ;; (cite-marks gnus-outlook-deuglify-cite-marks)
+       )
     (gnus-with-article-buffer
       (article-goto-body)
       ;; article does not start with attribution
diff --git a/lisp/gnus/gmm-utils.el b/lisp/gnus/gmm-utils.el
index 5e27a2f..bcf8dd0 100644
--- a/lisp/gnus/gmm-utils.el
+++ b/lisp/gnus/gmm-utils.el
@@ -1,4 +1,4 @@
-;;; gmm-utils.el --- Utility functions for Gnus, Message and MML
+;;; gmm-utils.el --- Utility functions for Gnus, Message and MML  -*- 
lexical-binding: t; -*-
 
 ;; Copyright (C) 2006-2021 Free Software Foundation, Inc.
 
@@ -42,8 +42,7 @@ The higher the number, the more messages will flash to say 
what
 it did.  At zero, it will be totally mute; at five, it will
 display most important messages; and at ten, it will keep on
 jabbering all the time."
-  :type 'integer
-  :group 'gmm)
+  :type 'integer)
 
 ;;;###autoload
 (defun gmm-regexp-concat (regexp)
@@ -175,8 +174,7 @@ ARGS are passed to `message'."
     'retro)
   "Preferred tool bar style."
   :type '(choice (const :tag "GNOME style" gnome)
-                (const :tag "Retro look"  retro))
-  :group 'gmm)
+                (const :tag "Retro look"  retro)))
 
 (defvar tool-bar-map)
 
@@ -233,7 +231,7 @@ DEFAULT-MAP specifies the default key map for ICON-LIST."
                            props)))
              t))
          (if (symbolp icon-list)
-             (eval icon-list)
+             (symbol-value icon-list)
            icon-list))
     map))
 
diff --git a/lisp/gnus/gnus-agent.el b/lisp/gnus/gnus-agent.el
index cb679b8..eadcdcb 100644
--- a/lisp/gnus/gnus-agent.el
+++ b/lisp/gnus/gnus-agent.el
@@ -1,4 +1,4 @@
-;;; gnus-agent.el --- unplugged support for Gnus
+;;; gnus-agent.el --- unplugged support for Gnus  -*- lexical-binding: t; -*-
 
 ;; Copyright (C) 1997-2021 Free Software Foundation, Inc.
 
@@ -820,7 +820,7 @@ be a select method."
             (condition-case err
                 (while t
                   (let ((bgn (point)))
-                    (eval (read (current-buffer)))
+                    (eval (read (current-buffer)) t)
                     (delete-region bgn (point))))
               (end-of-file
                (delete-file (gnus-agent-lib-file "flags")))
@@ -2666,7 +2666,7 @@ The following commands are available:
      (point)
      (prog1 (1+ (point))
        ;; Insert the text.
-       (eval gnus-category-line-format-spec))
+       (eval gnus-category-line-format-spec t))
      (list 'gnus-category gnus-tmp-name))))
 
 (defun gnus-enter-category-buffer ()
@@ -2776,16 +2776,15 @@ The following commands are available:
     (gnus-edit-form
      (gnus-agent-cat-predicate info)
      (format "Editing the select predicate for category %s" category)
-     `(lambda (predicate)
-        ;; Avoid run-time execution of setf form
-        ;; (setf (gnus-agent-cat-predicate (assq ',category 
gnus-category-alist))
-        ;;       predicate)
-        ;; use its expansion instead:
-        (gnus-agent-cat-set-property (assq ',category gnus-category-alist)
-                                     'agent-predicate predicate)
-
-       (gnus-category-write)
-       (gnus-category-list)))))
+     (lambda (predicate)
+       ;; Avoid run-time execution of setf form
+       ;; (setf (gnus-agent-cat-predicate (assq ',category 
gnus-category-alist))
+       ;;       predicate)
+       ;; use its expansion instead:
+       (gnus-agent-cat-set-property (assq category gnus-category-alist)
+                                    'agent-predicate predicate)
+       (gnus-category-write)
+       (gnus-category-list)))))
 
 (defun gnus-category-edit-score (category)
   "Edit the score expression for CATEGORY."
@@ -2794,16 +2793,15 @@ The following commands are available:
     (gnus-edit-form
      (gnus-agent-cat-score-file info)
      (format "Editing the score expression for category %s" category)
-     `(lambda (score-file)
-        ;; Avoid run-time execution of setf form
-        ;; (setf (gnus-agent-cat-score-file (assq ',category 
gnus-category-alist))
-        ;;       score-file)
-        ;; use its expansion instead:
-        (gnus-agent-cat-set-property (assq ',category gnus-category-alist)
-                                     'agent-score-file score-file)
-
-       (gnus-category-write)
-       (gnus-category-list)))))
+     (lambda (score-file)
+       ;; Avoid run-time execution of setf form
+       ;; (setf (gnus-agent-cat-score-file (assq ',category 
gnus-category-alist))
+       ;;       score-file)
+       ;; use its expansion instead:
+       (gnus-agent-cat-set-property (assq category gnus-category-alist)
+                                    'agent-score-file score-file)
+       (gnus-category-write)
+       (gnus-category-list)))))
 
 (defun gnus-category-edit-groups (category)
   "Edit the group list for CATEGORY."
@@ -2812,16 +2810,15 @@ The following commands are available:
     (gnus-edit-form
      (gnus-agent-cat-groups info)
      (format "Editing the group list for category %s" category)
-     `(lambda (groups)
-        ;; Avoid run-time execution of setf form
-        ;; (setf (gnus-agent-cat-groups (assq ',category gnus-category-alist))
-        ;;       groups)
-        ;; use its expansion instead:
-        (gnus-agent-set-cat-groups (assq ',category gnus-category-alist)
-                                   groups)
-
-       (gnus-category-write)
-       (gnus-category-list)))))
+     (lambda (groups)
+       ;; Avoid run-time execution of setf form
+       ;; (setf (gnus-agent-cat-groups (assq category gnus-category-alist))
+       ;;       groups)
+       ;; use its expansion instead:
+       (gnus-agent-set-cat-groups (assq category gnus-category-alist)
+                                  groups)
+       (gnus-category-write)
+       (gnus-category-list)))))
 
 (defun gnus-category-kill (category)
   "Kill the current category."
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el
index 7ae4e58..afc2610 100644
--- a/lisp/gnus/gnus-art.el
+++ b/lisp/gnus/gnus-art.el
@@ -1,4 +1,4 @@
-;;; gnus-art.el --- article mode commands for Gnus
+;;; gnus-art.el --- article mode commands for Gnus  -*- lexical-binding: t; -*-
 
 ;; Copyright (C) 1996-2021 Free Software Foundation, Inc.
 
@@ -1432,7 +1432,7 @@ See Info node `(gnus)Customizing Articles' and Info node
                 (message "\
 ** gnus-treat-display-xface is an obsolete variable;\
  use gnus-treat-display-x-face instead")
-                (eval (car (get 'gnus-treat-display-xface 'saved-value))))
+                (eval (car (get 'gnus-treat-display-xface 'saved-value)) t))
                (t
                 value)))))
 (put 'gnus-treat-display-x-face 'highlight t)
@@ -2162,6 +2162,8 @@ MAP is an alist where the elements are on the form 
(\"from\" \"to\")."
              (put-text-property
               (point) (1+ (point)) 'face 'underline)))))))))
 
+(defvar ansi-color-context-region)
+
 (defun article-treat-ansi-sequences ()
   "Translate ANSI SGR control sequences into overlays or extents."
   (interactive)
@@ -2893,7 +2895,7 @@ message header will be added to the bodies of the 
\"text/html\" parts."
                                          (t "<br>\n"))))
                   (goto-char (point-min))
                   (while (re-search-forward "^[\t ]+" nil t)
-                    (dotimes (i (prog1
+                    (dotimes (_ (prog1
                                     (current-column)
                                   (delete-region (match-beginning 0)
                                                  (match-end 0))))
@@ -3021,6 +3023,8 @@ message header will be added to the bodies of the 
\"text/html\" parts."
               (setq showed t)))))
     showed))
 
+(defvar gnus-mime-display-attachment-buttons-in-header)
+
 (defun gnus-article-browse-html-article (&optional arg)
   "View \"text/html\" parts of the current article with a WWW browser.
 Inline images embedded in a message using the cid scheme, as they are
@@ -4712,8 +4716,6 @@ If ALL-HEADERS is non-nil, no headers are hidden."
            (gnus-run-hooks 'gnus-article-prepare-hook)
            t))))))
 
-(defvar gnus-mime-display-attachment-buttons-in-header)
-
 ;;;###autoload
 (defun gnus-article-prepare-display ()
   "Make the current buffer look like a nice article."
@@ -5000,53 +5002,53 @@ General format specifiers can also be used.  See Info 
node
   "ID of a mime part that should be buttonized.
 `gnus-mime-save-part-and-strip' and `gnus-mime-delete-part' bind it.")
 
+(defvar message-options-set-recipient)
+
 (eval-when-compile
   (defsubst gnus-article-edit-part (handles &optional current-id)
     "Edit an article in order to delete a mime part.
 This function is exclusively used by `gnus-mime-save-part-and-strip'
 and `gnus-mime-delete-part', and not provided at run-time normally."
-    (gnus-article-edit-article
-     `(lambda ()
-       (buffer-disable-undo)
-       (let ((mail-parse-charset (or gnus-article-charset
-                                     ',gnus-newsgroup-charset))
-             (mail-parse-ignored-charsets
-              (or gnus-article-ignored-charsets
-                  ',gnus-newsgroup-ignored-charsets))
-             (mbl mml-buffer-list))
-         (setq mml-buffer-list nil)
-         ;; A new text must be inserted before deleting existing ones
-         ;; at the end so as not to move existing markers of which
-         ;; the insertion type is t.
-         (delete-region
-          (point-min)
-          (prog1
-              (goto-char (point-max))
-            (insert-buffer-substring gnus-original-article-buffer)))
-         (mime-to-mml ',handles)
-         (setq gnus-article-mime-handles nil)
-         (let ((mbl1 mml-buffer-list))
-           (setq mml-buffer-list mbl)
-            (setq-local mml-buffer-list mbl1))
-         (add-hook 'kill-buffer-hook 'mml-destroy-buffers t t)))
-     `(lambda (no-highlight)
-       (let ((mail-parse-charset (or gnus-article-charset
-                                     ',gnus-newsgroup-charset))
-             (message-options message-options)
-             (message-options-set-recipient)
-             (mail-parse-ignored-charsets
-              (or gnus-article-ignored-charsets
-                  ',gnus-newsgroup-ignored-charsets)))
-         (mml-to-mime)
-         (mml-destroy-buffers)
-         (remove-hook 'kill-buffer-hook
-                      'mml-destroy-buffers t)
-         (kill-local-variable 'mml-buffer-list))
-       (gnus-summary-edit-article-done
-        ,(or (mail-header-references gnus-current-headers) "")
-        ,(gnus-group-read-only-p)
-        ,gnus-summary-buffer no-highlight))
-     t)
+    (let ((charset gnus-newsgroup-charset)
+          (ign-cs gnus-newsgroup-ignored-charsets)
+          (gch (or (mail-header-references gnus-current-headers) ""))
+          (ro (gnus-group-read-only-p))
+          (buf gnus-summary-buffer))
+      (gnus-article-edit-article
+       (lambda ()
+         (buffer-disable-undo)
+         (let ((mail-parse-charset (or gnus-article-charset charset))
+              (mail-parse-ignored-charsets
+               (or gnus-article-ignored-charsets ign-cs))
+              (mbl mml-buffer-list))
+          (setq mml-buffer-list nil)
+          ;; A new text must be inserted before deleting existing ones
+          ;; at the end so as not to move existing markers of which
+          ;; the insertion type is t.
+          (delete-region
+           (point-min)
+           (prog1
+               (goto-char (point-max))
+             (insert-buffer-substring gnus-original-article-buffer)))
+          (mime-to-mml handles)
+          (setq gnus-article-mime-handles nil)
+          (let ((mbl1 mml-buffer-list))
+            (setq mml-buffer-list mbl)
+             (setq-local mml-buffer-list mbl1))
+          (add-hook 'kill-buffer-hook #'mml-destroy-buffers t t)))
+       (lambda (no-highlight)
+        (let ((mail-parse-charset (or gnus-article-charset charset))
+              (message-options message-options)
+              (message-options-set-recipient)
+              (mail-parse-ignored-charsets
+               (or gnus-article-ignored-charsets ign-cs)))
+          (mml-to-mime)
+          (mml-destroy-buffers)
+          (remove-hook 'kill-buffer-hook
+                       #'mml-destroy-buffers t)
+          (kill-local-variable 'mml-buffer-list))
+        (gnus-summary-edit-article-done gch ro buf no-highlight))
+       t))
     ;; Force buttonizing this part.
     (let ((gnus-mime-buttonized-part-id current-id))
       (gnus-article-edit-done))
@@ -5766,10 +5768,11 @@ all parts."
                                           (mm-handle-media-type handle))
                       (mm-handle-set-undisplayer
                        handle
-                       `(lambda ()
-                          (let ((inhibit-read-only t))
-                            (delete-region ,(copy-marker (point-min) t)
-                                           ,(point-max-marker)))))))
+                       (let ((beg (copy-marker (point-min) t))
+                             (end (point-max-marker)))
+                         (lambda ()
+                           (let ((inhibit-read-only t))
+                             (delete-region beg end)))))))
                    (part
                     (mm-display-inline handle))))))
       (when (markerp point)
@@ -6149,7 +6152,7 @@ If nil, don't show those extra buttons."
   (let* ((preferred (or preferred (mm-preferred-alternative handles)))
         (ihandles handles)
         (point (point))
-        handle (inhibit-read-only t) from begend not-pref)
+        handle (inhibit-read-only t) begend not-pref) ;; from
     (save-window-excursion
       (save-restriction
        (when ibegend
@@ -6170,7 +6173,8 @@ If nil, don't show those extra buttons."
                  (not (gnus-unbuttonized-mime-type-p
                        "multipart/alternative")))
          (add-text-properties
-          (setq from (point))
+          ;; (setq from
+          (point);; )
           (progn
             (insert (format "%d.  " id))
             (point))
@@ -6191,7 +6195,8 @@ If nil, don't show those extra buttons."
          ;; Do the handles
          (while (setq handle (pop handles))
            (add-text-properties
-            (setq from (point))
+            ;; (setq from
+            (point) ;; )
             (progn
               (insert (format "(%c) %-18s"
                               (if (equal handle preferred) ?* ? )
@@ -7151,13 +7156,11 @@ If given a prefix, show the hidden text instead."
       (when (and do-update-line
                 (or (numberp article)
                     (stringp article)))
-       (let ((buf (current-buffer)))
-         (set-buffer gnus-summary-buffer)
+       (with-current-buffer gnus-summary-buffer
          (gnus-summary-update-article do-update-line sparse-header)
          (gnus-summary-goto-subject do-update-line nil t)
          (set-window-point (gnus-get-buffer-window (current-buffer) t)
-                           (point))
-         (set-buffer buf))))))
+                           (point)))))))
 
 (defun gnus-block-private-groups (group)
   "Allows images in newsgroups to be shown, blocks images in all
@@ -7278,12 +7281,13 @@ groups."
   (gnus-with-article-buffer
     (article-date-original))
   (gnus-article-edit-article
-   'ignore
-   `(lambda (no-highlight)
-      'ignore
-      (gnus-summary-edit-article-done
-       ,(or (mail-header-references gnus-current-headers) "")
-       ,(gnus-group-read-only-p) ,gnus-summary-buffer no-highlight))))
+   #'ignore
+   (let ((gch (or (mail-header-references gnus-current-headers) ""))
+         (ro (gnus-group-read-only-p))
+         (buf gnus-summary-buffer))
+     (lambda (no-highlight)
+       'ignore
+       (gnus-summary-edit-article-done gch ro buf no-highlight)))))
 
 (defun gnus-article-edit-article (start-func exit-func &optional quiet)
   "Start editing the contents of the current article buffer."
@@ -7351,8 +7355,7 @@ groups."
        (gnus-article-mode)
        (set-window-configuration winconf)
        ;; Tippy-toe some to make sure that point remains where it was.
-       (save-current-buffer
-         (set-buffer curbuf)
+       (with-current-buffer curbuf
          (set-window-start (get-buffer-window (current-buffer)) window-start)
          (goto-char p))))
     (gnus-summary-show-article)))
@@ -7620,7 +7623,7 @@ Calls `describe-variable' or `describe-function'."
   "Call `describe-key' when pushing the corresponding URL button."
   (let* ((key-string
          (replace-regexp-in-string gnus-button-handle-describe-prefix "" url))
-        (keys (ignore-errors (eval `(kbd ,key-string)))))
+        (keys (ignore-errors (kbd key-string))))
     (if keys
        (describe-key keys)
       (gnus-message 3 "Invalid key sequence in button: %s" key-string))))
@@ -7989,13 +7992,13 @@ specified by `gnus-button-alist'."
       (article-goto-body)
       (setq beg (point))
       (while (setq entry (pop alist))
-       (setq regexp (eval (car entry)))
+       (setq regexp (eval (car entry) t))
        (goto-char beg)
        (while (re-search-forward regexp nil t)
          (let ((start (match-beginning (nth 1 entry)))
                (end (match-end (nth 1 entry)))
                (from (match-beginning 0)))
-           (when (and (eval (nth 2 entry))
+           (when (and (eval (nth 2 entry) t)
                       (not (gnus-button-in-region-p
                             start end 'gnus-callback)))
              ;; That optional form returned non-nil, so we add the
@@ -8086,14 +8089,14 @@ url is put as the `gnus-button-url' overlay property on 
the button."
                             (match-beginning 0))
                        (point-max)))
          (goto-char beg)
-         (while (re-search-forward (eval (nth 1 entry)) end t)
+         (while (re-search-forward (eval (nth 1 entry) t) end t)
            ;; Each match within a header.
            (let* ((entry (cdr entry))
                   (start (match-beginning (nth 1 entry)))
                   (end (match-end (nth 1 entry)))
                   (form (nth 2 entry)))
              (goto-char (match-end 0))
-             (when (eval form)
+             (when (eval form t)
                (gnus-article-add-button
                 start end (nth 3 entry)
                 (buffer-substring (match-beginning (nth 4 entry))
@@ -8102,7 +8105,7 @@ url is put as the `gnus-button-url' overlay property on 
the button."
 
 ;;; External functions:
 
-(defun gnus-article-add-button (from to fun &optional data text)
+(defun gnus-article-add-button (from to fun &optional data _text)
   "Create a button between FROM and TO with callback FUN and data DATA."
   (add-text-properties
    from to
@@ -8315,7 +8318,7 @@ url is put as the `gnus-button-url' overlay property on 
the button."
       (setq indx  (match-string 1 indx))
       (Info-index indx)
       (when comma
-       (dotimes (i (with-temp-buffer
+       (dotimes (_ (with-temp-buffer
                      (insert comma)
                      ;; Note: the XEmacs version of `how-many' takes
                      ;; no optional argument.
@@ -8524,6 +8527,8 @@ For example:
 (defvar gnus-treat-type)
 (defvar gnus-treat-condition)
 (defvar gnus-treat-length)
+(defvar gnus-treat-part-number)
+(defvar gnus-treat-total-parts)
 
 (defun gnus-treat-article (condition
                           &optional part-num total type)
@@ -8589,9 +8594,9 @@ For example:
    ((eq val 'head)
     nil)
    ((eq val 'first)
-    (eq part-number 1))
+    (eq gnus-treat-part-number 1))
    ((eq val 'last)
-    (eq part-number total-parts))
+    (eq gnus-treat-part-number gnus-treat-total-parts))
    ((numberp val)
     (< gnus-treat-length val))
    (t
diff --git a/lisp/gnus/gnus-bcklg.el b/lisp/gnus/gnus-bcklg.el
index d6f53e4..6c7ad0c 100644
--- a/lisp/gnus/gnus-bcklg.el
+++ b/lisp/gnus/gnus-bcklg.el
@@ -1,4 +1,4 @@
-;;; gnus-bcklg.el --- backlog functions for Gnus
+;;; gnus-bcklg.el --- backlog functions for Gnus  -*- lexical-binding: t; -*-
 
 ;; Copyright (C) 1996-2021 Free Software Foundation, Inc.
 
diff --git a/lisp/gnus/gnus-bookmark.el b/lisp/gnus/gnus-bookmark.el
index d1af64d..c64c059 100644
--- a/lisp/gnus/gnus-bookmark.el
+++ b/lisp/gnus/gnus-bookmark.el
@@ -1,4 +1,4 @@
-;;; gnus-bookmark.el --- Bookmarks in Gnus
+;;; gnus-bookmark.el --- Bookmarks in Gnus  -*- lexical-binding: t; -*-
 
 ;; Copyright (C) 2006-2021 Free Software Foundation, Inc.
 
@@ -78,22 +78,19 @@
    ((file-exists-p "~/.gnus.bmk") "~/.gnus.bmk")
    (t (nnheader-concat gnus-directory "bookmarks.el")))
   "The default Gnus bookmarks file."
-  :type 'string
-  :group 'gnus-bookmark)
+  :type 'string)
 
 (defcustom gnus-bookmark-file-coding-system
   (if (mm-coding-system-p 'iso-2022-7bit)
       'iso-2022-7bit)
   "Coding system used for writing Gnus bookmark files."
-  :type '(symbol :tag "Coding system")
-  :group 'gnus-bookmark)
+  :type '(symbol :tag "Coding system"))
 
 (defcustom gnus-bookmark-sort-flag t
   "Non-nil means Gnus bookmarks are sorted by bookmark names.
 Otherwise they will be displayed in LIFO order (that is,
 most recently set ones come first, oldest ones come last)."
-  :type 'boolean
-  :group 'gnus-bookmark)
+  :type 'boolean)
 
 (defcustom gnus-bookmark-bmenu-toggle-infos t
   "Non-nil means show details when listing Gnus bookmarks.
@@ -102,19 +99,16 @@ This may result in truncated bookmark names.  To disable 
this, put the
 following in your `.emacs' file:
 
 \(setq gnus-bookmark-bmenu-toggle-infos nil)"
-  :type 'boolean
-  :group 'gnus-bookmark)
+  :type 'boolean)
 
 (defcustom gnus-bookmark-bmenu-file-column 30
   "Column at which to display details in a buffer listing Gnus bookmarks.
 You can toggle whether details are shown with 
\\<gnus-bookmark-bmenu-mode-map>\\[gnus-bookmark-bmenu-toggle-infos]."
-  :type 'integer
-  :group 'gnus-bookmark)
+  :type 'integer)
 
 (defcustom gnus-bookmark-use-annotations nil
   "If non-nil, ask for an annotation when setting a bookmark."
-  :type 'boolean
-  :group 'gnus-bookmark)
+  :type 'boolean)
 
 (defcustom gnus-bookmark-bookmark-inline-details '(author)
   "Details to be shown with `gnus-bookmark-bmenu-toggle-infos'.
@@ -125,8 +119,7 @@ The default value is \(subject)."
                    (const :tag "Subject" subject)
                    (const :tag "Date" date)
                    (const :tag "Group" group)
-                   (const :tag "Message-id" message-id)))
-  :group 'gnus-bookmark)
+                   (const :tag "Message-id" message-id))))
 
 (defcustom gnus-bookmark-bookmark-details
   '(author subject date group annotation)
@@ -139,14 +132,12 @@ The default value is \(author subject date group 
annotation)."
                    (const :tag "Date" date)
                    (const :tag "Group" group)
                    (const :tag "Message-id" message-id)
-                   (const :tag "Annotation" annotation)))
-  :group 'gnus-bookmark)
+                   (const :tag "Annotation" annotation))))
 
 (defface gnus-bookmark-menu-heading
   '((t (:inherit font-lock-type-face)))
   "Face used to highlight the heading in Gnus bookmark menu buffers."
-  :version "23.1" ;; No Gnus
-  :group 'gnus-bookmark)
+  :version "23.1") ;; No Gnus
 
 (defconst gnus-bookmark-end-of-version-stamp-marker
   "-*- End Of Bookmark File Format Version Stamp -*-\n"
@@ -359,7 +350,7 @@ deletion, or > if it is flagged for displaying."
       (switch-to-buffer (gnus-get-buffer-create "*Gnus Bookmark List*"))
     (set-buffer (gnus-get-buffer-create "*Gnus Bookmark List*")))
   (let ((inhibit-read-only t)
-       alist name start end)
+       alist name)
     (erase-buffer)
     (insert "% Gnus Bookmark\n- --------\n")
     (add-text-properties (point-min) (point)
diff --git a/lisp/gnus/gnus-cache.el b/lisp/gnus/gnus-cache.el
index bea3d3b..5ed7319 100644
--- a/lisp/gnus/gnus-cache.el
+++ b/lisp/gnus/gnus-cache.el
@@ -1,4 +1,4 @@
-;;; gnus-cache.el --- cache interface for Gnus
+;;; gnus-cache.el --- cache interface for Gnus  -*- lexical-binding: t; -*-
 
 ;; Copyright (C) 1995-2021 Free Software Foundation, Inc.
 
@@ -29,9 +29,7 @@
 (require 'gnus)
 (require 'gnus-sum)
 
-(eval-when-compile
-  (unless (fboundp 'gnus-agent-load-alist)
-    (defun gnus-agent-load-alist (group))))
+(declare-function gnus-agent-load-alist "gnus-agent" (group))
 
 (defcustom gnus-cache-active-file
   (expand-file-name "active" gnus-cache-directory)
@@ -55,7 +53,7 @@
 If you only want to cache your nntp groups, you could set this
 variable to \"^nntp\".
 
-If a group matches both gnus-cacheable-groups and gnus-uncacheable-groups
+If a group matches both `gnus-cacheable-groups' and `gnus-uncacheable-groups'
 it's not cached."
   :group 'gnus-cache
   :type '(choice (const :tag "off" nil)
@@ -150,6 +148,8 @@ it's not cached."
       (gnus-kill-buffer buffer)
       (setq gnus-cache-buffer nil))))
 
+(defvar gnus-article-decode-hook)
+
 (defun gnus-cache-possibly-enter-article
   (group article ticked dormant unread &optional force)
   (when (and (or force (not (eq gnus-use-cache 'passive)))
@@ -730,6 +730,8 @@ If LOW, update the lower bound instead."
       (gnus-cache-write-active t)
       (gnus-message 5 "Generating the cache active file...done"))))
 
+(defvar nnml-generate-active-function)
+
 ;;;###autoload
 (defun gnus-cache-generate-nov-databases (dir)
   "Generate NOV files recursively starting in DIR."
diff --git a/lisp/gnus/gnus-cite.el b/lisp/gnus/gnus-cite.el
index a6d1101..96f1a7d 100644
--- a/lisp/gnus/gnus-cite.el
+++ b/lisp/gnus/gnus-cite.el
@@ -1,4 +1,4 @@
-;;; gnus-cite.el --- parse citations in articles for Gnus
+;;; gnus-cite.el --- parse citations in articles for Gnus  -*- 
lexical-binding: t; -*-
 
 ;; Copyright (C) 1995-2021 Free Software Foundation, Inc.
 
@@ -38,19 +38,16 @@
 
 (defcustom gnus-cited-opened-text-button-line-format "%(%{[-]%}%)\n"
   "Format of opened cited text buttons."
-  :group 'gnus-cite
   :type 'string)
 
 (defcustom gnus-cited-closed-text-button-line-format "%(%{[+]%}%)\n"
   "Format of closed cited text buttons."
-  :group 'gnus-cite
   :type 'string)
 
 (defcustom gnus-cited-lines-visible nil
   "The number of lines of hidden cited text to remain visible.
 Or a pair (cons) of numbers which are the number of lines at the top
 and bottom of the text, respectively, to remain visible."
-  :group 'gnus-cite
   :type '(choice (const :tag "none" nil)
                 integer
                 (cons :tag "Top and Bottom" integer integer)))
@@ -58,13 +55,11 @@ and bottom of the text, respectively, to remain visible."
 (defcustom gnus-cite-parse-max-size 25000
   "Maximum article size (in bytes) where parsing citations is allowed.
 Set it to nil to parse all articles."
-  :group 'gnus-cite
   :type '(choice (const :tag "all" nil)
                 integer))
 
 (defcustom gnus-cite-max-prefix 20
   "Maximum possible length for a citation prefix."
-  :group 'gnus-cite
   :type 'integer)
 
 (defcustom gnus-supercite-regexp
@@ -72,18 +67,15 @@ Set it to nil to parse all articles."
          ">>>>> +\"\\([^\"\n]+\\)\" +==")
   "Regexp matching normal Supercite attribution lines.
 The first grouping must match prefixes added by other packages."
-  :group 'gnus-cite
   :type 'regexp)
 
 (defcustom gnus-supercite-secondary-regexp "^.*\"\\([^\"\n]+\\)\" +=="
   "Regexp matching mangled Supercite attribution lines.
 The first regexp group should match the Supercite attribution."
-  :group 'gnus-cite
   :type 'regexp)
 
 (defcustom gnus-cite-minimum-match-count 2
   "Minimum number of identical prefixes before we believe it's a citation."
-  :group 'gnus-cite
   :type 'integer)
 
 ;; Some Microsoft products put in a citation that extends to the
@@ -106,21 +98,18 @@ The first regexp group should match the Supercite 
attribution."
 (defcustom gnus-cite-attribution-prefix
   "In article\\|in <\\|On 
\\(Mon\\|Tue\\|Wed\\|Thu\\|Fri\\|Sat\\|Sun\\),\\|----- ?Original Message ?-----"
   "Regexp matching the beginning of an attribution line."
-  :group 'gnus-cite
   :type 'regexp)
 
 (defcustom gnus-cite-attribution-suffix
   "\\(\\(wrote\\|writes\\|said\\|says\\|>\\)\\(:\\|\\.\\.\\.\\)\\|----- 
?Original Message ?-----\\)[ \t]*$"
   "Regexp matching the end of an attribution line.
 The text matching the first grouping will be used as a button."
-  :group 'gnus-cite
   :type 'regexp)
 
 (defcustom gnus-cite-unsightly-citation-regexp
   "^-----Original Message-----\nFrom: \\(.+\n\\)+\n"
   "Regexp matching Microsoft-type rest-of-message citations."
   :version "22.1"
-  :group 'gnus-cite
   :type 'regexp)
 
 (defcustom gnus-cite-ignore-quoted-from t
@@ -128,18 +117,15 @@ The text matching the first grouping will be used as a 
button."
 Those lines may have been quoted by MTAs in order not to mix up with
 the envelope From line."
   :version "22.1"
-  :group 'gnus-cite
   :type 'boolean)
 
 (defface gnus-cite-attribution '((t (:italic t)))
-  "Face used for attribution lines."
-  :group 'gnus-cite)
+  "Face used for attribution lines.")
 
 (defcustom gnus-cite-attribution-face 'gnus-cite-attribution
   "Face used for attribution lines.
 It is merged with the face for the cited text belonging to the attribution."
   :version "22.1"
-  :group 'gnus-cite
   :type 'face)
 
 (defface gnus-cite-1 '((((class color)
@@ -150,8 +136,7 @@ It is merged with the face for the cited text belonging to 
the attribution."
                        (:foreground "MidnightBlue"))
                       (t
                        (:italic t)))
-  "Citation face."
-  :group 'gnus-cite)
+  "Citation face.")
 
 (defface gnus-cite-2 '((((class color)
                         (background dark))
@@ -161,8 +146,7 @@ It is merged with the face for the cited text belonging to 
the attribution."
                        (:foreground "firebrick"))
                       (t
                        (:italic t)))
-  "Citation face."
-  :group 'gnus-cite)
+  "Citation face.")
 
 (defface gnus-cite-3 '((((class color)
                         (background dark))
@@ -172,8 +156,7 @@ It is merged with the face for the cited text belonging to 
the attribution."
                        (:foreground "dark green"))
                       (t
                        (:italic t)))
-  "Citation face."
-  :group 'gnus-cite)
+  "Citation face.")
 
 (defface gnus-cite-4 '((((class color)
                         (background dark))
@@ -183,8 +166,7 @@ It is merged with the face for the cited text belonging to 
the attribution."
                        (:foreground "OrangeRed"))
                       (t
                        (:italic t)))
-  "Citation face."
-  :group 'gnus-cite)
+  "Citation face.")
 
 (defface gnus-cite-5 '((((class color)
                         (background dark))
@@ -194,8 +176,7 @@ It is merged with the face for the cited text belonging to 
the attribution."
                        (:foreground "dark khaki"))
                       (t
                        (:italic t)))
-  "Citation face."
-  :group 'gnus-cite)
+  "Citation face.")
 
 (defface gnus-cite-6 '((((class color)
                         (background dark))
@@ -205,8 +186,7 @@ It is merged with the face for the cited text belonging to 
the attribution."
                        (:foreground "dark violet"))
                       (t
                        (:italic t)))
-  "Citation face."
-  :group 'gnus-cite)
+  "Citation face.")
 
 (defface gnus-cite-7 '((((class color)
                         (background dark))
@@ -216,8 +196,7 @@ It is merged with the face for the cited text belonging to 
the attribution."
                        (:foreground "SteelBlue4"))
                       (t
                        (:italic t)))
-  "Citation face."
-  :group 'gnus-cite)
+  "Citation face.")
 
 (defface gnus-cite-8 '((((class color)
                         (background dark))
@@ -227,8 +206,7 @@ It is merged with the face for the cited text belonging to 
the attribution."
                        (:foreground "magenta"))
                       (t
                        (:italic t)))
-  "Citation face."
-  :group 'gnus-cite)
+  "Citation face.")
 
 (defface gnus-cite-9 '((((class color)
                         (background dark))
@@ -238,8 +216,7 @@ It is merged with the face for the cited text belonging to 
the attribution."
                        (:foreground "violet"))
                       (t
                        (:italic t)))
-  "Citation face."
-  :group 'gnus-cite)
+  "Citation face.")
 
 (defface gnus-cite-10 '((((class color)
                          (background dark))
@@ -249,8 +226,7 @@ It is merged with the face for the cited text belonging to 
the attribution."
                         (:foreground "medium purple"))
                        (t
                         (:italic t)))
-  "Citation face."
-  :group 'gnus-cite)
+  "Citation face.")
 
 (defface gnus-cite-11 '((((class color)
                          (background dark))
@@ -260,8 +236,7 @@ It is merged with the face for the cited text belonging to 
the attribution."
                         (:foreground "turquoise"))
                        (t
                         (:italic t)))
-  "Citation face."
-  :group 'gnus-cite)
+  "Citation face.")
 
 (defcustom gnus-cite-face-list
   '(gnus-cite-1 gnus-cite-2 gnus-cite-3 gnus-cite-4 gnus-cite-5 gnus-cite-6
@@ -271,7 +246,6 @@ It is merged with the face for the cited text belonging to 
the attribution."
 When there are citations from multiple articles in the same message,
 Gnus will try to give each citation from each article its own face.
 This should make it easier to see who wrote what."
-  :group 'gnus-cite
   :type '(repeat face)
   :set (lambda (symbol value)
         (prog1
@@ -290,17 +264,14 @@ This should make it easier to see who wrote what."
 
 (defcustom gnus-cite-hide-percentage 50
   "Only hide excess citation if above this percentage of the body."
-  :group 'gnus-cite
   :type 'number)
 
 (defcustom gnus-cite-hide-absolute 10
   "Only hide excess citation if above this number of lines in the body."
-  :group 'gnus-cite
   :type 'integer)
 
 (defcustom gnus-cite-blank-line-after-header t
   "If non-nil, put a blank line between the citation header and the button."
-  :group 'gnus-cite
   :type 'boolean)
 
 ;; This has to go here because its default value depends on
@@ -553,7 +524,7 @@ text (i.e., computer code and the like) will not be folded."
         ;; like code?  Check for ragged edges on the left.
         (< (length columns) 3))))
 
-(defun gnus-article-hide-citation (&optional arg force)
+(defun gnus-article-hide-citation (&optional arg _force)
   "Toggle hiding of all cited text except attribution lines.
 See the documentation for `gnus-article-highlight-citation'.
 If given a negative prefix, always show; if given a positive prefix,
@@ -623,7 +594,7 @@ always hide."
              (progn
               (gnus-article-add-button
                (point)
-               (progn (eval gnus-cited-closed-text-button-line-format-spec)
+               (progn (eval gnus-cited-closed-text-button-line-format-spec t)
                       (point))
                'gnus-article-toggle-cited-text
                (list (cons beg end) start))
@@ -673,7 +644,8 @@ means show, nil means toggle."
            (progn (eval
                    (if hidden
                        gnus-cited-opened-text-button-line-format-spec
-                     gnus-cited-closed-text-button-line-format-spec))
+                     gnus-cited-closed-text-button-line-format-spec)
+                   t)
                   (point))
            'gnus-article-toggle-cited-text
            args)
@@ -726,7 +698,7 @@ See also the documentation for 
`gnus-article-highlight-citation'."
 
 ;;; Internal functions:
 
-(defun gnus-cite-parse-maybe (&optional force no-overlay)
+(defun gnus-cite-parse-maybe (&optional _force no-overlay)
   "Always parse the buffer."
   (gnus-cite-localize)
   ;;Reset parser information.
@@ -919,25 +891,25 @@ See also the documentation for 
`gnus-article-highlight-citation'."
                                            (regexp-quote tag) ">"))))
   ;; Find loose supercite citations after attributions.
   (gnus-cite-match-attributions 'small t
-                               (lambda (prefix tag)
+                               (lambda (_prefix tag)
                                  (when tag
                                    (concat "\\<"
                                            (regexp-quote tag)
                                            "\\>"))))
   ;; Find loose supercite citations anywhere.
   (gnus-cite-match-attributions 'small nil
-                               (lambda (prefix tag)
+                               (lambda (_prefix tag)
                                  (when tag
                                    (concat "\\<"
                                            (regexp-quote tag)
                                            "\\>"))))
   ;; Find nested citations after attributions.
   (gnus-cite-match-attributions 'small-if-unique t
-                               (lambda (prefix tag)
+                               (lambda (prefix _tag)
                                  (concat "\\`" (regexp-quote prefix) ".+")))
   ;; Find nested citations anywhere.
   (gnus-cite-match-attributions 'small nil
-                               (lambda (prefix tag)
+                               (lambda (prefix _tag)
                                  (concat "\\`" (regexp-quote prefix) ".+")))
   ;; Remove loose prefixes with too few lines.
   (let ((alist gnus-cite-loose-prefix-alist)
@@ -1166,7 +1138,7 @@ When enabled, it automatically turns on `font-lock-mode'."
   (when (derived-mode-p 'message-mode)
     ;; FIXME: Use font-lock-add-keywords!
     (let ((defaults (car font-lock-defaults))
-         default keywords)
+         default) ;; keywords
       (while defaults
        (setq default (if (consp defaults)
                          (pop defaults)
diff --git a/lisp/gnus/gnus-cloud.el b/lisp/gnus/gnus-cloud.el
index f7c71f4..3bc94f1 100644
--- a/lisp/gnus/gnus-cloud.el
+++ b/lisp/gnus/gnus-cloud.el
@@ -1,4 +1,4 @@
-;;; gnus-cloud.el --- storing and retrieving data via IMAP
+;;; gnus-cloud.el --- storing and retrieving data via IMAP  -*- 
lexical-binding: t; -*-
 
 ;; Copyright (C) 2014-2021 Free Software Foundation, Inc.
 
@@ -52,14 +52,12 @@ Each element may be either a string or a property list.
 The latter should have a :directory element whose value is a string,
 and a :match element whose value is a regular expression to match
 against the basename of files in said directory."
-  :group 'gnus-cloud
   :type '(repeat (choice (string :tag "File")
                          (plist :tag "Property list"))))
 
 (defcustom gnus-cloud-storage-method (if (featurep 'epg) 'epg 'base64-gzip)
   "Storage method for cloud data, defaults to EPG if that's available."
   :version "26.1"
-  :group 'gnus-cloud
   :type '(radio (const :tag "No encoding" nil)
                 (const :tag "Base64" base64)
                 (const :tag "Base64+gzip" base64-gzip)
@@ -68,7 +66,6 @@ against the basename of files in said directory."
 (defcustom gnus-cloud-interactive t
   "Whether Gnus Cloud changes should be confirmed."
   :version "26.1"
-  :group 'gnus-cloud
   :type 'boolean)
 
 (defvar gnus-cloud-group-name "Emacs-Cloud")
@@ -81,7 +78,6 @@ against the basename of files in said directory."
   "The IMAP select method used to store the cloud data.
 See also `gnus-server-set-cloud-method-server' for an
 easy interactive way to set this from the Server buffer."
-  :group 'gnus-cloud
   :type '(radio (const :tag "Not set" nil)
                 (string :tag "A Gnus server name as a string")))
 
@@ -132,7 +128,7 @@ easy interactive way to set this from the Server buffer."
 
    ((eq gnus-cloud-storage-method 'epg)
     (let ((context (epg-make-context 'OpenPGP))
-          cipher)
+          ) ;; cipher
       (setf (epg-context-armor context) t)
       (setf (epg-context-textmode context) t)
       (let ((data (epg-encrypt-string context
@@ -348,15 +344,15 @@ easy interactive way to set this from the Server buffer."
                   (group &optional previous method))
 
 (defun gnus-cloud-ensure-cloud-group ()
-  (let ((method (if (stringp gnus-cloud-method)
-                    (gnus-server-to-method gnus-cloud-method)
-                  gnus-cloud-method)))
+  ;; (let ((method (if (stringp gnus-cloud-method)
+  ;;                   (gnus-server-to-method gnus-cloud-method)
+  ;;                 gnus-cloud-method)))
     (unless (or (gnus-active gnus-cloud-group-name)
                 (gnus-activate-group gnus-cloud-group-name nil nil
                                      gnus-cloud-method))
       (and (gnus-request-create-group gnus-cloud-group-name gnus-cloud-method)
            (gnus-activate-group gnus-cloud-group-name nil nil 
gnus-cloud-method)
-           (gnus-subscribe-group gnus-cloud-group-name)))))
+           (gnus-subscribe-group gnus-cloud-group-name)))) ;; )
 
 (defun gnus-cloud-upload-all-data ()
   "Upload all data (newsrc and files) to the Gnus Cloud."
diff --git a/lisp/gnus/gnus-cus.el b/lisp/gnus/gnus-cus.el
index a36ef0c..d8f48b1 100644
--- a/lisp/gnus/gnus-cus.el
+++ b/lisp/gnus/gnus-cus.el
@@ -1,4 +1,4 @@
-;;; gnus-cus.el --- customization commands for Gnus
+;;; gnus-cus.el --- customization commands for Gnus  -*- lexical-binding: t; 
-*-
 
 ;; Copyright (C) 1996, 1999-2021 Free Software Foundation, Inc.
 
@@ -483,7 +483,7 @@ form, but who cares?"
     (buffer-enable-undo)
     (goto-char (point-min))))
 
-(defun gnus-group-customize-done (&rest ignore)
+(defun gnus-group-customize-done (&rest _ignore)
   "Apply changes and bury the buffer."
   (interactive)
   (let ((params (widget-value gnus-custom-params)))
@@ -927,7 +927,7 @@ articles in the thread.
     (use-local-map widget-keymap)
     (widget-setup)))
 
-(defun gnus-score-customize-done (&rest ignore)
+(defun gnus-score-customize-done (&rest _ignore)
   "Reset the score alist with the present value."
   (let ((alist gnus-custom-score-alist)
        (value (widget-value gnus-custom-scores)))
@@ -1027,14 +1027,15 @@ articles in the thread.
         (widget-create
          'push-button
          :notify
-         (lambda (&rest ignore)
+         (lambda (&rest _ignore)
            (let* ((info (assq gnus-agent-cat-name gnus-category-alist))
                   (widgets category-fields))
              (while widgets
                (let* ((widget (pop widgets))
                       (value (condition-case nil (widget-value widget) 
(error))))
                  (eval `(setf (,(widget-get widget :accessor) ',info)
-                              ',value)))))
+                              ',value)
+                       t))))
            (gnus-category-write)
            (gnus-kill-buffer (current-buffer))
            (when (get-buffer gnus-category-buffer)
diff --git a/lisp/gnus/gnus-delay.el b/lisp/gnus/gnus-delay.el
index 74147f2..0cee01b 100644
--- a/lisp/gnus/gnus-delay.el
+++ b/lisp/gnus/gnus-delay.el
@@ -1,4 +1,4 @@
-;;; gnus-delay.el --- Delayed posting of articles
+;;; gnus-delay.el --- Delayed posting of articles  -*- lexical-binding: t; -*-
 
 ;; Copyright (C) 2001-2021 Free Software Foundation, Inc.
 
@@ -44,24 +44,20 @@
 
 (defcustom gnus-delay-group "delayed"
   "Group name for storing delayed articles."
-  :type 'string
-  :group 'gnus-delay)
+  :type 'string)
 
 (defcustom gnus-delay-header "X-Gnus-Delayed"
   "Header name for storing info about delayed articles."
-  :type 'string
-  :group 'gnus-delay)
+  :type 'string)
 
 (defcustom gnus-delay-default-delay "3d"
   "Default length of delay."
-  :type 'string
-  :group 'gnus-delay)
+  :type 'string)
 
 (defcustom gnus-delay-default-hour 8
   "If deadline is given as date, then assume this time of day."
   :version "22.1"
-  :type 'integer
-  :group 'gnus-delay)
+  :type 'integer)
 
 ;;;###autoload
 (defun gnus-delay-article (delay)
@@ -86,7 +82,7 @@ generated when the article is sent."
          gnus-delay-default-delay)))
   ;; Allow spell checking etc.
   (run-hooks 'message-send-hook)
-  (let (num unit days year month day hour minute deadline)
+  (let (num unit year month day hour minute deadline) ;; days
     (cond ((string-match
            "\\([0-9][0-9][0-9]?[0-9]?\\)-\\([0-9]+\\)-\\([0-9]+\\)"
            delay)
@@ -171,7 +167,7 @@ generated when the article is sent."
            (message "Delay header missing for article %d" article)))))))
 
 ;;;###autoload
-(defun gnus-delay-initialize (&optional no-keymap no-check)
+(defun gnus-delay-initialize (&optional _no-keymap no-check)
   "Initialize the gnus-delay package.
 This sets up a key binding in `message-mode' to delay a message.
 This tells Gnus to look for delayed messages after getting new news.
diff --git a/lisp/gnus/gnus-demon.el b/lisp/gnus/gnus-demon.el
index 219f15e..e99247c 100644
--- a/lisp/gnus/gnus-demon.el
+++ b/lisp/gnus/gnus-demon.el
@@ -1,4 +1,4 @@
-;;; gnus-demon.el --- daemonic Gnus behavior
+;;; gnus-demon.el --- daemonic Gnus behavior  -*- lexical-binding: t; -*-
 
 ;; Copyright (C) 1995-2021 Free Software Foundation, Inc.
 
@@ -52,7 +52,6 @@ this number of `gnus-demon-timestep's.
 If IDLE is nil, don't care about idleness.
 If IDLE is a number and TIME is nil, then call once each time
 Emacs has been idle for IDLE `gnus-demon-timestep's."
-  :group 'gnus-demon
   :type '(repeat (list function
                       (choice :tag "Time"
                               (const :tag "never" nil)
@@ -65,7 +64,6 @@ Emacs has been idle for IDLE `gnus-demon-timestep's."
 
 (defcustom gnus-demon-timestep 60
   "Number of seconds in each demon timestep."
-  :group 'gnus-demon
   :type 'integer)
 
 ;;; Internal variables.
diff --git a/lisp/gnus/gnus-diary.el b/lisp/gnus/gnus-diary.el
index 561a15b..5270564 100644
--- a/lisp/gnus/gnus-diary.el
+++ b/lisp/gnus/gnus-diary.el
@@ -1,4 +1,4 @@
-;;; gnus-diary.el --- Wrapper around the NNDiary Gnus back end
+;;; gnus-diary.el --- Wrapper around the NNDiary Gnus back end  -*- 
lexical-binding: t; -*-
 
 ;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
@@ -57,8 +57,7 @@
 (defcustom gnus-diary-time-format "%a, %b %e %y, %H:%M"
   "Time format to display appointments in nndiary summary buffers.
 Please refer to `format-time-string' for information on possible values."
-  :type 'string
-  :group 'gnus-diary)
+  :type 'string)
 
 (defcustom gnus-diary-delay-format-function 'gnus-diary-delay-format-english
   "Function called to format a diary delay string.
@@ -73,8 +72,7 @@ There are currently two built-in format functions:
 `gnus-diary-delay-format-french'"
   :type '(choice (const  :tag "english" gnus-diary-delay-format-english)
                 (const  :tag "french"  gnus-diary-delay-format-french)
-                (symbol :tag "other"))
-  :group 'gnus-diary)
+                (symbol :tag "other")))
 
 (defconst gnus-diary-version nndiary-version
   "Current Diary back end version.")
diff --git a/lisp/gnus/gnus-dired.el b/lisp/gnus/gnus-dired.el
index e412dd0..ca2d57d 100644
--- a/lisp/gnus/gnus-dired.el
+++ b/lisp/gnus/gnus-dired.el
@@ -1,4 +1,4 @@
-;;; gnus-dired.el --- utility functions where gnus and dired meet
+;;; gnus-dired.el --- utility functions where gnus and dired meet  -*- 
lexical-binding: t; -*-
 
 ;; Copyright (C) 1996-1999, 2001-2021 Free Software Foundation, Inc.
 
diff --git a/lisp/gnus/gnus-draft.el b/lisp/gnus/gnus-draft.el
index 3b380f3..68fb400 100644
--- a/lisp/gnus/gnus-draft.el
+++ b/lisp/gnus/gnus-draft.el
@@ -1,4 +1,4 @@
-;;; gnus-draft.el --- draft message support for Gnus
+;;; gnus-draft.el --- draft message support for Gnus  -*- lexical-binding: t; 
-*-
 
 ;; Copyright (C) 1997-2021 Free Software Foundation, Inc.
 
@@ -99,11 +99,11 @@
     (let ((gnus-verbose-backends nil))
       (gnus-request-expire-articles (list article) group t))
     (push
-     `((lambda ()
-         (when (gnus-buffer-live-p ,gnus-summary-buffer)
-          (save-excursion
-            (set-buffer ,gnus-summary-buffer)
-            (gnus-cache-possibly-remove-article ,article nil nil nil t)))))
+     (let ((buf gnus-summary-buffer))
+       `(,(lambda ()
+            (when (gnus-buffer-live-p buf)
+             (with-current-buffer buf
+               (gnus-cache-possibly-remove-article article nil nil nil t))))))
      message-send-actions)))
 
 (defun gnus-draft-send-message (&optional n)
@@ -275,8 +275,7 @@ If DONT-POP is nil, display the buffer after setting it up."
       (gnus-configure-posting-styles)
       (setq gnus-message-group-art (cons gnus-newsgroup-name (cadr ga)))
       (setq message-post-method
-            `(lambda (arg)
-               (gnus-post-method arg ,(car ga))))
+            (lambda (arg) (gnus-post-method arg (car ga))))
       (unless (equal (cadr ga) "")
         (dolist (article (cdr ga))
           (message-add-action
diff --git a/lisp/gnus/gnus-dup.el b/lisp/gnus/gnus-dup.el
index f7d61bb..e4f3da9 100644
--- a/lisp/gnus/gnus-dup.el
+++ b/lisp/gnus/gnus-dup.el
@@ -40,17 +40,14 @@
   "If non-nil, save the duplicate list when shutting down Gnus.
 If nil, duplicate suppression will only work on duplicates
 seen in the same session."
-  :group 'gnus-duplicate
   :type 'boolean)
 
 (defcustom gnus-duplicate-list-length 10000
   "The maximum number of duplicate Message-IDs to keep track of."
-  :group 'gnus-duplicate
   :type 'integer)
 
 (defcustom gnus-duplicate-file (nnheader-concat gnus-directory "suppression")
   "The name of the file to store the duplicate suppression list."
-  :group 'gnus-duplicate
   :type 'file)
 
 ;;; Internal variables
diff --git a/lisp/gnus/gnus-eform.el b/lisp/gnus/gnus-eform.el
index feee732..265edf4 100644
--- a/lisp/gnus/gnus-eform.el
+++ b/lisp/gnus/gnus-eform.el
@@ -1,4 +1,4 @@
-;;; gnus-eform.el --- a mode for editing forms for Gnus
+;;; gnus-eform.el --- a mode for editing forms for Gnus  -*- lexical-binding: 
t; -*-
 
 ;; Copyright (C) 1996-2021 Free Software Foundation, Inc.
 
@@ -37,12 +37,10 @@
 
 (defcustom gnus-edit-form-mode-hook nil
   "Hook run in `gnus-edit-form-mode' buffers."
-  :group 'gnus-edit-form
   :type 'hook)
 
 (defcustom gnus-edit-form-menu-hook nil
   "Hook run when creating menus in `gnus-edit-form-mode' buffers."
-  :group 'gnus-edit-form
   :type 'hook)
 
 ;;; Internal variables
diff --git a/lisp/gnus/gnus-fun.el b/lisp/gnus/gnus-fun.el
index 8ce6990..f69c2ed 100644
--- a/lisp/gnus/gnus-fun.el
+++ b/lisp/gnus/gnus-fun.el
@@ -1,4 +1,4 @@
-;;; gnus-fun.el --- various frivolous extension functions to Gnus
+;;; gnus-fun.el --- various frivolous extension functions to Gnus  -*- 
lexical-binding: t; -*-
 
 ;; Copyright (C) 2002-2021 Free Software Foundation, Inc.
 
diff --git a/lisp/gnus/gnus-gravatar.el b/lisp/gnus/gnus-gravatar.el
index a7ca733..9ea9e10 100644
--- a/lisp/gnus/gnus-gravatar.el
+++ b/lisp/gnus/gnus-gravatar.el
@@ -38,21 +38,18 @@
 If nil, default to `gravatar-size'."
   :type '(choice (const :tag "Default" nil)
                  (integer :tag "Pixels"))
-  :version "24.1"
-  :group 'gnus-gravatar)
+  :version "24.1")
 
 (defcustom gnus-gravatar-properties '(:ascent center :relief 1)
   "List of image properties applied to Gravatar images."
   :type 'plist
-  :version "24.1"
-  :group 'gnus-gravatar)
+  :version "24.1")
 
 (defcustom gnus-gravatar-too-ugly gnus-article-x-face-too-ugly
   "Regexp matching posters whose avatar shouldn't be shown automatically.
 If nil, show all avatars."
   :type '(choice regexp (const :tag "Allow all" nil))
-  :version "24.1"
-  :group 'gnus-gravatar)
+  :version "24.1")
 
 (defun gnus-gravatar-transform-address (header category &optional force)
   (gnus-with-article-headers
diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el
index a165752..76ba653 100644
--- a/lisp/gnus/gnus-group.el
+++ b/lisp/gnus/gnus-group.el
@@ -1,4 +1,4 @@
-;;; gnus-group.el --- group mode commands for Gnus
+;;; gnus-group.el --- group mode commands for Gnus  -*- lexical-binding: t; -*-
 
 ;; Copyright (C) 1996-2021 Free Software Foundation, Inc.
 
@@ -39,10 +39,11 @@
 (eval-when-compile
   (require 'mm-url)
   (require 'subr-x)
-  (let ((features (cons 'gnus-group features)))
-    (require 'gnus-sum))
-  (unless (boundp 'gnus-cache-active-hashtb)
-    (defvar gnus-cache-active-hashtb nil)))
+  (with-suppressed-warnings ((lexical features))
+    (dlet ((features (cons 'gnus-group features)))
+      (require 'gnus-sum))))
+
+(defvar gnus-cache-active-hashtb)
 
 (defvar tool-bar-mode)
 
@@ -476,6 +477,8 @@ simple manner."
 
 (defvar gnus-group-edit-buffer nil)
 
+(defvar gnus-tmp-level)
+(defvar gnus-tmp-marked)
 (defvar gnus-tmp-news-method)
 (defvar gnus-tmp-colon)
 (defvar gnus-tmp-news-server)
@@ -483,6 +486,7 @@ simple manner."
 (defvar gnus-tmp-process-marked)
 (defvar gnus-tmp-summary-live)
 (defvar gnus-tmp-news-method-string)
+(defvar gnus-tmp-group)
 (defvar gnus-tmp-group-icon)
 (defvar gnus-tmp-moderated-string)
 (defvar gnus-tmp-newsgroup-description)
@@ -505,7 +509,8 @@ simple manner."
                (+ number
                   (gnus-range-length (cdr (assq 'dormant gnus-tmp-marked)))
                   (gnus-range-length (cdr (assq 'tick gnus-tmp-marked))))))
-             (t number)) ?s)
+             (t number))
+       ?s)
     (?R gnus-tmp-number-of-read ?s)
     (?U (if (gnus-active gnus-tmp-group)
            (gnus-number-of-unseen-articles-in-group gnus-tmp-group)
@@ -516,7 +521,8 @@ simple manner."
     (?I (gnus-range-length (cdr (assq 'dormant gnus-tmp-marked))) ?d)
     (?T (gnus-range-length (cdr (assq 'tick gnus-tmp-marked))) ?d)
     (?i (+ (gnus-range-length (cdr (assq 'dormant gnus-tmp-marked)))
-          (gnus-range-length (cdr (assq 'tick gnus-tmp-marked)))) ?d)
+          (gnus-range-length (cdr (assq 'tick gnus-tmp-marked))))
+       ?d)
     (?g gnus-tmp-group ?s)
     (?G gnus-tmp-qualified-group ?s)
     (?c (gnus-short-group-name gnus-tmp-group)
@@ -1497,11 +1503,12 @@ if it is a string, only list groups matching REGEXP."
             (gnus-group-get-new-news 0))))
   :type 'boolean)
 
-(defun gnus-group-insert-group-line (gnus-tmp-group gnus-tmp-level
-                                                   gnus-tmp-marked number
-                                                   gnus-tmp-method)
+(defun gnus-group-insert-group-line (group level marked number gnus-tmp-method)
   "Insert a group line in the group buffer."
-  (let* ((gnus-tmp-method
+  (let* ((gnus-tmp-level level)
+        (gnus-tmp-marked marked)
+        (gnus-tmp-group group)
+        (gnus-tmp-method
          (gnus-server-get-method gnus-tmp-group gnus-tmp-method))
         (gnus-tmp-active (gnus-active gnus-tmp-group))
         (gnus-tmp-number-total
@@ -1541,7 +1548,8 @@ if it is a string, only list groups matching REGEXP."
         (gnus-tmp-news-method-string
          (if gnus-tmp-method
              (format "(%s:%s)" (car gnus-tmp-method)
-                     (cadr gnus-tmp-method)) ""))
+                     (cadr gnus-tmp-method))
+           ""))
         (gnus-tmp-marked-mark
          (if (and (numberp number)
                   (zerop number)
@@ -1564,7 +1572,7 @@ if it is a string, only list groups matching REGEXP."
      (point)
      (prog1 (1+ (point))
        ;; Insert the text.
-       (eval gnus-group-line-format-spec))
+       (eval gnus-group-line-format-spec t))
      `(gnus-group ,gnus-tmp-group
                  gnus-unread ,(if (numberp number)
                                   (string-to-number gnus-tmp-number-of-unread)
@@ -1735,7 +1743,7 @@ already.  If INFO-UNCHANGED is non-nil, dribble buffer is 
not updated."
                   (buffer-modified-p gnus-dribble-buffer)
                   (with-current-buffer gnus-dribble-buffer
                     (not (zerop (buffer-size))))))
-            (mode-string (eval gformat)))
+            (mode-string (eval gformat t)))
        ;; Say whether the dribble buffer has been modified.
        (setq mode-line-modified
              (if modified "**" "--"))
@@ -1931,7 +1939,7 @@ Return nil if the group isn't displayed."
        (gnus-group-mark-group 1 nil t))
     (setq gnus-group-marked (cons group (delete group gnus-group-marked)))))
 
-(defun gnus-group-universal-argument (arg &optional groups func)
+(defun gnus-group-universal-argument (arg &optional _groups func)
   "Perform any command on all groups according to the process/prefix 
convention."
   (interactive "P")
   (if (eq (setq func (or func
@@ -1942,7 +1950,7 @@ Return nil if the group isn't displayed."
          'undefined)
       (gnus-error 1 "Undefined key")
     (gnus-group-iterate arg
-      (lambda (group)
+      (lambda (_group)
        (command-execute func))))
   (gnus-group-position-point))
 
@@ -1985,31 +1993,18 @@ Take into consideration N (the prefix) and the list of 
marked groups."
     (let ((group (gnus-group-group-name)))
       (and group (list group))))))
 
-;;; !!!Surely gnus-group-iterate should be a macro instead?  I can't
-;;; imagine why I went through these contortions...
-(eval-and-compile
-  (let ((function (make-symbol "gnus-group-iterate-function"))
-       (window (make-symbol "gnus-group-iterate-window"))
-       (groups (make-symbol "gnus-group-iterate-groups"))
-       (group (make-symbol "gnus-group-iterate-group")))
-    (eval
-     `(defun gnus-group-iterate (arg ,function)
-       "Iterate FUNCTION over all process/prefixed groups.
+(defun gnus-group-iterate (arg function)
+  "Iterate FUNCTION over all process/prefixed groups.
 FUNCTION will be called with the group name as the parameter
 and with point over the group in question."
-       (let ((,groups (gnus-group-process-prefix arg))
-             (,window (selected-window))
-             ,group)
-         (while ,groups
-           (setq ,group (car ,groups)
-                 ,groups (cdr ,groups))
-           (select-window ,window)
-           (gnus-group-remove-mark ,group)
-           (save-selected-window
-             (save-excursion
-               (funcall ,function ,group)))))))))
-
-(put 'gnus-group-iterate 'lisp-indent-function 1)
+  (declare (indent 1))
+  (let ((window (selected-window)))
+    (dolist (group (gnus-group-process-prefix arg))
+      (select-window window)
+      (gnus-group-remove-mark group)
+      (save-selected-window
+       (save-excursion
+         (funcall function group))))))
 
 ;; Selecting groups.
 
@@ -2064,6 +2059,12 @@ articles in the group."
     (forward-line -1))
   (gnus-group-read-group all t))
 
+(defvar gnus-visual)
+(defvar gnus-score-find-score-files-function)
+(defvar gnus-home-score-file)
+(defvar gnus-apply-kill-hook)
+(defvar gnus-summary-expunge-below)
+
 (defun gnus-group-quick-select-group (&optional all group)
   "Select the GROUP \"quickly\".
 This means that no highlighting or scoring will be performed.  If
@@ -2521,7 +2522,7 @@ The arguments have the same meaning as those of
         (if (stringp id) (setq id (string-to-number id)))
         (setq-local debbugs-gnu-bug-number id)))))
 
-(defun gnus-group-jump-to-group (group &optional prompt)
+(defun gnus-group-jump-to-group (group &optional _prompt)
   "Jump to newsgroup GROUP.
 
 If PROMPT (the prefix) is a number, use the prompt specified in
@@ -2807,7 +2808,7 @@ not-expirable articles, too."
           (format "Do you really want to delete these %d articles forever? "
                   (length articles)))
       (gnus-request-expire-articles articles group
-                                   (if current-prefix-arg
+                                   (if oldp
                                        nil
                                      'force)))))
 
@@ -2926,8 +2927,8 @@ and NEW-NAME will be prompted for."
        ((eq part 'params) "group parameters")
        (t "group info"))
       group)
-     `(lambda (form)
-       (gnus-group-edit-group-done ',part ,group form)))
+     (lambda (form)
+       (gnus-group-edit-group-done part group form)))
     (local-set-key
      "\C-c\C-i"
      (gnus-create-info-command
@@ -2995,7 +2996,7 @@ and NEW-NAME will be prompted for."
   (setq method (copy-tree method))
   (let (entry)
     (while (setq entry (memq (assq 'eval method) method))
-      (setcar entry (eval (cadar entry)))))
+      (setcar entry (eval (cadar entry) t))))
   (gnus-group-make-group group method))
 
 (defun gnus-group-make-help-group (&optional noerror)
@@ -3374,9 +3375,9 @@ Editing the access control list for `%s'.
        implementation-defined hierarchy, RENAME or DELETE mailbox)
    d - delete messages (STORE \\DELETED flag, perform EXPUNGE)
    a - administer (perform SETACL)" group)
-                   `(lambda (form)
-                      (nnimap-acl-edit
-                       ,mailbox ',method ',acl form)))))
+                   (lambda (form)
+                     (nnimap-acl-edit
+                      mailbox method acl form)))))
 
 ;; Group sorting commands
 ;; Suggested by Joe Hildebrand <hildjj@idaho.fuentez.com>.
@@ -4327,9 +4328,9 @@ If FORCE, force saving whether it is necessary or not."
   (interactive "P")
   (gnus-save-newsrc-file force))
 
-(defun gnus-group-restart (&optional arg)
+(defun gnus-group-restart (&optional _arg)
   "Force Gnus to read the .newsrc file."
-  (interactive "P")
+  (interactive)
   (when (gnus-yes-or-no-p
         (format "Are you sure you want to restart Gnus? "))
     (gnus-save-newsrc-file)
@@ -4748,9 +4749,9 @@ This command may read the active file."
       (forward-char 1))
     groups))
 
-(defun gnus-group-list-plus (&optional args)
+(defun gnus-group-list-plus (&optional _args)
   "List groups plus the current selection."
-  (interactive "P")
+  (interactive)
   (let ((gnus-group-listed-groups (gnus-group-listed-groups))
        (gnus-group-list-mode gnus-group-list-mode) ;; Save it.
        func)
diff --git a/lisp/gnus/gnus-html.el b/lisp/gnus/gnus-html.el
index 855d085..be62bfd 100644
--- a/lisp/gnus/gnus-html.el
+++ b/lisp/gnus/gnus-html.el
@@ -1,4 +1,4 @@
-;;; gnus-html.el --- Render HTML in a buffer.
+;;; gnus-html.el --- Render HTML in a buffer.  -*- lexical-binding: t; -*-
 
 ;; Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
@@ -151,8 +151,8 @@ fit these criteria."
 
 (defun gnus-html-wash-images ()
   "Run through current buffer and replace img tags by images."
-  (let (tag parameters string start end images url alt-text
-           inhibit-images blocked-images)
+  (let ( parameters start end ;; tag string images
+        inhibit-images blocked-images)
     (if (buffer-live-p gnus-summary-buffer)
        (with-current-buffer gnus-summary-buffer
          (setq inhibit-images gnus-inhibit-images
@@ -169,67 +169,67 @@ fit these criteria."
        (delete-region (match-beginning 0) (match-end 0)))
       (setq end (point))
       (when (string-match "src=\"\\([^\"]+\\)" parameters)
-       (gnus-message 8 "gnus-html-wash-tags: fetching image URL %s" url)
-       (setq url (gnus-html-encode-url (match-string 1 parameters))
-             alt-text (when (string-match "\\(alt\\|title\\)=\"\\([^\"]+\\)"
-                                          parameters)
-                        (xml-substitute-special (match-string 2 parameters))))
-       (add-text-properties
-        start end
-        (list 'image-url url
-              'image-displayer `(lambda (url start end)
-                                  (gnus-html-display-image url start end
-                                                           ,alt-text))
-              'help-echo alt-text
-              'button t
-              'keymap gnus-html-image-map
-              'gnus-image (list url start end alt-text)))
-       (if (string-match "\\`cid:" url)
-           ;; URLs with cid: have their content stashed in other
-           ;; parts of the MIME structure, so just insert them
-           ;; immediately.
-           (let* ((handle (mm-get-content-id (substring url (match-end 0))))
-                  (image (when (and handle
-                                    (not inhibit-images))
-                           (gnus-create-image
-                            (mm-with-part handle (buffer-string))
-                            nil t))))
-             (if image
-                 (gnus-add-image
-                  'cid
-                  (gnus-put-image
-                   (gnus-rescale-image
-                    image (gnus-html-maximum-image-size))
-                   (gnus-string-or (prog1
-                                       (buffer-substring start end)
-                                     (delete-region start end))
-                                   "*")
-                   'cid))
+       (let ((url (gnus-html-encode-url (match-string 1 parameters)))
+             (alt-text (when (string-match "\\(alt\\|title\\)=\"\\([^\"]+\\)"
+                                           parameters)
+                         (xml-substitute-special (match-string 2 
parameters)))))
+         (gnus-message 8 "gnus-html-wash-tags: fetching image URL %s" url)
+         (add-text-properties
+          start end
+          (list 'image-url url
+                'image-displayer (lambda (url start end)
+                                   (gnus-html-display-image url start end
+                                                            alt-text))
+                'help-echo alt-text
+                'button t
+                'keymap gnus-html-image-map
+                'gnus-image (list url start end alt-text)))
+         (if (string-match "\\`cid:" url)
+             ;; URLs with cid: have their content stashed in other
+             ;; parts of the MIME structure, so just insert them
+             ;; immediately.
+             (let* ((handle (mm-get-content-id (substring url (match-end 0))))
+                    (image (when (and handle
+                                      (not inhibit-images))
+                             (gnus-create-image
+                              (mm-with-part handle (buffer-string))
+                              nil t))))
+               (if image
+                   (gnus-add-image
+                    'cid
+                    (gnus-put-image
+                     (gnus-rescale-image
+                      image (gnus-html-maximum-image-size))
+                     (gnus-string-or (prog1
+                                         (buffer-substring start end)
+                                       (delete-region start end))
+                                     "*")
+                     'cid))
+                 (make-text-button start end
+                                   'help-echo url
+                                   'keymap gnus-html-image-map)))
+           ;; Normal, external URL.
+           (if (or inhibit-images
+                   (gnus-html-image-url-blocked-p url blocked-images))
                (make-text-button start end
                                  'help-echo url
-                                 'keymap gnus-html-image-map)))
-         ;; Normal, external URL.
-         (if (or inhibit-images
-                 (gnus-html-image-url-blocked-p url blocked-images))
-             (make-text-button start end
-                               'help-echo url
-                               'keymap gnus-html-image-map)
-           ;; Non-blocked url
-           (let ((width
-                  (when (string-match "width=\"?\\([0-9]+\\)" parameters)
-                    (string-to-number (match-string 1 parameters))))
-                 (height
-                  (when (string-match "height=\"?\\([0-9]+\\)" parameters)
-                    (string-to-number (match-string 1 parameters)))))
-             ;; Don't fetch images that are really small.  They're
-             ;; probably tracking pictures.
-             (when (and (or (null height)
-                            (> height 4))
-                        (or (null width)
-                            (> width 4)))
-               (gnus-html-display-image url start end alt-text)))))))))
-
-(defun gnus-html-display-image (url start end &optional alt-text)
+                                 'keymap gnus-html-image-map)
+             ;; Non-blocked url
+             (let ((width
+                    (when (string-match "width=\"?\\([0-9]+\\)" parameters)
+                      (string-to-number (match-string 1 parameters))))
+                   (height
+                    (when (string-match "height=\"?\\([0-9]+\\)" parameters)
+                      (string-to-number (match-string 1 parameters)))))
+               ;; Don't fetch images that are really small.  They're
+               ;; probably tracking pictures.
+               (when (and (or (null height)
+                              (> height 4))
+                          (or (null width)
+                              (> width 4)))
+                 (gnus-html-display-image url start end alt-text))))))))))
+
+(defun gnus-html-display-image (url _start _end &optional alt-text)
   "Display image at URL on text from START to END.
 Use ALT-TEXT for the image string."
   (or alt-text (setq alt-text "*"))
@@ -248,7 +248,7 @@ Use ALT-TEXT for the image string."
       (gnus-html-put-image (gnus-html-get-image-data url) url alt-text))))
 
 (defun gnus-html-wash-tags ()
-  (let (tag parameters string start end images url)
+  (let (tag parameters start end url) ;; string images
     (gnus-html-pre-wash)
     (gnus-html-wash-images)
 
diff --git a/lisp/gnus/gnus-int.el b/lisp/gnus/gnus-int.el
index 8bad446..6492862 100644
--- a/lisp/gnus/gnus-int.el
+++ b/lisp/gnus/gnus-int.el
@@ -1,4 +1,4 @@
-;;; gnus-int.el --- backend interface functions for Gnus
+;;; gnus-int.el --- backend interface functions for Gnus  -*- lexical-binding: 
t; -*-
 
 ;; Copyright (C) 1996-2021 Free Software Foundation, Inc.
 
@@ -76,23 +76,25 @@ server denied."
   "The current method, for the registry.")
 
 
-(defun gnus-server-opened (gnus-command-method)
-  "Check whether a connection to GNUS-COMMAND-METHOD has been opened."
-  (unless (eq (gnus-server-status gnus-command-method)
+(defun gnus-server-opened (command-method)
+  "Check whether a connection to COMMAND-METHOD has been opened."
+  (unless (eq (gnus-server-status command-method)
              'denied)
-    (when (stringp gnus-command-method)
-      (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
-    (funcall (inline (gnus-get-function gnus-command-method 'server-opened))
-            (nth 1 gnus-command-method))))
-
-(defun gnus-status-message (gnus-command-method)
-  "Return the status message from GNUS-COMMAND-METHOD.
-If GNUS-COMMAND-METHOD is a string, it is interpreted as a group
-name.  The method this group uses will be queried."
+    (let ((gnus-command-method
+           (if (stringp command-method)
+               (gnus-server-to-method command-method)
+             command-method)))
+      (funcall (inline (gnus-get-function gnus-command-method 'server-opened))
+               (nth 1 gnus-command-method)))))
+
+(defun gnus-status-message (command-method)
+  "Return the status message from COMMAND-METHOD.
+If COMMAND-METHOD is a string, it is interpreted as a group name.
+The method this group uses will be queried."
   (let ((gnus-command-method
-        (if (stringp gnus-command-method)
-            (gnus-find-method-for-group gnus-command-method)
-          gnus-command-method)))
+        (if (stringp command-method)
+            (gnus-find-method-for-group command-method)
+          command-method)))
     (funcall (gnus-get-function gnus-command-method 'status-message)
             (nth 1 gnus-command-method))))
 
@@ -265,13 +267,14 @@ If it is down, start it up (again)."
                      type form))
       (setq gnus-backend-trace-elapsed (float-time)))))
 
-(defun gnus-open-server (gnus-command-method)
-  "Open a connection to GNUS-COMMAND-METHOD."
-  (when (stringp gnus-command-method)
-    (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
+(defun gnus-open-server (command-method)
+  "Open a connection to COMMAND-METHOD."
   (gnus-backend-trace :opening gnus-command-method)
-  (let ((elem (assoc gnus-command-method gnus-opened-servers))
-       (server (gnus-method-to-server-name gnus-command-method)))
+  (let* ((gnus-command-method (if (stringp command-method)
+                                  (gnus-server-to-method command-method)
+                                command-method))
+         (elem (assoc gnus-command-method gnus-opened-servers))
+         (server (gnus-method-to-server-name gnus-command-method)))
     ;; If this method was previously denied, we just return nil.
     (if (eq (nth 1 elem) 'denied)
        (progn
@@ -347,23 +350,27 @@ If it is down, start it up (again)."
          (gnus-backend-trace :opened gnus-command-method)
           result)))))
 
-(defun gnus-close-server (gnus-command-method)
-  "Close the connection to GNUS-COMMAND-METHOD."
-  (when (stringp gnus-command-method)
-    (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
-  (prog1
-      (funcall (gnus-get-function gnus-command-method 'close-server)
-              (nth 1 gnus-command-method)
-              (nthcdr 2 gnus-command-method))
-    (when-let ((elem (assoc gnus-command-method gnus-opened-servers)))
-      (setf (nth 1 elem) 'closed))))
-
-(defun gnus-request-list (gnus-command-method)
-  "Request the active file from GNUS-COMMAND-METHOD."
-  (when (stringp gnus-command-method)
-    (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
-  (funcall (gnus-get-function gnus-command-method 'request-list)
-          (nth 1 gnus-command-method)))
+(defun gnus-close-server (command-method)
+  "Close the connection to COMMAND-METHOD."
+  (let ((gnus-command-method
+         (if (stringp command-method)
+             (gnus-server-to-method command-method)
+           command-method)))
+    (prog1
+       (funcall (gnus-get-function gnus-command-method 'close-server)
+                (nth 1 gnus-command-method)
+                (nthcdr 2 gnus-command-method))
+      (when-let ((elem (assoc gnus-command-method gnus-opened-servers)))
+        (setf (nth 1 elem) 'closed)))))
+
+(defun gnus-request-list (command-method)
+  "Request the active file from COMMAND-METHOD."
+  (let ((gnus-command-method
+         (if (stringp command-method)
+             (gnus-server-to-method command-method)
+           command-method)))
+    (funcall (gnus-get-function gnus-command-method 'request-list)
+             (nth 1 gnus-command-method))))
 
 (defun gnus-server-get-active (server &optional ignored)
   "Return the active list for SERVER.
@@ -407,47 +414,57 @@ Groups matching the IGNORED regexp are excluded."
            (forward-line)))))
     groups))
 
-(defun gnus-finish-retrieve-group-infos (gnus-command-method infos data)
-  "Read and update infos from GNUS-COMMAND-METHOD."
-  (when (stringp gnus-command-method)
-    (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
+(defun gnus-finish-retrieve-group-infos (command-method infos data)
+  "Read and update infos from COMMAND-METHOD."
+  (let ((gnus-command-method
+         (if (stringp command-method)
+             (gnus-server-to-method command-method)
+           command-method)))
   (gnus-backend-trace :finishing gnus-command-method)
   (prog1
       (funcall (gnus-get-function gnus-command-method
                                  'finish-retrieve-group-infos)
               (nth 1 gnus-command-method)
               infos data)
-    (gnus-backend-trace :finished gnus-command-method)))
-
-(defun gnus-retrieve-group-data-early (gnus-command-method infos)
-  "Start early async retrieval of data from GNUS-COMMAND-METHOD."
-  (when (stringp gnus-command-method)
-    (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
-  (funcall (gnus-get-function gnus-command-method 'retrieve-group-data-early)
-          (nth 1 gnus-command-method)
-          infos))
-
-(defun gnus-request-list-newsgroups (gnus-command-method)
-  "Request the newsgroups file from GNUS-COMMAND-METHOD."
-  (when (stringp gnus-command-method)
-    (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
-  (funcall (gnus-get-function gnus-command-method 'request-list-newsgroups)
-          (nth 1 gnus-command-method)))
-
-(defun gnus-request-newgroups (date gnus-command-method)
-  "Request all new groups since DATE from GNUS-COMMAND-METHOD."
-  (when (stringp gnus-command-method)
-    (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
-  (let ((func (gnus-get-function gnus-command-method 'request-newgroups t)))
-    (when func
-      (funcall func date (nth 1 gnus-command-method)))))
-
-(defun gnus-request-regenerate (gnus-command-method)
-  "Request a data generation from GNUS-COMMAND-METHOD."
-  (when (stringp gnus-command-method)
-    (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
-  (funcall (gnus-get-function gnus-command-method 'request-regenerate)
-          (nth 1 gnus-command-method)))
+      (gnus-backend-trace :finished gnus-command-method))))
+
+(defun gnus-retrieve-group-data-early (command-method infos)
+  "Start early async retrieval of data from COMMAND-METHOD."
+  (let ((gnus-command-method
+         (if (stringp command-method)
+             (gnus-server-to-method command-method)
+           command-method)))
+    (funcall (gnus-get-function gnus-command-method 'retrieve-group-data-early)
+             (nth 1 gnus-command-method)
+             infos)))
+
+(defun gnus-request-list-newsgroups (command-method)
+  "Request the newsgroups file from COMMAND-METHOD."
+  (let ((gnus-command-method
+         (if (stringp command-method)
+             (gnus-server-to-method command-method)
+           command-method)))
+    (funcall (gnus-get-function gnus-command-method 'request-list-newsgroups)
+             (nth 1 gnus-command-method))))
+
+(defun gnus-request-newgroups (date command-method)
+  "Request all new groups since DATE from COMMAND-METHOD."
+  (let ((gnus-command-method
+         (if (stringp command-method)
+             (gnus-server-to-method command-method)
+           command-method)))
+    (let ((func (gnus-get-function gnus-command-method 'request-newgroups t)))
+      (when func
+        (funcall func date (nth 1 gnus-command-method))))))
+
+(defun gnus-request-regenerate (command-method)
+  "Request a data generation from COMMAND-METHOD."
+  (let ((gnus-command-method
+         (if (stringp command-method)
+             (gnus-server-to-method command-method)
+           command-method)))
+    (funcall (gnus-get-function gnus-command-method 'request-regenerate)
+             (nth 1 gnus-command-method))))
 
 (defun gnus-request-compact-group (group)
   (let* ((method (gnus-find-method-for-group group))
@@ -459,17 +476,19 @@ Groups matching the IGNORED regexp are excluded."
                   (nth 1 gnus-command-method) t)))
     result))
 
-(defun gnus-request-compact (gnus-command-method)
-  "Request groups compaction from GNUS-COMMAND-METHOD."
-  (when (stringp gnus-command-method)
-    (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
-  (funcall (gnus-get-function gnus-command-method 'request-compact)
-          (nth 1 gnus-command-method)))
+(defun gnus-request-compact (command-method)
+  "Request groups compaction from COMMAND-METHOD."
+  (let ((gnus-command-method
+         (if (stringp command-method)
+             (gnus-server-to-method command-method)
+           command-method)))
+    (funcall (gnus-get-function gnus-command-method 'request-compact)
+             (nth 1 gnus-command-method))))
 
-(defun gnus-request-group (group &optional dont-check gnus-command-method info)
+(defun gnus-request-group (group &optional dont-check command-method info)
   "Request GROUP.  If DONT-CHECK, no information is required."
   (let ((gnus-command-method
-        (or gnus-command-method (inline (gnus-find-method-for-group group)))))
+        (or command-method (inline (gnus-find-method-for-group group)))))
     (when (stringp gnus-command-method)
       (setq gnus-command-method
            (inline (gnus-server-to-method gnus-command-method))))
@@ -522,12 +541,14 @@ If FETCH-OLD, retrieve all headers (or some subset 
thereof) in the group."
             articles (gnus-group-real-name group)
             (nth 1 gnus-command-method))))
 
-(defun gnus-retrieve-groups (groups gnus-command-method)
-  "Request active information on GROUPS from GNUS-COMMAND-METHOD."
-  (when (stringp gnus-command-method)
-    (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
-  (funcall (gnus-get-function gnus-command-method 'retrieve-groups)
-          groups (nth 1 gnus-command-method)))
+(defun gnus-retrieve-groups (groups command-method)
+  "Request active information on GROUPS from COMMAND-METHOD."
+  (let ((gnus-command-method
+         (if (stringp command-method)
+             (gnus-server-to-method command-method)
+           command-method)))
+    (funcall (gnus-get-function gnus-command-method 'retrieve-groups)
+             groups (nth 1 gnus-command-method))))
 
 (defun gnus-request-type (group &optional article)
   "Return the type (`post' or `mail') of GROUP (and ARTICLE)."
@@ -715,26 +736,33 @@ from other groups -- for instance, search results and the 
like."
          (delete-region (point-min) (1- (point))))))
     res))
 
-(defun gnus-request-post (gnus-command-method)
-  "Post the current buffer using GNUS-COMMAND-METHOD."
-  (when (stringp gnus-command-method)
-    (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
-  (funcall (gnus-get-function gnus-command-method 'request-post)
-          (nth 1 gnus-command-method)))
+(defun gnus-request-post (command-method)
+  "Post the current buffer using COMMAND-METHOD."
+  (let ((gnus-command-method
+         (if (stringp command-method)
+             (gnus-server-to-method command-method)
+           command-method)))
+    (funcall (gnus-get-function gnus-command-method 'request-post)
+             (nth 1 gnus-command-method))))
 
-(defun gnus-request-expunge-group (group gnus-command-method)
+(defun gnus-request-expunge-group (group command-method)
   "Expunge GROUP, which is removing articles that have been marked as deleted."
-  (when (stringp gnus-command-method)
-    (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
-  (funcall (gnus-get-function gnus-command-method 'request-expunge-group)
-          (gnus-group-real-name group)
-          (nth 1 gnus-command-method)))
-
-(defun gnus-request-scan (group gnus-command-method)
-  "Request a SCAN being performed in GROUP from GNUS-COMMAND-METHOD.
-If GROUP is nil, all groups on GNUS-COMMAND-METHOD are scanned."
   (let ((gnus-command-method
-        (if group (gnus-find-method-for-group group) gnus-command-method))
+         (if (stringp command-method)
+             (gnus-server-to-method command-method)
+           command-method)))
+    (funcall (gnus-get-function gnus-command-method 'request-expunge-group)
+             (gnus-group-real-name group)
+             (nth 1 gnus-command-method))))
+
+(defvar mail-source-plugged)
+(defvar gnus-inhibit-demon)
+
+(defun gnus-request-scan (group command-method)
+  "Request a SCAN being performed in GROUP from COMMAND-METHOD.
+If GROUP is nil, all groups on COMMAND-METHOD are scanned."
+  (let ((gnus-command-method
+        (if group (gnus-find-method-for-group group) command-method))
        (gnus-inhibit-demon t)
        (mail-source-plugged gnus-plugged))
     (when (or gnus-plugged
@@ -744,36 +772,40 @@ If GROUP is nil, all groups on GNUS-COMMAND-METHOD are 
scanned."
               (and group (gnus-group-real-name group))
               (nth 1 gnus-command-method)))))
 
-(defun gnus-request-update-info (info gnus-command-method)
+(defun gnus-request-update-info (info command-method)
   (when (gnus-check-backend-function
-        'request-update-info (car gnus-command-method))
-    (when (stringp gnus-command-method)
-      (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
-    (funcall (gnus-get-function gnus-command-method 'request-update-info)
-            (gnus-group-real-name (gnus-info-group info)) info
-            (nth 1 gnus-command-method))))
-
-(defsubst gnus-request-marks (info gnus-command-method)
-  "Request that GNUS-COMMAND-METHOD update INFO."
-  (when (stringp gnus-command-method)
-    (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
-  (when (gnus-check-backend-function
-        'request-marks (car gnus-command-method))
-    (let ((group (gnus-info-group info)))
-      (and (funcall (gnus-get-function gnus-command-method 'request-marks)
-                   (gnus-group-real-name group)
-                   info (nth 1 gnus-command-method))
-          ;; If the minimum article number is greater than 1, then all
-          ;; smaller article numbers are known not to exist; we'll
-          ;; artificially add those to the 'read range.
-          (let* ((active (gnus-active group))
-                 (min (car active)))
-            (when (> min 1)
-              (let* ((range (if (= min 2) 1 (cons 1 (1- min))))
-                     (read (gnus-info-read info))
-                     (new-read (gnus-range-add read (list range))))
-                (setf (gnus-info-read info) new-read)))
-            info)))))
+        'request-update-info (car command-method))
+    (let ((gnus-command-method
+           (if (stringp command-method)
+               (gnus-server-to-method command-method)
+             command-method)))
+      (funcall (gnus-get-function gnus-command-method 'request-update-info)
+               (gnus-group-real-name (gnus-info-group info)) info
+               (nth 1 gnus-command-method)))))
+
+(defsubst gnus-request-marks (info command-method)
+  "Request that COMMAND-METHOD update INFO."
+  (let ((gnus-command-method
+         (if (stringp command-method)
+             (gnus-server-to-method command-method)
+           command-method)))
+    (when (gnus-check-backend-function
+           'request-marks (car gnus-command-method))
+      (let ((group (gnus-info-group info)))
+        (and (funcall (gnus-get-function gnus-command-method 'request-marks)
+                      (gnus-group-real-name group)
+                      info (nth 1 gnus-command-method))
+             ;; If the minimum article number is greater than 1, then all
+             ;; smaller article numbers are known not to exist; we'll
+             ;; artificially add those to the 'read range.
+             (let* ((active (gnus-active group))
+                    (min (car active)))
+               (when (> min 1)
+                 (let* ((range (if (= min 2) 1 (cons 1 (1- min))))
+                        (read (gnus-info-read info))
+                        (new-read (gnus-range-add read (list range))))
+                   (setf (gnus-info-read info) new-read)))
+               info))))))
 
 (defun gnus-request-expire-articles (articles group &optional force)
   (let* ((gnus-command-method (gnus-find-method-for-group group))
@@ -794,7 +826,7 @@ If GROUP is nil, all groups on GNUS-COMMAND-METHOD are 
scanned."
           (gnus-agent-expire expired-articles group 'force))))
     not-deleted))
 
-(defun gnus-request-move-article (article group server accept-function
+(defun gnus-request-move-article (article group _server accept-function
                                          &optional last move-is-internal)
   (let* ((gnus-command-method (gnus-find-method-for-group group))
         (result (funcall (gnus-get-function gnus-command-method
@@ -807,38 +839,40 @@ If GROUP is nil, all groups on GNUS-COMMAND-METHOD are 
scanned."
       (gnus-agent-unfetch-articles group (list article)))
     result))
 
-(defun gnus-request-accept-article (group &optional gnus-command-method last
+(defun gnus-request-accept-article (group &optional command-method last
                                          no-encode)
-  (when (stringp gnus-command-method)
-    (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
-  (when (and (not gnus-command-method)
-            (stringp group))
-    (setq gnus-command-method (or (gnus-find-method-for-group group)
-                                  (gnus-group-name-to-method group))))
-  (goto-char (point-max))
-  ;; Make sure there's a newline at the end of the article.
-  (unless (bolp)
-    (insert "\n"))
-  (unless no-encode
-    (let ((message-options message-options))
-      (message-options-set-recipient)
-      (save-restriction
-       (message-narrow-to-head)
-       (mail-encode-encoded-word-buffer))
-      (message-encode-message-body)))
-  (let ((gnus-command-method (or gnus-command-method
-                                (gnus-find-method-for-group group)))
-       (result
-        (funcall
-         (gnus-get-function gnus-command-method 'request-accept-article)
-         (if (stringp group) (gnus-group-real-name group) group)
-         (cadr gnus-command-method)
-         last)))
-    (when (and gnus-agent
-              (gnus-agent-method-p gnus-command-method)
-              (cdr result))
-      (gnus-agent-regenerate-group group (list (cdr result))))
-    result))
+  (let ((gnus-command-method
+         (if (stringp command-method)
+             (gnus-server-to-method command-method)
+           command-method)))
+    (when (and (not gnus-command-method)
+              (stringp group))
+      (setq gnus-command-method (or (gnus-find-method-for-group group)
+                                    (gnus-group-name-to-method group))))
+    (goto-char (point-max))
+    ;; Make sure there's a newline at the end of the article.
+    (unless (bolp)
+      (insert "\n"))
+    (unless no-encode
+      (let ((message-options message-options))
+        (message-options-set-recipient)
+        (save-restriction
+         (message-narrow-to-head)
+         (mail-encode-encoded-word-buffer))
+       (message-encode-message-body)))
+    (let ((gnus-command-method (or gnus-command-method
+                                  (gnus-find-method-for-group group)))
+         (result
+          (funcall
+           (gnus-get-function gnus-command-method 'request-accept-article)
+           (if (stringp group) (gnus-group-real-name group) group)
+           (cadr gnus-command-method)
+           last)))
+      (when (and gnus-agent
+                (gnus-agent-method-p gnus-command-method)
+                (cdr result))
+       (gnus-agent-regenerate-group group (list (cdr result))))
+      result)))
 
 (defun gnus-request-replace-article (article group buffer &optional no-encode)
   (unless no-encode
@@ -862,13 +896,14 @@ If GROUP is nil, all groups on GNUS-COMMAND-METHOD are 
scanned."
             article (gnus-group-real-name group)
             (nth 1 gnus-command-method))))
 
-(defun gnus-request-create-group (group &optional gnus-command-method args)
-  (when (stringp gnus-command-method)
-    (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
-  (let ((gnus-command-method
-        (or gnus-command-method (gnus-find-method-for-group group))))
+(defun gnus-request-create-group (group &optional command-method args)
+  (let* ((gnus-command-method
+          (or (if (stringp command-method)
+                  (gnus-server-to-method command-method)
+                command-method)
+              (gnus-find-method-for-group group))))
     (funcall (gnus-get-function gnus-command-method 'request-create-group)
-            (gnus-group-real-name group) (nth 1 gnus-command-method) args)))
+             (gnus-group-real-name group) (nth 1 gnus-command-method) args)))
 
 (defun gnus-request-delete-group (group &optional force)
   (let* ((gnus-command-method (gnus-find-method-for-group group))
@@ -902,15 +937,18 @@ If GROUP is nil, all groups on GNUS-COMMAND-METHOD are 
scanned."
                                         "-request-close"))))
        (funcall func)))))
 
-(defun gnus-asynchronous-p (gnus-command-method)
-  (let ((func (gnus-get-function gnus-command-method 'asynchronous-p t)))
+(defun gnus-asynchronous-p (command-method)
+  (let ((func (gnus-get-function command-method 'asynchronous-p t)))
     (when (fboundp func)
-      (funcall func))))
-
-(defun gnus-remove-denial (gnus-command-method)
-  (when (stringp gnus-command-method)
-    (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
-  (let* ((elem (assoc gnus-command-method gnus-opened-servers))
+      (let ((gnus-command-method command-method))
+        (funcall func)))))
+
+(defun gnus-remove-denial (command-method)
+  (let* ((gnus-command-method
+         (if (stringp command-method)
+             (gnus-server-to-method command-method)
+           command-method))
+         (elem (assoc gnus-command-method gnus-opened-servers))
         (status (cadr elem)))
     ;; If this hasn't been opened before, we add it to the list.
     (when (eq status 'denied)
diff --git a/lisp/gnus/gnus-kill.el b/lisp/gnus/gnus-kill.el
index 20ea983..b0e6cb5 100644
--- a/lisp/gnus/gnus-kill.el
+++ b/lisp/gnus/gnus-kill.el
@@ -1,4 +1,4 @@
-;;; gnus-kill.el --- kill commands for Gnus
+;;; gnus-kill.el --- kill commands for Gnus  -*- lexical-binding: t; -*-
 
 ;; Copyright (C) 1995-2021 Free Software Foundation, Inc.
 
@@ -275,7 +275,7 @@ If NEWSGROUP is nil, the global kill file is selected."
     (save-excursion
       (save-window-excursion
        (pop-to-buffer gnus-summary-buffer)
-       (eval (car (read-from-string string)))))))
+       (eval (car (read-from-string string)) t)))))
 
 (defun gnus-kill-file-apply-last-sexp ()
   "Apply sexp before point in current buffer to current newsgroup."
@@ -289,7 +289,7 @@ If NEWSGROUP is nil, the global kill file is selected."
        (save-excursion
          (save-window-excursion
            (pop-to-buffer gnus-summary-buffer)
-           (eval (car (read-from-string string))))))
+           (eval (car (read-from-string string)) t))))
     (ding) (gnus-message 2 "No newsgroup is selected.")))
 
 (defun gnus-kill-file-exit ()
@@ -403,9 +403,9 @@ Returns the number of articles marked as read."
              (eq (car form) 'gnus-lower))
          (progn
            (delete-region beg (point))
-           (insert (or (eval form) "")))
+           (insert (or (eval form t) "")))
        (with-current-buffer gnus-summary-buffer
-         (ignore-errors (eval form)))))
+         (ignore-errors (eval form t)))))
     (and (buffer-modified-p)
         gnus-kill-save-kill-file
         (save-buffer))
@@ -560,7 +560,7 @@ COMMAND must be a Lisp expression or a string representing 
a key sequence."
                         ((functionp form)
                          (funcall form))
                         (t
-                         (eval form)))))
+                         (eval form t)))))
          ;; Search article body.
          (let ((gnus-current-article nil) ;Save article pointer.
                (gnus-last-article nil)
@@ -578,7 +578,7 @@ COMMAND must be a Lisp expression or a string representing 
a key sequence."
                    ((functionp form)
                     (funcall form))
                    (t
-                    (eval form)))))))
+                    (eval form t)))))))
       did-kill)))
 
 (defun gnus-execute (field regexp form &optional backward unread)
@@ -606,12 +606,10 @@ marked as read or ticked are ignored."
                                             (downcase (symbol-name header)))
                                           gnus-extra-headers)))
                 (setq function
-                      `(lambda (h)
-                         (gnus-extra-header
-                          (quote ,(nth (- (length gnus-extra-headers)
-                                          (length extras))
-                                       gnus-extra-headers))
-                          h)))))))
+                      (let ((type (nth (- (length gnus-extra-headers)
+                                          (length extras))
+                                       gnus-extra-headers)))
+                        (lambda (h) (gnus-extra-header type h))))))))
        ;; Signal error.
        (t
        (error "Unknown header field: \"%s\"" field)))
diff --git a/lisp/gnus/gnus-logic.el b/lisp/gnus/gnus-logic.el
index 105222d..cdfdc9b 100644
--- a/lisp/gnus/gnus-logic.el
+++ b/lisp/gnus/gnus-logic.el
@@ -1,4 +1,4 @@
-;;; gnus-logic.el --- advanced scoring code for Gnus
+;;; gnus-logic.el --- advanced scoring code for Gnus  -*- lexical-binding: t; 
-*-
 
 ;; Copyright (C) 1996-2021 Free Software Foundation, Inc.
 
diff --git a/lisp/gnus/gnus-mh.el b/lisp/gnus/gnus-mh.el
index b26b736..fc8d9be 100644
--- a/lisp/gnus/gnus-mh.el
+++ b/lisp/gnus/gnus-mh.el
@@ -1,4 +1,4 @@
-;;; gnus-mh.el --- mh-e interface for Gnus
+;;; gnus-mh.el --- mh-e interface for Gnus  -*- lexical-binding: t; -*-
 
 ;; Copyright (C) 1994-2021 Free Software Foundation, Inc.
 
@@ -95,7 +95,7 @@ Optional argument FOLDER specifies folder name."
          (kill-buffer errbuf))))
     (setq gnus-newsgroup-last-folder folder)))
 
-(defun gnus-Folder-save-name (newsgroup headers &optional last-folder)
+(defun gnus-Folder-save-name (newsgroup _headers &optional last-folder)
   "Generate folder name from NEWSGROUP, HEADERS, and optional LAST-FOLDER.
 If variable `gnus-use-long-file-name' is nil, it is +News.group.
 Otherwise, it is like +news/group."
@@ -105,7 +105,7 @@ Otherwise, it is like +news/group."
                  (gnus-capitalize-newsgroup newsgroup)
                (gnus-newsgroup-directory-form newsgroup)))))
 
-(defun gnus-folder-save-name (newsgroup headers &optional last-folder)
+(defun gnus-folder-save-name (newsgroup _headers &optional last-folder)
   "Generate folder name from NEWSGROUP, HEADERS, and optional LAST-FOLDER.
 If variable `gnus-use-long-file-name' is nil, it is +news.group.
 Otherwise, it is like +news/group."
diff --git a/lisp/gnus/gnus-ml.el b/lisp/gnus/gnus-ml.el
index a47c155..3b2b5a0 100644
--- a/lisp/gnus/gnus-ml.el
+++ b/lisp/gnus/gnus-ml.el
@@ -1,4 +1,4 @@
-;;; gnus-ml.el --- Mailing list minor mode for Gnus
+;;; gnus-ml.el --- Mailing list minor mode for Gnus  -*- lexical-binding: t; 
-*-
 
 ;; Copyright (C) 2000-2021 Free Software Foundation, Inc.
 
diff --git a/lisp/gnus/gnus-mlspl.el b/lisp/gnus/gnus-mlspl.el
index 77816d2..d42f097 100644
--- a/lisp/gnus/gnus-mlspl.el
+++ b/lisp/gnus/gnus-mlspl.el
@@ -1,4 +1,4 @@
-;;; gnus-mlspl.el --- a group params-based mail splitting mechanism
+;;; gnus-mlspl.el --- a group params-based mail splitting mechanism  -*- 
lexical-binding: t; -*-
 
 ;; Copyright (C) 1998-2021 Free Software Foundation, Inc.
 
diff --git a/lisp/gnus/gnus-msg.el b/lisp/gnus/gnus-msg.el
index 9ca82f8..f76c3f7 100644
--- a/lisp/gnus/gnus-msg.el
+++ b/lisp/gnus/gnus-msg.el
@@ -1,4 +1,4 @@
-;;; gnus-msg.el --- mail and post interface for Gnus
+;;; gnus-msg.el --- mail and post interface for Gnus  -*- lexical-binding: t; 
-*-
 
 ;; Copyright (C) 1995-2021 Free Software Foundation, Inc.
 
@@ -389,9 +389,10 @@ only affect the Gcc copy, but not the original message."
 ;;; Internal functions.
 
 (defun gnus-inews-make-draft (articles)
-  `(lambda ()
-     (gnus-inews-make-draft-meta-information
-      ,gnus-newsgroup-name ',articles)))
+  (let ((gn gnus-newsgroup-name))
+    (lambda ()
+      (gnus-inews-make-draft-meta-information
+       gn articles))))
 
 (autoload 'nnselect-article-number "nnselect" nil nil 'macro)
 (autoload 'nnselect-article-group "nnselect" nil nil 'macro)
@@ -517,7 +518,7 @@ instead."
                       switch-action yank-action send-actions return-action))
     (let ((buf (current-buffer))
          ;; Don't use posting styles corresponding to any existing group.
-         (group-name gnus-newsgroup-name)
+         ;; (group-name gnus-newsgroup-name)
          mail-buf)
       (let ((gnus-newsgroup-name ""))
        (gnus-setup-message
@@ -578,8 +579,8 @@ instead."
   (when gnus-agent
     (add-hook 'message-header-hook #'gnus-agent-possibly-save-gcc nil t))
   (setq message-post-method
-       `(lambda (&optional arg)
-          (gnus-post-method arg ,gnus-newsgroup-name)))
+       (let ((gn gnus-newsgroup-name))
+         (lambda (&optional arg) (gnus-post-method arg gn))))
   (message-add-action
    `(progn
       (setq gnus-current-window-configuration ',winconf-name)
@@ -610,19 +611,19 @@ If ARG is 1, prompt for a group name to find the posting 
style."
   (interactive "P")
   ;; We can't `let' gnus-newsgroup-name here, since that leads
   ;; to local variables leaking.
-  (let ((group gnus-newsgroup-name)
-       ;; make sure last viewed article doesn't affect posting styles:
-       (gnus-article-copy)
-       (buffer (current-buffer)))
-    (let ((gnus-newsgroup-name
-          (if arg
-              (if (= 1 (prefix-numeric-value arg))
-                  (gnus-group-completing-read
-                   "Use posting style of group"
-                   nil (gnus-read-active-file-p))
-                (gnus-group-group-name))
-            "")))
-      (gnus-setup-message 'message (message-mail)))))
+  (let* (;;(group gnus-newsgroup-name)
+        ;; make sure last viewed article doesn't affect posting styles:
+        (gnus-article-copy)
+        ;; (buffer (current-buffer))
+        (gnus-newsgroup-name
+         (if arg
+             (if (= 1 (prefix-numeric-value arg))
+                 (gnus-group-completing-read
+                  "Use posting style of group"
+                  nil (gnus-read-active-file-p))
+               (gnus-group-group-name))
+           "")))
+    (gnus-setup-message 'message (message-mail))))
 
 (defun gnus-group-news (&optional arg)
   "Start composing a news.
@@ -635,21 +636,21 @@ network.  The corresponding back end must have a 
`request-post' method."
   (interactive "P")
   ;; We can't `let' gnus-newsgroup-name here, since that leads
   ;; to local variables leaking.
-  (let ((group gnus-newsgroup-name)
-       ;; make sure last viewed article doesn't affect posting styles:
-       (gnus-article-copy)
-       (buffer (current-buffer)))
-    (let ((gnus-newsgroup-name
-          (if arg
-              (if (= 1 (prefix-numeric-value arg))
-                  (gnus-group-completing-read "Use group"
-                                              nil
-                                              (gnus-read-active-file-p))
-                (gnus-group-group-name))
-            "")))
-      (gnus-setup-message
-       'message
-       (message-news (gnus-group-real-name gnus-newsgroup-name))))))
+  (let* (;;(group gnus-newsgroup-name)
+        ;; make sure last viewed article doesn't affect posting styles:
+        (gnus-article-copy)
+        ;; (buffer (current-buffer))
+        (gnus-newsgroup-name
+         (if arg
+             (if (= 1 (prefix-numeric-value arg))
+                 (gnus-group-completing-read "Use group"
+                                             nil
+                                             (gnus-read-active-file-p))
+               (gnus-group-group-name))
+           "")))
+    (gnus-setup-message
+     'message
+     (message-news (gnus-group-real-name gnus-newsgroup-name)))))
 
 (defun gnus-group-post-news (&optional arg)
   "Start composing a message (a news by default).
@@ -678,19 +679,19 @@ posting style."
   (interactive "P")
   ;; We can't `let' gnus-newsgroup-name here, since that leads
   ;; to local variables leaking.
-  (let ((group gnus-newsgroup-name)
-       ;; make sure last viewed article doesn't affect posting styles:
-       (gnus-article-copy)
-       (buffer (current-buffer)))
-    (let ((gnus-newsgroup-name
-          (if arg
-              (if (= 1 (prefix-numeric-value arg))
-                  (gnus-group-completing-read "Use group"
-                                              nil
-                                              (gnus-read-active-file-p))
-                "")
-            gnus-newsgroup-name)))
-      (gnus-setup-message 'message (message-mail)))))
+  (let* (;;(group gnus-newsgroup-name)
+        ;; make sure last viewed article doesn't affect posting styles:
+        (gnus-article-copy)
+        ;; (buffer (current-buffer))
+        (gnus-newsgroup-name
+         (if arg
+             (if (= 1 (prefix-numeric-value arg))
+                 (gnus-group-completing-read "Use group"
+                                             nil
+                                             (gnus-read-active-file-p))
+               "")
+           gnus-newsgroup-name)))
+    (gnus-setup-message 'message (message-mail))))
 
 (defun gnus-summary-news-other-window (&optional arg)
   "Start composing a news in another window.
@@ -703,26 +704,27 @@ network.  The corresponding back end must have a 
`request-post' method."
   (interactive "P")
   ;; We can't `let' gnus-newsgroup-name here, since that leads
   ;; to local variables leaking.
-  (let ((group gnus-newsgroup-name)
-       ;; make sure last viewed article doesn't affect posting styles:
-       (gnus-article-copy)
-       (buffer (current-buffer)))
-    (let ((gnus-newsgroup-name
-          (if arg
-              (if (= 1 (prefix-numeric-value arg))
-                  (gnus-group-completing-read "Use group"
-                                              nil
-                                              (gnus-read-active-file-p))
-                "")
-            gnus-newsgroup-name)))
-      (gnus-setup-message
-       'message
-       (progn
-        (message-news (gnus-group-real-name gnus-newsgroup-name))
-        (setq-local gnus-discouraged-post-methods
-                    (remove
-                     (car (gnus-find-method-for-group gnus-newsgroup-name))
-                     gnus-discouraged-post-methods)))))))
+  (let* (;;(group gnus-newsgroup-name)
+        ;; make sure last viewed article doesn't affect posting styles:
+        (gnus-article-copy)
+        ;; (buffer (current-buffer))
+        (gnus-newsgroup-name
+         (if arg
+             (if (= 1 (prefix-numeric-value arg))
+                 (gnus-group-completing-read "Use group"
+                                             nil
+                                             (gnus-read-active-file-p))
+               "")
+           gnus-newsgroup-name)))
+    (gnus-setup-message
+     'message
+     (progn
+       (message-news (gnus-group-real-name gnus-newsgroup-name))
+       (setq-local gnus-discouraged-post-methods
+                  (remove
+                   (car (gnus-find-method-for-group
+                         gnus-newsgroup-name))
+                   gnus-discouraged-post-methods))))))
 
 (defun gnus-summary-post-news (&optional arg)
   "Start composing a message.  Post to the current group by default.
@@ -820,8 +822,8 @@ prefix `a', cancel using the standard posting method; if not
 post using the current select method."
   (interactive (gnus-interactive "P\ny"))
   (let ((message-post-method
-        `(lambda (arg)
-           (gnus-post-method (eq ',symp 'a) ,gnus-newsgroup-name)))
+        (let ((gn gnus-newsgroup-name))
+          (lambda (_arg) (gnus-post-method (eq symp 'a) gn))))
        (custom-address user-mail-address))
     (dolist (article (gnus-summary-work-articles n))
       (when (gnus-summary-select-article t nil nil article)
@@ -856,11 +858,12 @@ header line with the old Message-ID."
       (set-buffer gnus-original-article-buffer)
       (message-supersede)
       (push
-       `((lambda ()
-           (when (gnus-buffer-live-p ,gnus-summary-buffer)
-            (with-current-buffer ,gnus-summary-buffer
-              (gnus-cache-possibly-remove-article ,article nil nil nil t)
-              (gnus-summary-mark-as-read ,article gnus-canceled-mark)))))
+       (let ((buf gnus-summary-buffer))
+         (lambda ()
+           (when (gnus-buffer-live-p buf)
+            (with-current-buffer buf
+              (gnus-cache-possibly-remove-article article nil nil nil t)
+              (gnus-summary-mark-as-read article gnus-canceled-mark)))))
        message-send-actions)
       ;; Add Gcc header.
       (gnus-inews-insert-gcc))))
@@ -930,7 +933,7 @@ header line with the old Message-ID."
              (run-hooks 'gnus-article-decode-hook)))))
       gnus-article-copy)))
 
-(defun gnus-post-news (post &optional group header article-buffer yank subject
+(defun gnus-post-news (post &optional group header article-buffer yank _subject
                            force-news)
   (when article-buffer
     (gnus-copy-article-buffer))
@@ -1387,11 +1390,12 @@ the message before resending."
     (add-hook 'message-header-setup-hook
              #'gnus-summary-resend-message-insert-gcc t)
     (add-hook 'message-sent-hook
-             `(lambda ()
-                (let ((rfc2047-encode-encoded-words nil))
-                  ,(if gnus-agent
-                       '(gnus-agent-possibly-do-gcc)
-                     '(gnus-inews-do-gcc)))))
+             (let ((agent gnus-agent))
+               (lambda ()
+                 (let ((rfc2047-encode-encoded-words nil))
+                   (if agent
+                       (gnus-agent-possibly-do-gcc)
+                     (gnus-inews-do-gcc))))))
     (dolist (article (gnus-summary-work-articles n))
       (if no-select
          (with-current-buffer " *nntpd*"
@@ -1732,7 +1736,7 @@ this is a reply."
                                 ;; Function.
                                 (funcall (car var) group))
                                (t
-                                (eval (car var)))))))
+                                (eval (car var) t))))))
              (setq var (cdr var)))
            result)))
         name)
@@ -1789,7 +1793,7 @@ this is a reply."
                      (with-current-buffer gnus-summary-buffer
                        gnus-posting-styles)
                    gnus-posting-styles))
-         style match attribute value v results matched-string
+         match value v results matched-string ;; style attribute
          filep name address element)
       ;; If the group has a posting-style parameter, add it at the end with a
       ;; regexp matching everything, to be sure it takes precedence over all
@@ -1844,7 +1848,7 @@ this is a reply."
                                  (setq matched-string header)))))))
                 (t
                  ;; This is a form to be evalled.
-                 (eval match)))))
+                 (eval match t)))))
          ;; We have a match, so we set the variables.
          (dolist (attribute style)
            (setq element (pop attribute)
@@ -1875,7 +1879,7 @@ this is a reply."
                          ((boundp value)
                           (symbol-value value))))
                   ((listp value)
-                   (eval value))))
+                   (eval value t))))
            ;; Translate obsolescent value.
            (cond
             ((eq element 'signature-file)
@@ -1916,47 +1920,49 @@ this is a reply."
                   ((eq 'eval (car result))
                    #'ignore)
                   ((eq 'body (car result))
-                   `(lambda ()
-                      (save-excursion
-                        (message-goto-body)
-                        (insert ,(cdr result)))))
+                   (let ((txt (cdr result)))
+                     (lambda ()
+                       (save-excursion
+                         (message-goto-body)
+                         (insert txt)))))
                   ((eq 'signature (car result))
                     (setq-local message-signature nil)
                     (setq-local message-signature-file nil)
-                   (if (not (cdr result))
-                       #'ignore
-                     `(lambda ()
-                        (save-excursion
-                          (let ((message-signature ,(cdr result)))
-                            (when message-signature
-                              (message-insert-signature)))))))
+                   (let ((txt (cdr result)))
+                     (if (not txt)
+                         #'ignore
+                       (lambda ()
+                         (save-excursion
+                           (let ((message-signature txt))
+                             (when message-signature
+                               (message-insert-signature))))))))
                   (t
                    (let ((header
                           (if (symbolp (car result))
                               (capitalize (symbol-name (car result)))
-                            (car result))))
-                     `(lambda ()
-                        (save-excursion
-                          (message-remove-header ,header)
-                          (let ((value ,(cdr result)))
-                            (when value
-                              (message-goto-eoh)
-                              (insert ,header ": " value)
-                              (unless (bolp)
-                                (insert "\n")))))))))
+                            (car result)))
+                         (value (cdr result)))
+                     (lambda ()
+                       (save-excursion
+                         (message-remove-header header)
+                         (when value
+                           (message-goto-eoh)
+                           (insert header ": " value)
+                           (unless (bolp)
+                             (insert "\n"))))))))
                  nil 'local))
       (when (or name address)
        (add-hook 'message-setup-hook
-                 `(lambda ()
-                     (setq-local user-mail-address
-                                 ,(or (cdr address) user-mail-address))
-                    (let ((user-full-name ,(or (cdr name) (user-full-name)))
-                          (user-mail-address
-                           ,(or (cdr address) user-mail-address)))
-                      (save-excursion
-                        (message-remove-header "From")
-                        (message-goto-eoh)
-                        (insert "From: " (message-make-from) "\n"))))
+                 (let ((name (or (cdr name) (user-full-name)))
+                       (email (or (cdr address) user-mail-address)))
+                   (lambda ()
+                      (setq-local user-mail-address email)
+                     (let ((user-full-name name)
+                           (user-mail-address email))
+                       (save-excursion
+                         (message-remove-header "From")
+                         (message-goto-eoh)
+                         (insert "From: " (message-make-from) "\n")))))
                  nil 'local)))))
 
 (defun gnus-summary-attach-article (n)
diff --git a/lisp/gnus/gnus-notifications.el b/lisp/gnus/gnus-notifications.el
index 39ef51b..a4d198b 100644
--- a/lisp/gnus/gnus-notifications.el
+++ b/lisp/gnus/gnus-notifications.el
@@ -1,4 +1,4 @@
-;; gnus-notifications.el -- Send notification on new message in Gnus
+;; gnus-notifications.el -- Send notification on new message in Gnus  -*- 
lexical-binding: t; -*-
 
 ;; Copyright (C) 2012-2021 Free Software Foundation, Inc.
 
@@ -47,26 +47,22 @@
 
 (defcustom gnus-notifications-use-google-contacts t
   "Use Google Contacts to retrieve photo."
-  :type 'boolean
-  :group 'gnus-notifications)
+  :type 'boolean)
 
 (defcustom gnus-notifications-use-gravatar t
   "Use Gravatar to retrieve photo."
-  :type 'boolean
-  :group 'gnus-notifications)
+  :type 'boolean)
 
 (defcustom gnus-notifications-minimum-level 1
   "Minimum group level the message should have to be notified.
 Any message in a group that has a greater value than this will
 not get notifications."
-  :type 'integer
-  :group 'gnus-notifications)
+  :type 'integer)
 
 (defcustom gnus-notifications-timeout nil
   "Timeout used for notifications sent via `notifications-notify'."
   :type '(choice (const :tag "Server default" nil)
-                 (integer :tag "Milliseconds"))
-  :group 'gnus-notifications)
+                 (integer :tag "Milliseconds")))
 
 (defvar gnus-notifications-sent nil
   "Notifications already sent.")
diff --git a/lisp/gnus/gnus-picon.el b/lisp/gnus/gnus-picon.el
index a33316a..8c7594a 100644
--- a/lisp/gnus/gnus-picon.el
+++ b/lisp/gnus/gnus-picon.el
@@ -1,4 +1,4 @@
-;;; gnus-picon.el --- displaying pretty icons in Gnus
+;;; gnus-picon.el --- displaying pretty icons in Gnus  -*- lexical-binding: t; 
-*-
 
 ;; Copyright (C) 1996-2021 Free Software Foundation, Inc.
 
@@ -112,7 +112,7 @@ List of pairs (KEY . GLYPH) where KEY is either a filename 
or an URL.")
   (let* ((address (gnus-picon-split-address address))
         (user (pop address))
         (faddress address)
-        database directory result instance base)
+        result base) ;; instance
     (catch 'found
       (dolist (database gnus-picon-databases)
        (dolist (directory directories)
@@ -249,7 +249,7 @@ replacement is added."
    (gnus-article-goto-header header)
    (mail-header-narrow-to-field)
    (let ((groups (message-tokenize-header (mail-fetch-field header)))
-        spec file point)
+        spec file) ;; point
      (dolist (group groups)
        (unless (setq spec (cdr (assoc group gnus-picon-cache)))
         (setq spec (nreverse (split-string group "[.]")))
diff --git a/lisp/gnus/gnus-range.el b/lisp/gnus/gnus-range.el
index 1e5d2a06..6cc60cb 100644
--- a/lisp/gnus/gnus-range.el
+++ b/lisp/gnus/gnus-range.el
@@ -1,4 +1,4 @@
-;;; gnus-range.el --- range and sequence functions for Gnus
+;;; gnus-range.el --- range and sequence functions for Gnus  -*- 
lexical-binding: t; -*-
 
 ;; Copyright (C) 1996-2021 Free Software Foundation, Inc.
 
@@ -87,7 +87,7 @@ Both ranges must be in ascending order."
   (setq range2 (gnus-range-normalize range2))
   (let* ((new-range (cons nil (copy-sequence range1)))
          (r new-range)
-         (safe t))
+         ) ;; (safe t)
     (while (cdr r)
       (let* ((r1 (cadr r))
              (r2 (car range2))
diff --git a/lisp/gnus/gnus-registry.el b/lisp/gnus/gnus-registry.el
index 7fdf668..147550d 100644
--- a/lisp/gnus/gnus-registry.el
+++ b/lisp/gnus/gnus-registry.el
@@ -131,7 +131,6 @@ display.")
 
 (defcustom gnus-registry-default-mark 'To-Do
   "The default mark.  Should be a valid key for `gnus-registry-marks'."
-  :group 'gnus-registry
   :type 'symbol)
 
 (defcustom gnus-registry-unfollowed-addresses
@@ -141,7 +140,6 @@ The addresses are matched, they don't have to be fully 
qualified.
 In the messages, these addresses can be the sender or the
 recipients."
   :version "24.1"
-  :group 'gnus-registry
   :type '(repeat regexp))
 
 (defcustom gnus-registry-unfollowed-groups
@@ -153,12 +151,10 @@ message into a group that matches one of these, 
regardless of
 references.'
 
 nnmairix groups are specifically excluded because they are ephemeral."
-  :group 'gnus-registry
   :type '(repeat regexp))
 
 (defcustom gnus-registry-install 'ask
   "Whether the registry should be installed."
-  :group 'gnus-registry
   :type '(choice (const :tag "Never Install" nil)
                  (const :tag "Always Install" t)
                  (const :tag "Ask Me" ask)))
@@ -181,7 +177,6 @@ nnmairix groups are specifically excluded because they are 
ephemeral."
   "Whether the registry should track extra data about a message.
 The subject, recipients (To: and Cc:), and Sender (From:) headers
 are tracked this way by default."
-  :group 'gnus-registry
   :type
   '(set :tag "Tracking choices"
     (const :tag "Track by subject (Subject: header)" subject)
@@ -205,7 +200,6 @@ This is the slowest strategy but also the most accurate one.
 When `first', the first element of G wins.  This is fast and
 should be OK if your senders and subjects don't \"bleed\" across
 groups."
-  :group 'gnus-registry
   :type
   '(choice :tag "Splitting strategy"
            (const :tag "Only use single choices, discard multiple matches" nil)
@@ -214,7 +208,6 @@ groups."
 
 (defcustom gnus-registry-minimum-subject-length 5
   "The minimum length of a subject before it's considered trackable."
-  :group 'gnus-registry
   :type 'integer)
 
 (defcustom gnus-registry-extra-entries-precious '(mark)
@@ -225,20 +218,18 @@ considered precious.
 Before you save the Gnus registry, it's pruned.  Any entries with
 keys in this list will not be pruned.  All other entries go to
 the Bit Bucket."
-  :group 'gnus-registry
   :type '(repeat symbol))
 
 (defcustom gnus-registry-cache-file
+  ;; FIXME: Use `locate-user-emacs-file'!
   (nnheader-concat
    (or gnus-dribble-directory gnus-home-directory "~/")
    ".gnus.registry.eieio")
   "File where the Gnus registry will be stored."
-  :group 'gnus-registry
   :type 'file)
 
 (defcustom gnus-registry-max-entries nil
   "Maximum number of entries in the registry, nil for unlimited."
-  :group 'gnus-registry
   :type '(radio (const :format "Unlimited " nil)
                 (integer :format "Maximum number: %v")))
 
@@ -253,7 +244,6 @@ cut the registry back to \(- 50000 \(* 50000 0.1)) -> 45000
 entries.  The pruning process is constrained by the presence of
 \"precious\" entries."
   :version "25.1"
-  :group 'gnus-registry
   :type 'float)
 
 (defcustom gnus-registry-default-sort-function
@@ -262,7 +252,6 @@ entries.  The pruning process is constrained by the 
presence of
 Entries that sort to the front of the list are pruned first.
 This can slow pruning down.  Set to nil to perform no sorting."
   :version "25.1"
-  :group 'gnus-registry
   :type '(choice (const :tag "No sorting" nil) function))
 
 (defun gnus-registry-sort-by-creation-time (l r)
diff --git a/lisp/gnus/gnus-rfc1843.el b/lisp/gnus/gnus-rfc1843.el
index dca55af..5697c87 100644
--- a/lisp/gnus/gnus-rfc1843.el
+++ b/lisp/gnus/gnus-rfc1843.el
@@ -1,4 +1,4 @@
-;;; gnus-rfc1843.el --- HZ (rfc1843) decoding interface functions for Gnus
+;;; gnus-rfc1843.el --- HZ (rfc1843) decoding interface functions for Gnus  
-*- lexical-binding: t; -*-
 
 ;; Copyright (C) 1998-2021 Free Software Foundation, Inc.
 
diff --git a/lisp/gnus/gnus-salt.el b/lisp/gnus/gnus-salt.el
index d07d36e..e222d24 100644
--- a/lisp/gnus/gnus-salt.el
+++ b/lisp/gnus/gnus-salt.el
@@ -1,4 +1,4 @@
-;;; gnus-salt.el --- alternate summary mode interfaces for Gnus
+;;; gnus-salt.el --- alternate summary mode interfaces for Gnus  -*- 
lexical-binding: t; -*-
 
 ;; Copyright (C) 1996-1999, 2001-2021 Free Software Foundation, Inc.
 
@@ -609,7 +609,7 @@ Two predefined functions are available:
         beg end)
     (add-text-properties
      (setq beg (point))
-     (setq end (progn (eval gnus-tree-line-format-spec) (point)))
+     (setq end (progn (eval gnus-tree-line-format-spec t) (point)))
      (list 'gnus-number gnus-tmp-number))
     (when (or t (gnus-visual-p 'tree-highlight 'highlight))
       (gnus-tree-highlight-node gnus-tmp-number beg end))))
diff --git a/lisp/gnus/gnus-score.el b/lisp/gnus/gnus-score.el
index c6e08ce..ade0897 100644
--- a/lisp/gnus/gnus-score.el
+++ b/lisp/gnus/gnus-score.el
@@ -1,4 +1,4 @@
-;;; gnus-score.el --- scoring code for Gnus
+;;; gnus-score.el --- scoring code for Gnus  -*- lexical-binding: t; -*-
 
 ;; Copyright (C) 1995-2021 Free Software Foundation, Inc.
 
@@ -1235,7 +1235,7 @@ If FORMAT, also format the current score file."
     (let ((mark (car (gnus-score-get 'mark alist)))
          (expunge (car (gnus-score-get 'expunge alist)))
          (mark-and-expunge (car (gnus-score-get 'mark-and-expunge alist)))
-         (score-fn (car (gnus-score-get 'score-fn alist)))
+         ;; (score-fn (car (gnus-score-get 'score-fn alist)))
          (files (gnus-score-get 'files alist))
          (exclude-files (gnus-score-get 'exclude-files alist))
          (orphan (car (gnus-score-get 'orphan alist)))
@@ -1263,7 +1263,7 @@ If FORMAT, also format the current score file."
                                   (if adapt-file (cons adapt-file files)
                                     files)))))
       (when (and eval (not global))
-       (eval eval))
+       (eval eval t))
       ;; We then expand any exclude-file directives.
       (setq gnus-scores-exclude-files
            (nconc
@@ -1818,45 +1818,44 @@ score in `gnus-newsgroup-scored' by SCORE."
        handles))))
 
 (defun gnus-score-body (scores header now expire &optional trace)
-    (if gnus-agent-fetching
-       nil
-     (save-excursion
-       (setq gnus-scores-articles
-             (sort gnus-scores-articles
-                   (lambda (a1 a2)
-                     (< (mail-header-number (car a1))
-                        (mail-header-number (car a2))))))
-       (set-buffer nntp-server-buffer)
-       (save-restriction
-         (let* ((buffer-read-only nil)
-                (articles gnus-scores-articles)
-                (all-scores scores)
-                (request-func (cond ((string= "head" header)
-                                     'gnus-request-head)
-                                    ((string= "body" header)
-                                     'gnus-request-body)
-                                    (t 'gnus-request-article)))
-                entries alist ofunc article last)
-           (when articles
-             (setq last (mail-header-number (caar (last articles))))
-             ;; Not all backends support partial fetching.  In that case,
-             ;; we just fetch the entire article.
-             ;; When scoring by body, we need to peek at the headers to detect
-             ;; the content encoding
-             (unless (or (gnus-check-backend-function
-                          (and (string-match "^gnus-" (symbol-name 
request-func))
-                               (intern (substring (symbol-name request-func)
-                                                  (match-end 0))))
-                          gnus-newsgroup-name)
-                         (string= "body" header))
-               (setq ofunc request-func)
-               (setq request-func 'gnus-request-article))
-             (while articles
-               (setq article (mail-header-number (caar articles)))
-               (gnus-message 7 "Scoring article %s of %s..." article last)
-               (widen)
-               (let (handles)
-                 (when (funcall request-func article gnus-newsgroup-name)
+  (if gnus-agent-fetching
+      nil
+    (setq gnus-scores-articles
+          (sort gnus-scores-articles
+                (lambda (a1 a2)
+                  (< (mail-header-number (car a1))
+                     (mail-header-number (car a2))))))
+    (with-current-buffer nntp-server-buffer
+      (save-restriction
+        (let* ((buffer-read-only nil)
+               (articles gnus-scores-articles)
+               (all-scores scores)
+               (request-func (cond ((string= "head" header)
+                                    'gnus-request-head)
+                                   ((string= "body" header)
+                                    'gnus-request-body)
+                                   (t 'gnus-request-article)))
+               entries alist ofunc article last)
+          (when articles
+            (setq last (mail-header-number (caar (last articles))))
+            ;; Not all backends support partial fetching.  In that case,
+            ;; we just fetch the entire article.
+            ;; When scoring by body, we need to peek at the headers to detect
+            ;; the content encoding
+            (unless (or (gnus-check-backend-function
+                         (and (string-match "^gnus-" (symbol-name 
request-func))
+                              (intern (substring (symbol-name request-func)
+                                                 (match-end 0))))
+                         gnus-newsgroup-name)
+                        (string= "body" header))
+              (setq ofunc request-func)
+              (setq request-func 'gnus-request-article))
+            (while articles
+              (setq article (mail-header-number (caar articles)))
+              (gnus-message 7 "Scoring article %s of %s..." article last)
+              (widen)
+              (let (handles)
+                (when (funcall request-func article gnus-newsgroup-name)
                   (when (string= "body" header)
                     (setq handles (gnus-score-decode-text-parts)))
                   (goto-char (point-min))
@@ -1921,8 +1920,8 @@ score in `gnus-newsgroup-scored' by SCORE."
                             (setq rest entries))))
                         (setq entries rest))))
                   (when handles (mm-destroy-parts handles))))
-               (setq articles (cdr articles)))))))
-     nil))
+              (setq articles (cdr articles)))))))
+    nil))
 
 (defun gnus-score-thread (scores header now expire &optional trace)
   (gnus-score-followup scores header now expire trace t))
@@ -2699,7 +2698,7 @@ the score file and its full name, including the 
directory.")
 
 ;;; Finding score files.
 
-(defun gnus-score-score-files (group)
+(defun gnus-score-score-files (_group)
   "Return a list of all possible score files."
   ;; Search and set any global score files.
   (when gnus-global-score-files
diff --git a/lisp/gnus/gnus-search.el b/lisp/gnus/gnus-search.el
index 636a0d7..f3e0851 100644
--- a/lisp/gnus/gnus-search.el
+++ b/lisp/gnus/gnus-search.el
@@ -123,8 +123,7 @@ If this option is set to nil, search queries will be passed
 directly to the search engines without being parsed or
 transformed."
   :version "28.1"
-  :type 'boolean
-  :group 'gnus-search)
+  :type 'boolean)
 
 (define-obsolete-variable-alias 'nnir-ignored-newsgroups
   'gnus-search-ignored-newsgroups "28.1")
@@ -133,8 +132,7 @@ transformed."
   "A regexp to match newsgroups in the active file that should
   be skipped when searching."
   :version "24.1"
-  :type 'regexp
-  :group 'gnus-search)
+  :type 'regexp)
 
 (make-obsolete-variable
  'nnir-imap-default-search-key
@@ -146,14 +144,12 @@ transformed."
   (expand-file-name "~/Mail/swish++.conf")
   "Location of Swish++ configuration file.
 This variable can also be set per-server."
-  :type 'file
-  :group 'gnus-search)
+  :type 'file)
 
 (defcustom gnus-search-swish++-program "search"
   "Name of swish++ search executable.
 This variable can also be set per-server."
-  :type 'string
-  :group 'gnus-search)
+  :type 'string)
 
 (defcustom gnus-search-swish++-switches '()
   "A list of strings, to be given as additional arguments to swish++.
@@ -163,8 +159,7 @@ Instead, use this:
     (setq gnus-search-swish++-switches \\='(\"-i\" \"-w\"))
 
 This variable can also be set per-server."
-  :type '(repeat string)
-  :group 'gnus-search)
+  :type '(repeat string))
 
 (defcustom gnus-search-swish++-remove-prefix (concat (getenv "HOME") "/Mail/")
   "The prefix to remove from each file name returned by swish++
@@ -172,30 +167,26 @@ in order to get a group name (albeit with / instead of 
.).  This is a
 regular expression.
 
 This variable can also be set per-server."
-  :type 'regexp
-  :group 'gnus-search)
+  :type 'regexp)
 
 (defcustom gnus-search-swish++-raw-queries-p nil
   "If t, all Swish++ engines will only accept raw search query
   strings."
   :type 'boolean
-  :version "28.1"
-  :group 'gnus-search)
+  :version "28.1")
 
 (defcustom gnus-search-swish-e-config-file
   (expand-file-name "~/Mail/swish-e.conf")
   "Configuration file for swish-e.
 This variable can also be set per-server."
   :type 'file
-  :version "28.1"
-  :group 'gnus-search)
+  :version "28.1")
 
 (defcustom gnus-search-swish-e-program "search"
   "Name of swish-e search executable.
 This variable can also be set per-server."
   :type 'string
-  :version "28.1"
-  :group 'gnus-search)
+  :version "28.1")
 
 (defcustom gnus-search-swish-e-switches '()
   "A list of strings, to be given as additional arguments to swish-e.
@@ -206,8 +197,7 @@ Instead, use this:
 
 This variable can also be set per-server."
   :type '(repeat string)
-  :version "28.1"
-  :group 'gnus-search)
+  :version "28.1")
 
 (defcustom gnus-search-swish-e-remove-prefix (concat (getenv "HOME") "/Mail/")
   "The prefix to remove from each file name returned by swish-e
@@ -216,22 +206,19 @@ regular expression.
 
 This variable can also be set per-server."
   :type 'regexp
-  :version "28.1"
-  :group 'gnus-search)
+  :version "28.1")
 
 (defcustom gnus-search-swish-e-index-files '()
   "A list of index files to use with this Swish-e instance.
 This variable can also be set per-server."
   :type '(repeat file)
-  :version "28.1"
-  :group 'gnus-search)
+  :version "28.1")
 
 (defcustom gnus-search-swish-e-raw-queries-p nil
   "If t, all Swish-e engines will only accept raw search query
   strings."
   :type 'boolean
-  :version "28.1"
-  :group 'gnus-search)
+  :version "28.1")
 
 ;; Namazu engine, see <URL:http://www.namazu.org/>
 
@@ -239,15 +226,13 @@ This variable can also be set per-server."
   "Name of Namazu search executable.
 This variable can also be set per-server."
   :type 'string
-  :version "28.1"
-  :group 'gnus-search)
+  :version "28.1")
 
 (defcustom gnus-search-namazu-index-directory (expand-file-name 
"~/Mail/namazu/")
   "Index directory for Namazu.
 This variable can also be set per-server."
   :type 'directory
-  :version "28.1"
-  :group 'gnus-search)
+  :version "28.1")
 
 (defcustom gnus-search-namazu-switches '()
   "A list of strings, to be given as additional arguments to namazu.
@@ -261,8 +246,7 @@ Instead, use this:
 
 This variable can also be set per-server."
   :type '(repeat string)
-  :version "28.1"
-  :group 'gnus-search)
+  :version "28.1")
 
 (defcustom gnus-search-namazu-remove-prefix (concat (getenv "HOME") "/Mail/")
   "The prefix to remove from each file name returned by Namazu
@@ -277,30 +261,26 @@ arrive at the correct group name, \"mail.misc\".
 
 This variable can also be set per-server."
   :type 'directory
-  :version "28.1"
-  :group 'gnus-search)
+  :version "28.1")
 
 (defcustom gnus-search-namazu-raw-queries-p nil
   "If t, all Namazu engines will only accept raw search query
   strings."
   :type 'boolean
-  :version "28.1"
-  :group 'gnus-search)
+  :version "28.1")
 
 (defcustom gnus-search-notmuch-program "notmuch"
   "Name of notmuch search executable.
 This variable can also be set per-server."
   :type '(string)
-  :version "28.1"
-  :group 'gnus-search)
+  :version "28.1")
 
 (defcustom gnus-search-notmuch-config-file
   (expand-file-name "~/.notmuch-config")
   "Configuration file for notmuch.
 This variable can also be set per-server."
   :type 'file
-  :version "28.1"
-  :group 'gnus-search)
+  :version "28.1")
 
 (defcustom gnus-search-notmuch-switches '()
   "A list of strings, to be given as additional arguments to notmuch.
@@ -311,8 +291,7 @@ Instead, use this:
 
 This variable can also be set per-server."
   :type '(repeat string)
-  :version "28.1"
-  :group 'gnus-search)
+  :version "28.1")
 
 (defcustom gnus-search-notmuch-remove-prefix (concat (getenv "HOME") "/Mail/")
   "The prefix to remove from each file name returned by notmuch
@@ -321,37 +300,32 @@ regular expression.
 
 This variable can also be set per-server."
   :type 'regexp
-  :version "28.1"
-  :group 'gnus-search)
+  :version "28.1")
 
 (defcustom gnus-search-notmuch-raw-queries-p nil
   "If t, all Notmuch engines will only accept raw search query
   strings."
   :type 'boolean
-  :version "28.1"
-  :group 'gnus-search)
+  :version "28.1")
 
 (defcustom gnus-search-imap-raw-queries-p nil
   "If t, all IMAP engines will only accept raw search query
   strings."
   :version "28.1"
-  :type 'boolean
-  :group 'gnus-search)
+  :type 'boolean)
 
 (defcustom gnus-search-mairix-program "mairix"
   "Name of mairix search executable.
 This variable can also be set per-server."
   :version "28.1"
-  :type 'string
-  :group 'gnus-search)
+  :type 'string)
 
 (defcustom gnus-search-mairix-config-file
   (expand-file-name "~/.mairixrc")
   "Configuration file for mairix.
 This variable can also be set per-server."
   :version "28.1"
-  :type 'file
-  :group 'gnus-search)
+  :type 'file)
 
 (defcustom gnus-search-mairix-switches '()
   "A list of strings, to be given as additional arguments to mairix.
@@ -362,8 +336,7 @@ Instead, use this:
 
 This variable can also be set per-server."
   :version "28.1"
-  :type '(repeat string)
-  :group 'gnus-search)
+  :type '(repeat string))
 
 (defcustom gnus-search-mairix-remove-prefix (concat (getenv "HOME") "/Mail/")
   "The prefix to remove from each file name returned by mairix
@@ -372,15 +345,13 @@ regular expression.
 
 This variable can also be set per-server."
   :version "28.1"
-  :type 'regexp
-  :group 'gnus-search)
+  :type 'regexp)
 
 (defcustom gnus-search-mairix-raw-queries-p nil
   "If t, all Mairix engines will only accept raw search query
   strings."
   :version "28.1"
-  :type 'boolean
-  :group 'gnus-search)
+  :type 'boolean)
 
 ;; Options for search language parsing.
 
@@ -396,7 +367,6 @@ typing in search queries, ie \"subject\" could be entered as
 \"subject\" and \"since\".
 
 Ambiguous abbreviations will raise an error."
-  :group 'gnus-search
   :version "28.1"
   :type '(repeat string))
 
@@ -405,7 +375,6 @@ Ambiguous abbreviations will raise an error."
   "A list of keywords whose value should be parsed as a date.
 See the docstring of `gnus-search-parse-query' for information on
 date parsing."
-  :group 'gnus-search
   :version "26.1"
   :type '(repeat string))
 
@@ -414,7 +383,6 @@ date parsing."
 Each list element should be a table or collection suitable to be
 returned by `completion-at-point-functions'.  That usually means
 a list of strings, a hash table, or an alist."
-  :group 'gnus-search
   :version "28.1"
   :type '(repeat sexp))
 
@@ -939,7 +907,6 @@ quirks.")
 (defcustom gnus-search-default-engines '((nnimap . gnus-search-imap))
   "Alist of default search engines keyed by server method."
   :version "26.1"
-  :group 'gnus-search
   :type `(repeat (cons (choice (const nnimap) (const nntp) (const nnspool)
                               (const nneething) (const nndir) (const nnmbox)
                               (const nnml) (const nnmh) (const nndraft)
diff --git a/lisp/gnus/gnus-sieve.el b/lisp/gnus/gnus-sieve.el
index 7046f59..5dcd079 100644
--- a/lisp/gnus/gnus-sieve.el
+++ b/lisp/gnus/gnus-sieve.el
@@ -1,4 +1,4 @@
-;;; gnus-sieve.el --- Utilities to manage sieve scripts for Gnus
+;;; gnus-sieve.el --- Utilities to manage sieve scripts for Gnus  -*- 
lexical-binding: t; -*-
 
 ;; Copyright (C) 2001-2021 Free Software Foundation, Inc.
 
@@ -40,30 +40,25 @@
 
 (defcustom gnus-sieve-file "~/.sieve"
   "Path to your Sieve script."
-  :type 'file
-  :group 'gnus-sieve)
+  :type 'file)
 
 (defcustom gnus-sieve-region-start "\n## Begin Gnus Sieve Script\n"
   "Line indicating the start of the autogenerated region in your Sieve script."
-  :type 'string
-  :group 'gnus-sieve)
+  :type 'string)
 
 (defcustom gnus-sieve-region-end "\n## End Gnus Sieve Script\n"
   "Line indicating the end of the autogenerated region in your Sieve script."
-  :type 'string
-  :group 'gnus-sieve)
+  :type 'string)
 
 (defcustom gnus-sieve-select-method nil
   "Which select method we generate the Sieve script for.
 For example: \"nnimap:mailbox\""
   ;; FIXME? gnus-select-method?
-  :type '(choice (const nil) string)
-  :group 'gnus-sieve)
+  :type '(choice (const nil) string))
 
 (defcustom gnus-sieve-crosspost t
   "Whether the generated Sieve script should do crossposting."
-  :type 'boolean
-  :group 'gnus-sieve)
+  :type 'boolean)
 
 (defcustom gnus-sieve-update-shell-command "echo put %f | sieveshell %s"
   "Shell command to execute after updating your Sieve script.  The following
@@ -71,8 +66,7 @@ formatting characters are recognized:
 
 %f    Script's file name (gnus-sieve-file)
 %s    Server name (from gnus-sieve-select-method)"
-  :type 'string
-  :group 'gnus-sieve)
+  :type 'string)
 
 ;;;###autoload
 (defun gnus-sieve-update ()
diff --git a/lisp/gnus/gnus-spec.el b/lisp/gnus/gnus-spec.el
index a522855..11b5340 100644
--- a/lisp/gnus/gnus-spec.el
+++ b/lisp/gnus/gnus-spec.el
@@ -1,4 +1,4 @@
-;;; gnus-spec.el --- format spec functions for Gnus
+;;; gnus-spec.el --- format spec functions for Gnus  -*- lexical-binding: t; 
-*-
 
 ;; Copyright (C) 1996-2021 Free Software Foundation, Inc.
 
@@ -146,14 +146,14 @@ Return a list of updated types."
     (while (setq type (pop types))
       ;; Jump to the proper buffer to find out the value of the
       ;; variable, if possible.  (It may be buffer-local.)
-      (save-excursion
+      (save-current-buffer
        (let ((buffer (intern (format "gnus-%s-buffer" type))))
          (when (and (boundp buffer)
                     (setq val (symbol-value buffer))
                      (gnus-buffer-live-p val))
-           (set-buffer val))
+           (set-buffer val)))
          (setq new-format (symbol-value
-                           (intern (format "gnus-%s-line-format" type)))))
+                          (intern (format "gnus-%s-line-format" type))))
        (setq entry (cdr (assq type gnus-format-specs)))
        (if (and (car entry)
                 (equal (car entry) new-format))
@@ -170,7 +170,7 @@ Return a list of updated types."
                   new-format
                   (symbol-value
                    (intern (format "gnus-%s-line-format-alist" type)))
-                  (not (string-match "mode$" (symbol-name type))))))
+                  (not (string-match "mode\\'" (symbol-name type))))))
          ;; Enter the new format spec into the list.
          (if entry
              (progn
@@ -526,13 +526,13 @@ or to characters when given a pad value."
        (if (eq spec ?%)
            ;; "%%" just results in a "%".
            (insert "%")
-         (cond
-          ;; Do tilde forms.
-          ((eq spec ?@)
-           (setq elem (list tilde-form ?s)))
-          ;; Treat user defined format specifiers specially.
-          (user-defined
-           (setq elem
+         (setq elem
+                (cond
+                ;; Do tilde forms.
+                ((eq spec ?@)
+                 (list tilde-form ?s))
+                ;; Treat user defined format specifiers specially.
+                (user-defined
                  (list
                   (list (intern (format
                                  (if (stringp user-defined)
@@ -540,14 +540,14 @@ or to characters when given a pad value."
                                    "gnus-user-format-function-%c")
                                  user-defined))
                         'gnus-tmp-header)
-                  ?s)))
-          ;; Find the specification from `spec-alist'.
-          ((setq elem (cdr (assq (or extended-spec spec) spec-alist))))
-          ;; We used to use "%l" for displaying the grouplens score.
-          ((eq spec ?l)
-           (setq elem '("" ?s)))
-          (t
-           (setq elem '("*" ?s))))
+                  ?s))
+                ;; Find the specification from `spec-alist'.
+                ((cdr (assq (or extended-spec spec) spec-alist)))
+                ;; We used to use "%l" for displaying the grouplens score.
+                ((eq spec ?l)
+                  '("" ?s))
+                (t
+                 '("*" ?s))))
          (setq elem-type (cadr elem))
          ;; Insert the new format elements.
          (when pad-width
@@ -628,8 +628,8 @@ or to characters when given a pad value."
 If PROPS, insert the result."
   (let ((form (gnus-parse-format format alist props)))
     (if props
-       (add-text-properties (point) (progn (eval form) (point)) props)
-      (eval form))))
+       (add-text-properties (point) (progn (eval form t) (point)) props)
+      (eval form t))))
 
 (defun gnus-set-format (type &optional insertable)
   (set (intern (format "gnus-%s-line-format-spec" type))
diff --git a/lisp/gnus/gnus-srvr.el b/lisp/gnus/gnus-srvr.el
index deeb288..a305e34 100644
--- a/lisp/gnus/gnus-srvr.el
+++ b/lisp/gnus/gnus-srvr.el
@@ -1,4 +1,4 @@
-;;; gnus-srvr.el --- virtual server support for Gnus
+;;; gnus-srvr.el --- virtual server support for Gnus  -*- lexical-binding: t; 
-*-
 
 ;; Copyright (C) 1995-2021 Free Software Foundation, Inc.
 
@@ -297,7 +297,7 @@ The following commands are available:
      (point)
      (prog1 (1+ (point))
        ;; Insert the text.
-       (eval gnus-server-line-format-spec))
+       (eval gnus-server-line-format-spec t))
      (list 'gnus-server (intern gnus-tmp-name)
            'gnus-named-server (intern (gnus-method-to-server method t))))))
 
@@ -612,10 +612,10 @@ The following commands are available:
     (gnus-close-server info)
     (gnus-edit-form
      info "Editing the server."
-     `(lambda (form)
-       (gnus-server-set-info ,server form)
-       (gnus-server-list-servers)
-       (gnus-server-position-point))
+     (lambda (form)
+       (gnus-server-set-info server form)
+       (gnus-server-list-servers)
+       (gnus-server-position-point))
      'edit-server)))
 
 (defun gnus-server-show-server (server)
@@ -626,7 +626,7 @@ The following commands are available:
   (let ((info (gnus-server-to-method server)))
     (gnus-edit-form
      info "Showing the server."
-     (lambda (form)
+     (lambda (_form)
        (gnus-server-position-point))
      'edit-server)))
 
diff --git a/lisp/gnus/gnus-start.el b/lisp/gnus/gnus-start.el
index cd43876..a599bd7 100644
--- a/lisp/gnus/gnus-start.el
+++ b/lisp/gnus/gnus-start.el
@@ -843,8 +843,7 @@ prompt the user for the name of an NNTP server to use."
 If REGEXP is given, lines that match it will be deleted."
   (when (and (not gnus-dribble-ignore)
              (buffer-live-p gnus-dribble-buffer))
-    (let ((obuf (current-buffer)))
-      (set-buffer gnus-dribble-buffer)
+    (with-current-buffer gnus-dribble-buffer
       (when regexp
        (goto-char (point-min))
        (let (end)
@@ -859,8 +858,7 @@ If REGEXP is given, lines that match it will be deleted."
       (insert (replace-regexp-in-string "\n" "\\\\n" string) "\n")
       (bury-buffer gnus-dribble-buffer)
       (with-current-buffer gnus-group-buffer
-       (gnus-group-set-mode-line))
-      (set-buffer obuf))))
+       (gnus-group-set-mode-line)))))
 
 (defun gnus-dribble-touch ()
   "Touch the dribble buffer."
@@ -916,9 +914,8 @@ If REGEXP is given, lines that match it will be deleted."
 (defun gnus-dribble-eval-file ()
   (when gnus-dribble-eval-file
     (setq gnus-dribble-eval-file nil)
-    (save-excursion
-      (let ((gnus-dribble-ignore t))
-       (set-buffer gnus-dribble-buffer)
+    (let ((gnus-dribble-ignore t))
+      (with-current-buffer gnus-dribble-buffer
        (eval-buffer (current-buffer))))))
 
 (defun gnus-dribble-delete-file ()
@@ -1187,10 +1184,9 @@ for new groups, and subscribe the new groups as zombies."
            gnus-override-subscribe-method method)
       (when (and (gnus-check-server method)
                 (gnus-request-newgroups date method))
-       (save-excursion
-         (setq got-new t
-               hashtb (gnus-make-hashtable 100))
-         (set-buffer nntp-server-buffer)
+        (setq got-new t
+              hashtb (gnus-make-hashtable 100))
+       (with-current-buffer nntp-server-buffer
          ;; Enter all the new groups into a hashtable.
          (gnus-active-to-gnus-format method hashtb 'ignore))
        ;; Now all new groups from `method' are in `hashtb'.
@@ -2250,9 +2246,8 @@ If FORCE is non-nil, the .newsrc file is read."
        ;; can find there for changing the data already read -
        ;; i. e., reading the .newsrc file will not trash the data
        ;; already read (except for read articles).
-       (save-excursion
-         (gnus-message 5 "Reading %s..." newsrc-file)
-         (set-buffer (nnheader-find-file-noselect newsrc-file))
+        (gnus-message 5 "Reading %s..." newsrc-file)
+       (with-current-buffer (nnheader-find-file-noselect newsrc-file)
          (buffer-disable-undo)
          (gnus-newsrc-to-gnus-format)
          (kill-buffer (current-buffer))
@@ -2342,7 +2337,7 @@ If FORCE is non-nil, the .newsrc file is read."
                           gnus-newsrc-file-version gnus-version)))))))
 
 (defun gnus-convert-mark-converter-prompt (converter no-prompt)
-  "Indicate whether CONVERTER requires gnus-convert-old-newsrc to
+  "Indicate whether CONVERTER requires `gnus-convert-old-newsrc' to
   display the conversion prompt.  NO-PROMPT may be nil (prompt),
   t (no prompt), or any form that can be called as a function.
   The form should return either t or nil."
@@ -2994,13 +2989,13 @@ SPECIFIC-VARIABLES, or those in `gnus-variable-list'."
 ;;; Child functions.
 ;;;
 
-(defvar gnus-child-mode nil)
+;; (defvar gnus-child-mode nil)
 
 (defun gnus-child-mode ()
   "Minor mode for child Gnusae."
   ;; FIXME: gnus-child-mode appears to never be set (i.e. it'll always be nil):
   ;; Remove, or fix and use define-minor-mode.
-  (add-minor-mode 'gnus-child-mode " Child" (make-sparse-keymap))
+  ;; (add-minor-mode 'gnus-child-mode " Child" (make-sparse-keymap))
   (gnus-run-hooks 'gnus-child-mode-hook))
 
 (define-obsolete-function-alias 'gnus-slave-mode #'gnus-child-mode "28.1")
@@ -3102,50 +3097,49 @@ SPECIFIC-VARIABLES, or those in `gnus-variable-list'."
       (gnus-message 1 "Couldn't read newsgroups descriptions")
       nil)
      (t
-      (save-excursion
-        ;; FIXME: Shouldn't save-restriction be done after set-buffer?
-       (save-restriction
-         (set-buffer nntp-server-buffer)
-         (goto-char (point-min))
-         (when (or (search-forward "\n.\n" nil t)
-                   (goto-char (point-max)))
-           (beginning-of-line)
-           (narrow-to-region (point-min) (point)))
-         ;; If these are groups from a foreign select method, we insert the
-         ;; group prefix in front of the group names.
-         (and method (not (inline
-                            (gnus-server-equal
-                             (gnus-server-get-method nil method)
-                             (gnus-server-get-method
-                              nil gnus-select-method))))
-              (let ((prefix (gnus-group-prefixed-name "" method)))
-                (goto-char (point-min))
-                (while (and (not (eobp))
-                            (progn (insert prefix)
-                                   (zerop (forward-line 1)))))))
-         (goto-char (point-min))
-         (while (not (eobp))
-           (setq group
-                 (condition-case ()
-                     (read nntp-server-buffer)
-                   (error nil)))
-           (skip-chars-forward " \t")
-           (when group
-             (setq group (if (numberp group)
-                             (number-to-string group)
-                           (symbol-name group)))
-             (let* ((str (buffer-substring
-                          (point) (progn (end-of-line) (point))))
-                    (charset
-                     (or (gnus-group-name-charset method group)
-                         (gnus-parameter-charset group)
-                         gnus-default-charset)))
-               ;; Fixme: Don't decode in unibyte mode.
-               ;; Double fixme: We're not in unibyte mode, are we?
-               (when (and str charset)
-                 (setq str (decode-coding-string str charset)))
-               (puthash group str gnus-description-hashtb)))
-           (forward-line 1))))
+      (with-current-buffer nntp-server-buffer
+       (save-excursion ;;FIXME: Not sure if it's needed!
+         (save-restriction
+           (goto-char (point-min))
+           (when (or (search-forward "\n.\n" nil t)
+                     (goto-char (point-max)))
+             (beginning-of-line)
+             (narrow-to-region (point-min) (point)))
+           ;; If these are groups from a foreign select method, we insert the
+           ;; group prefix in front of the group names.
+           (and method (not (inline
+                              (gnus-server-equal
+                               (gnus-server-get-method nil method)
+                               (gnus-server-get-method
+                                nil gnus-select-method))))
+                (let ((prefix (gnus-group-prefixed-name "" method)))
+                  (goto-char (point-min))
+                  (while (and (not (eobp))
+                              (progn (insert prefix)
+                                     (zerop (forward-line 1)))))))
+           (goto-char (point-min))
+           (while (not (eobp))
+             (setq group
+                   (condition-case ()
+                       (read nntp-server-buffer)
+                     (error nil)))
+             (skip-chars-forward " \t")
+             (when group
+               (setq group (if (numberp group)
+                               (number-to-string group)
+                             (symbol-name group)))
+               (let* ((str (buffer-substring
+                            (point) (progn (end-of-line) (point))))
+                      (charset
+                       (or (gnus-group-name-charset method group)
+                           (gnus-parameter-charset group)
+                           gnus-default-charset)))
+                 ;; Fixme: Don't decode in unibyte mode.
+                 ;; Double fixme: We're not in unibyte mode, are we?
+                 (when (and str charset)
+                   (setq str (decode-coding-string str charset)))
+                 (puthash group str gnus-description-hashtb)))
+             (forward-line 1)))))
       (gnus-message 5 "Reading descriptions file...done")
       t))))
 
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el
index b0f9ed4..456e7b0 100644
--- a/lisp/gnus/gnus-sum.el
+++ b/lisp/gnus/gnus-sum.el
@@ -3186,7 +3186,7 @@ The following commands are available:
                           ;; Copy the global value of the variable.
                           (symbol-value (car local))
                         ;; Use the value from the list.
-                        (eval (cdr local)))))
+                        (eval (cdr local) t))))
           (set (make-local-variable (car local)) global))
       ;; Simple nil-valued local variable.
       (set (make-local-variable local) nil))))
@@ -3339,18 +3339,18 @@ article number."
                      ,(or number
                            (inline-quote (gnus-summary-article-number)))))))
 
-(defmacro gnus-summary-thread-level (&optional number)
+(defsubst gnus-summary-thread-level (&optional number)
   "Return the level of thread that starts with article NUMBER."
-  `(if (and (eq gnus-summary-make-false-root 'dummy)
-           (get-text-property (point) 'gnus-intangible))
-       0
-     (gnus-data-level (gnus-data-find
-                      ,(or number '(gnus-summary-article-number))))))
+  (if (and (eq gnus-summary-make-false-root 'dummy)
+          (get-text-property (point) 'gnus-intangible))
+      0
+    (gnus-data-level (gnus-data-find
+                     (or number (gnus-summary-article-number))))))
 
-(defmacro gnus-summary-article-mark (&optional number)
+(defsubst gnus-summary-article-mark (&optional number)
   "Return the mark of article NUMBER."
-  `(gnus-data-mark (gnus-data-find
-                   ,(or number '(gnus-summary-article-number)))))
+  (gnus-data-mark (gnus-data-find
+                  (or number (gnus-summary-article-number)))))
 
 (defmacro gnus-summary-article-pos (&optional number)
   "Return the position of the line of article NUMBER."
@@ -3850,7 +3850,7 @@ buffer that was in action when the last article was 
fetched."
     (condition-case ()
        (put-text-property
         (point)
-        (progn (eval gnus-summary-line-format-spec) (point))
+        (progn (eval gnus-summary-line-format-spec t) (point))
         'gnus-number gnus-tmp-number)
       (error (gnus-message 5 "Error updating the summary line")))
     (when (gnus-visual-p 'summary-highlight 'highlight)
@@ -3971,14 +3971,14 @@ Input should look like this: \"Sun, 14 Oct 2001 
13:34:39 +0200\"."
             (my-format "%b %d '%y"))
        (let* ((difference (time-subtract now messy-date))
               (templist gnus-user-date-format-alist)
-              (top (eval (caar templist))))
+              (top (eval (caar templist) t)))
          (while (if (numberp top) (time-less-p top difference) (not top))
            (progn
              (setq templist (cdr templist))
-             (setq top (eval (caar templist)))))
+             (setq top (eval (caar templist) t))))
          (if (stringp (cdr (car templist)))
              (setq my-format (cdr (car templist)))))
-       (format-time-string (eval my-format) messy-date))
+       (format-time-string (eval my-format t) messy-date))
     (error "  ?   ")))
 
 (defun gnus-summary-set-local-parameters (group)
@@ -3997,8 +3997,8 @@ Input should look like this: \"Sun, 14 Oct 2001 13:34:39 
+0200\"."
             ;; buffer-local, whereas just parameters like `gcc-self',
             ;; `timestamp', etc. should not be bound as variables.
             (if (boundp (car elem))
-                (set (make-local-variable (car elem)) (eval (nth 1 elem)))
-              (eval (nth 1 elem))))))))
+                (set (make-local-variable (car elem)) (eval (nth 1 elem) t))
+              (eval (nth 1 elem) t)))))))
 
 (defun gnus-summary-read-group (group &optional show-all no-article
                                      kill-buffer no-display backward
@@ -5557,7 +5557,7 @@ or a straight list of headers."
             (setq gnus-tmp-thread thread)
            (put-text-property
             (point)
-            (progn (eval gnus-summary-line-format-spec) (point))
+            (progn (eval gnus-summary-line-format-spec t) (point))
             'gnus-number number)
            (when gnus-visual-p
              (forward-line -1)
@@ -6265,7 +6265,7 @@ If WHERE is `summary', the summary mode line format will 
be used."
                  ""))
               bufname-length max-len
               gnus-tmp-header) ;; passed as argument to any user-format-funcs
-         (setq mode-string (eval mformat))
+         (setq mode-string (eval mformat t))
          (setq bufname-length (if (string-match "%b" mode-string)
                                   (- (length
                                       (buffer-name
@@ -7863,7 +7863,7 @@ If BACKWARD, the previous article is selected instead of 
the next."
          (switch-to-buffer gnus-group-buffer)
          (when group
            (gnus-group-jump-to-group group))
-         (eval (cadr (assq key keystrokes)))
+         (eval (cadr (assq key keystrokes)) t)
          (setq group (gnus-group-group-name))
          (switch-to-buffer obuf))
        (setq ended nil))
@@ -10617,6 +10617,8 @@ confirmation before the articles are deleted."
     (gnus-set-mode-line 'summary)
     not-deleted))
 
+(defvar message-options-set-recipient)
+
 (defun gnus-summary-edit-article (&optional arg)
   "Edit the current article.
 This will have permanent effect only in mail groups.
@@ -10674,31 +10676,32 @@ groups."
                 (setq mml-buffer-list mbl)
                  (setq-local mml-buffer-list mbl1))
               (add-hook 'kill-buffer-hook #'mml-destroy-buffers t t))))
-        `(lambda (no-highlight)
-           (let ((mail-parse-charset ',gnus-newsgroup-charset)
-                 (message-options message-options)
-                 (message-options-set-recipient)
-                 (mail-parse-ignored-charsets
-                  ',gnus-newsgroup-ignored-charsets)
-                 (rfc2047-header-encoding-alist
-                  ',(let ((charset (gnus-group-name-charset
-                                    (gnus-find-method-for-group
-                                     gnus-newsgroup-name)
-                                    gnus-newsgroup-name)))
-                      (append (list (cons "Newsgroups" charset)
-                                    (cons "Followup-To" charset)
-                                    (cons "Xref" charset))
-                              rfc2047-header-encoding-alist))))
-             ,(if (not raw) '(progn
-                               (mml-to-mime)
-                               (mml-destroy-buffers)
-                               (remove-hook 'kill-buffer-hook
-                                            #'mml-destroy-buffers t)
-                               (kill-local-variable 'mml-buffer-list)))
-             (gnus-summary-edit-article-done
-              ,(or (mail-header-references gnus-current-headers) "")
-              ,(gnus-group-read-only-p)
-              ,gnus-summary-buffer no-highlight))))))))
+        (let ((charset gnus-newsgroup-charset)
+              (ign-cs gnus-newsgroup-ignored-charsets)
+              (hea (let ((charset (gnus-group-name-charset
+                                   (gnus-find-method-for-group
+                                    gnus-newsgroup-name)
+                                   gnus-newsgroup-name)))
+                     (append (list (cons "Newsgroups" charset)
+                                   (cons "Followup-To" charset)
+                                   (cons "Xref" charset))
+                             rfc2047-header-encoding-alist)))
+              (gch (or (mail-header-references gnus-current-headers) ""))
+              (ro (gnus-group-read-only-p))
+              (buf gnus-summary-buffer))
+          (lambda (no-highlight)
+            (let ((mail-parse-charset charset)
+                  (message-options message-options)
+                  (message-options-set-recipient)
+                  (mail-parse-ignored-charsets ign-cs)
+                  (rfc2047-header-encoding-alist hea))
+              (unless raw
+                (mml-to-mime)
+                (mml-destroy-buffers)
+                (remove-hook 'kill-buffer-hook
+                             #'mml-destroy-buffers t)
+                (kill-local-variable 'mml-buffer-list))
+              (gnus-summary-edit-article-done gch ro buf no-highlight)))))))))
 
 (defalias 'gnus-summary-edit-article-postpone 'gnus-article-edit-exit)
 
@@ -12366,7 +12369,7 @@ save those articles instead."
                    ;; Form.
                    (save-restriction
                      (widen)
-                     (setq result (eval match)))))
+                     (setq result (eval match t)))))
              (setq split-name (cdr method))
              (cond ((stringp result)
                     (push (expand-file-name
@@ -12956,7 +12959,7 @@ treated as multipart/mixed."
                    (nomove "" nil nil ,keystroke)))
       (let ((func (gnus-summary-make-marking-command-1
                   mark (car lway) lway name)))
-       (setq func (eval func))
+       (setq func (eval func t))
        (define-key map (nth 4 lway) func)))))
 
 (defun gnus-summary-make-marking-command-1 (mark way lway name)
diff --git a/lisp/gnus/gnus-topic.el b/lisp/gnus/gnus-topic.el
index 402de05..e7d1cf8 100644
--- a/lisp/gnus/gnus-topic.el
+++ b/lisp/gnus/gnus-topic.el
@@ -1,4 +1,4 @@
-;;; gnus-topic.el --- a folding minor mode for Gnus group buffers
+;;; gnus-topic.el --- a folding minor mode for Gnus group buffers  -*- 
lexical-binding: t; -*-
 
 ;; Copyright (C) 1995-2021 Free Software Foundation, Inc.
 
@@ -43,8 +43,7 @@
 
 (defcustom gnus-topic-mode-hook nil
   "Hook run in topic mode buffers."
-  :type 'hook
-  :group 'gnus-topic)
+  :type 'hook)
 
 (defcustom gnus-topic-line-format "%i[ %(%{%n%}%) -- %A ]%v\n"
   "Format of topic lines.
@@ -61,18 +60,15 @@ with some simple extensions.
 General format specifiers can also be used.
 See Info node `(gnus)Formatting Variables'."
   :link '(custom-manual "(gnus)Formatting Variables")
-  :type 'string
-  :group 'gnus-topic)
+  :type 'string)
 
 (defcustom gnus-topic-indent-level 2
   "How much each subtopic should be indented."
-  :type 'integer
-  :group 'gnus-topic)
+  :type 'integer)
 
 (defcustom gnus-topic-display-empty-topics t
   "If non-nil, display the topic lines even of topics that have no unread 
articles."
-  :type 'boolean
-  :group 'gnus-topic)
+  :type 'boolean)
 
 ;; Internal variables.
 
@@ -644,7 +640,14 @@ articles in the topic and its subtopics."
        (add-text-properties
         (point)
         (prog1 (1+ (point))
-          (eval gnus-topic-line-format-spec))
+          (eval gnus-topic-line-format-spec
+                 `((indentation . ,indentation)
+                   (visible . ,visible)
+                   (name . ,name)
+                   (level . ,level)
+                   (number-of-groups . ,number-of-groups)
+                   (total-number-of-articles . ,total-number-of-articles)
+                   (entries . ,entries))))
         (list 'gnus-topic name
               'gnus-topic-level level
               'gnus-topic-unread unread
@@ -1605,8 +1608,8 @@ If performed on a topic, edit the topic parameters 
instead."
         (gnus-topic-parameters topic)
         (format-message "Editing the topic parameters for `%s'."
                         (or group topic))
-        `(lambda (form)
-           (gnus-topic-set-parameters ,topic form)))))))
+        (lambda (form)
+          (gnus-topic-set-parameters topic form)))))))
 
 (defun gnus-group-sort-topic (func reverse)
   "Sort groups in the topics according to FUNC and REVERSE."
@@ -1690,9 +1693,8 @@ If REVERSE, sort in reverse order."
 (defun gnus-topic-sort-topics-1 (top reverse)
   (if (cdr top)
       (let ((subtop
-            (mapcar (gnus-byte-compile
-                     `(lambda (top)
-                        (gnus-topic-sort-topics-1 top ,reverse)))
+            (mapcar (lambda (top)
+                      (gnus-topic-sort-topics-1 top reverse))
                     (sort (cdr top)
                           (lambda (t1 t2)
                             (string-lessp (caar t1) (caar t2)))))))
diff --git a/lisp/gnus/gnus-undo.el b/lisp/gnus/gnus-undo.el
index 5d2f85a..64ed2bb 100644
--- a/lisp/gnus/gnus-undo.el
+++ b/lisp/gnus/gnus-undo.el
@@ -1,4 +1,4 @@
-;;; gnus-undo.el --- minor mode for undoing in Gnus
+;;; gnus-undo.el --- minor mode for undoing in Gnus  -*- lexical-binding: t; 
-*-
 
 ;; Copyright (C) 1996-2021 Free Software Foundation, Inc.
 
@@ -153,10 +153,10 @@
     ;; We are not at a boundary...
     (setq gnus-undo-boundary-inhibit t)))
 
-(defun gnus-undo (n)
+(defun gnus-undo (_n)
   "Undo some previous changes in Gnus buffers.
-Repeat this command to undo more changes.
-A numeric argument serves as a repeat count."
+Repeat this command to undo more changes."
+  ;; FIXME: A numeric argument should serve as a repeat count.
   (interactive "p")
   (unless gnus-undo-mode
     (error "Undoing is not enabled in this buffer"))
diff --git a/lisp/gnus/gnus-util.el b/lisp/gnus/gnus-util.el
index b845102..3c7c948 100644
--- a/lisp/gnus/gnus-util.el
+++ b/lisp/gnus/gnus-util.el
@@ -1,4 +1,4 @@
-;;; gnus-util.el --- utility functions for Gnus
+;;; gnus-util.el --- utility functions for Gnus  -*- lexical-binding: t; -*-
 
 ;; Copyright (C) 1996-2021 Free Software Foundation, Inc.
 
@@ -681,6 +681,8 @@ yield \"nnimap:yxa\"."
   (define-key (symbol-value (intern (format "gnus-%s-mode-map" type)))
     [menu-bar edit] 'undefined))
 
+(defvar print-string-length)
+
 (defmacro gnus-bind-print-variables (&rest forms)
   "Bind print-* variables and evaluate FORMS.
 This macro is used with `prin1', `pp', etc. in order to ensure
@@ -1203,9 +1205,7 @@ ARG is passed to the first function."
           (string-equal (downcase x) (downcase y)))))
 
 (defcustom gnus-use-byte-compile t
-  "If non-nil, byte-compile crucial run-time code.
-Setting it to nil has no effect after the first time `gnus-byte-compile'
-is run."
+  "If non-nil, byte-compile crucial run-time code."
   :type 'boolean
   :version "22.1"
   :group 'gnus-various)
@@ -1213,13 +1213,8 @@ is run."
 (defun gnus-byte-compile (form)
   "Byte-compile FORM if `gnus-use-byte-compile' is non-nil."
   (if gnus-use-byte-compile
-      (progn
-       (require 'bytecomp)
-       (defalias 'gnus-byte-compile
-         (lambda (form)
-           (let ((byte-compile-warnings '(unresolved callargs redefine)))
-             (byte-compile form))))
-       (gnus-byte-compile form))
+      (let ((byte-compile-warnings '(unresolved callargs redefine)))
+       (byte-compile form))
     form))
 
 (defun gnus-remassoc (key alist)
@@ -1239,16 +1234,19 @@ sure of changing the value of `foo'."
       (cons (cons key value) (gnus-remassoc key alist))
     (gnus-remassoc key alist)))
 
+(defvar gnus-info-buffer)
+(declare-function gnus-configure-windows "gnus-win" (setting &optional force))
+
 (defun gnus-create-info-command (node)
   "Create a command that will go to info NODE."
-  `(lambda ()
-     (interactive)
-     ,(concat "Enter the info system at node " node)
-     (Info-goto-node ,node)
-     (setq gnus-info-buffer (current-buffer))
-     (gnus-configure-windows 'info)))
-
-(defun gnus-not-ignore (&rest args)
+  (lambda ()
+    (:documentation (format "Enter the info system at node %s." node))
+    (interactive)
+    (info node)
+    (setq gnus-info-buffer (current-buffer))
+    (gnus-configure-windows 'info)))
+
+(defun gnus-not-ignore (&rest _args)
   t)
 
 (defvar gnus-directory-sep-char-regexp "/"
@@ -1385,8 +1383,10 @@ SPEC is a predicate specifier that contains stuff like 
`or', `and',
 (declare-function iswitchb-read-buffer "iswitchb"
                  (prompt &optional default require-match
                          _predicate start matches-set))
+(declare-function iswitchb-minibuffer-setup "iswitchb")
 (defvar iswitchb-temp-buflist)
 (defvar iswitchb-mode)
+(defvar iswitchb-make-buflist-hook)
 
 (defun gnus-iswitchb-completing-read (prompt collection &optional require-match
                                             initial-input history def)
@@ -1449,7 +1449,8 @@ CHOICE is a list of the choice char and help message at 
IDX."
                   prompt
                   (concat
                    (mapconcat (lambda (s) (char-to-string (car s)))
-                              choice ", ") ", ?"))
+                              choice ", ")
+                   ", ?"))
          (setq tchar (read-char))
          (when (not (assq tchar choice))
            (setq tchar nil)
@@ -1505,7 +1506,7 @@ Return nil otherwise."
 
 (defvar tool-bar-mode)
 
-(defun gnus-tool-bar-update (&rest ignore)
+(defun gnus-tool-bar-update (&rest _ignore)
   "Update the tool bar."
   (when (and (boundp 'tool-bar-mode)
             tool-bar-mode)
@@ -1531,7 +1532,7 @@ sequence, this is like `mapcar'.  With several, it is 
like the Common Lisp
   (if seqs2_n
       (let* ((seqs (cons seq1 seqs2_n))
             (cnt 0)
-            (heads (mapcar (lambda (seq)
+            (heads (mapcar (lambda (_seq)
                              (make-symbol (concat "head"
                                                   (int-to-string
                                                    (setq cnt (1+ cnt))))))
@@ -1565,7 +1566,7 @@ sequence, this is like `mapcar'.  With several, it is 
like the Common Lisp
                         ((memq 'type lst)
                          (symbol-name system-type))
                         (t nil)))
-        codename)
+        ) ;; codename
     (cond
      ((not (memq 'emacs lst))
       nil)
@@ -1581,9 +1582,9 @@ sequence, this is like `mapcar'.  With several, it is 
like the Common Lisp
 empty directories from OLD-PATH."
   (when (file-exists-p old-path)
     (let* ((old-dir (file-name-directory old-path))
-          (old-name (file-name-nondirectory old-path))
+          ;; (old-name (file-name-nondirectory old-path))
           (new-dir (file-name-directory new-path))
-          (new-name (file-name-nondirectory new-path))
+          ;; (new-name (file-name-nondirectory new-path))
           temp)
       (gnus-make-directory new-dir)
       (rename-file old-path new-path t)
diff --git a/lisp/gnus/gnus-uu.el b/lisp/gnus/gnus-uu.el
index 2bc1f86..32a8785 100644
--- a/lisp/gnus/gnus-uu.el
+++ b/lisp/gnus/gnus-uu.el
@@ -1,4 +1,4 @@
-;;; gnus-uu.el --- extract (uu)encoded files in Gnus
+;;; gnus-uu.el --- extract (uu)encoded files in Gnus  -*- lexical-binding: t; 
-*-
 
 ;; Copyright (C) 1985-1987, 1993-1998, 2000-2021 Free Software
 ;; Foundation, Inc.
@@ -977,7 +977,7 @@ When called interactively, prompt for REGEXP."
 (defvar gnus-uu-binhex-end-line
   ":$")
 
-(defun gnus-uu-binhex-article (buffer in-state)
+(defun gnus-uu-binhex-article (buffer _in-state)
   (let (state start-char)
     (with-current-buffer buffer
       (widen)
@@ -1014,11 +1014,11 @@ When called interactively, prompt for REGEXP."
 
 ;; yEnc
 
-(defun gnus-uu-yenc-article (buffer in-state)
+(defun gnus-uu-yenc-article (_buffer _in-state)
   (with-current-buffer gnus-original-article-buffer
     (widen)
     (let ((file-name (yenc-extract-filename))
-         state start-char)
+         state) ;; start-char
       (when (not file-name)
        (setq state (list 'wrong-type)))
 
@@ -1046,7 +1046,7 @@ When called interactively, prompt for REGEXP."
 
 ;; PostScript
 
-(defun gnus-uu-decode-postscript-article (process-buffer in-state)
+(defun gnus-uu-decode-postscript-article (process-buffer _in-state)
   (let ((state (list 'ok))
        start-char end-char file-name)
     (with-current-buffer process-buffer
@@ -1278,13 +1278,15 @@ When called interactively, prompt for REGEXP."
       (when dont-unmark-last-article
        (setq gnus-uu-has-been-grabbed (list art))))))
 
+(defvar gnus-asynchronous)
+
 ;; This function takes a list of articles and a function to apply to
 ;; each article grabbed.
 ;;
 ;; This function returns a list of files decoded if the grabbing and
 ;; the process-function has been successful and nil otherwise.
 (defun gnus-uu-grab-articles (articles process-function
-                                      &optional sloppy limit no-errors)
+                                      &optional sloppy limit _no-errors)
   (require 'gnus-async)
   (let ((state 'first)
        (gnus-asynchronous nil)
@@ -1452,10 +1454,10 @@ When called interactively, prompt for REGEXP."
          (setq subject (substring subject (match-end 0)))))
     (or part "")))
 
-(defun gnus-uu-uudecode-sentinel (process event)
+(defun gnus-uu-uudecode-sentinel (process _event)
   (delete-process (get-process process)))
 
-(defun gnus-uu-uustrip-article (process-buffer in-state)
+(defun gnus-uu-uustrip-article (process-buffer _in-state)
   ;; Uudecodes a file asynchronously.
   (with-current-buffer process-buffer
     (let ((state (list 'wrong-type))
@@ -1576,7 +1578,7 @@ Gnus might fail to display all of it.")
 
 ;; This function is used by `gnus-uu-grab-articles' to treat
 ;; a shared article.
-(defun gnus-uu-unshar-article (process-buffer in-state)
+(defun gnus-uu-unshar-article (process-buffer _in-state)
   (let ((state (list 'ok))
        start-char)
     (with-current-buffer process-buffer
@@ -1949,6 +1951,7 @@ The user will be asked for a file name."
                  (gnus-uu-choose-action file-name gnus-uu-ext-to-mime-list)
                  file-name))
   (insert (format "Content-Transfer-Encoding: %s\n\n" encoding))
+  ;; FIXME: Shouldn't we set-buffer before saving the restriction?  --Stef
   (save-restriction
     (set-buffer gnus-message-buffer)
     (goto-char (point-min))
diff --git a/lisp/gnus/gnus-vm.el b/lisp/gnus/gnus-vm.el
index 533b1e2..b7e6b2a 100644
--- a/lisp/gnus/gnus-vm.el
+++ b/lisp/gnus/gnus-vm.el
@@ -1,4 +1,4 @@
-;;; gnus-vm.el --- vm interface for Gnus
+;;; gnus-vm.el --- vm interface for Gnus  -*- lexical-binding: t; -*-
 
 ;; Copyright (C) 1994-2021 Free Software Foundation, Inc.
 
diff --git a/lisp/gnus/gnus-win.el b/lisp/gnus/gnus-win.el
index 3fb8e46..8ac4e39 100644
--- a/lisp/gnus/gnus-win.el
+++ b/lisp/gnus/gnus-win.el
@@ -1,4 +1,4 @@
-;;; gnus-win.el --- window configuration functions for Gnus
+;;; gnus-win.el --- window configuration functions for Gnus  -*- 
lexical-binding: t; -*-
 
 ;; Copyright (C) 1996-2021 Free Software Foundation, Inc.
 
@@ -36,7 +36,6 @@
 
 (defcustom gnus-use-full-window t
   "If non-nil, use the entire Emacs screen."
-  :group 'gnus-windows
   :type 'boolean)
 
 (defcustom gnus-use-atomic-windows nil
@@ -46,17 +45,14 @@
 
 (defcustom gnus-window-min-width 2
   "Minimum width of Gnus buffers."
-  :group 'gnus-windows
   :type 'integer)
 
 (defcustom gnus-window-min-height 1
   "Minimum height of Gnus buffers."
-  :group 'gnus-windows
   :type 'integer)
 
 (defcustom gnus-always-force-window-configuration nil
   "If non-nil, always force the Gnus window configurations."
-  :group 'gnus-windows
   :type 'boolean)
 
 (defcustom gnus-use-frames-on-any-display nil
@@ -64,7 +60,6 @@
 When nil, only frames on the same display as the selected frame will be
 used to display Gnus windows."
   :version "22.1"
-  :group 'gnus-windows
   :type 'boolean)
 
 (defvar gnus-buffer-configuration
@@ -202,7 +197,6 @@ See the Gnus manual for an explanation of the syntax used.")
 (defcustom gnus-configure-windows-hook nil
   "A hook called when configuring windows."
   :version "22.1"
-  :group 'gnus-windows
   :type 'hook)
 
 ;;; Internal variables.
@@ -252,7 +246,7 @@ See the Gnus manual for an explanation of the syntax used.")
     ;; return a new SPLIT.
     (while (and (not (assq (car split) gnus-window-to-buffer))
                (symbolp (car split)) (fboundp (car split)))
-      (setq split (eval split)))
+      (setq split (eval split t)))
     (let* ((type (car split))
           (subs (cddr split))
           (len (if (eq type 'horizontal) (window-width) (window-height)))
@@ -329,7 +323,7 @@ See the Gnus manual for an explanation of the syntax used.")
            (setq sub (append (pop subs) nil))
            (while (and (not (assq (car sub) gnus-window-to-buffer))
                        (symbolp (car sub)) (fboundp (car sub)))
-             (setq sub (eval sub)))
+             (setq sub (eval sub t)))
            (when sub
              (push sub comp-subs)
              (setq size (cadar comp-subs))
@@ -477,7 +471,7 @@ should have point."
       ;; return a new SPLIT.
       (while (and (not (assq (car split) gnus-window-to-buffer))
                  (symbolp (car split)) (fboundp (car split)))
-       (setq split (eval split)))
+       (setq split (eval split t)))
 
       (setq type (elt split 0))
       (cond
diff --git a/lisp/gnus/gnus.el b/lisp/gnus/gnus.el
index 1eff9a8..84e53da 100644
--- a/lisp/gnus/gnus.el
+++ b/lisp/gnus/gnus.el
@@ -3724,7 +3724,7 @@ just the host name."
                               depth (+ depth 1)))
                       depth))))
     ;; Separate foreign select method from group name and collapse.
-   ;; If method contains a server, collapse to non-domain server name,
+    ;; If method contains a server, collapse to non-domain server name,
     ;; otherwise collapse to select method.
     (let* ((colon (string-match ":" group))
           (server (and colon (substring group 0 colon)))
diff --git a/lisp/gnus/gssapi.el b/lisp/gnus/gssapi.el
index 20562fb..6ff2a4e 100644
--- a/lisp/gnus/gssapi.el
+++ b/lisp/gnus/gssapi.el
@@ -1,4 +1,4 @@
-;;; gssapi.el --- GSSAPI/Kerberos 5 interface for Emacs
+;;; gssapi.el --- GSSAPI/Kerberos 5 interface for Emacs  -*- lexical-binding: 
t; -*-
 
 ;; Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
diff --git a/lisp/gnus/legacy-gnus-agent.el b/lisp/gnus/legacy-gnus-agent.el
index b47e69f..091e389 100644
--- a/lisp/gnus/legacy-gnus-agent.el
+++ b/lisp/gnus/legacy-gnus-agent.el
@@ -1,4 +1,4 @@
-;;; gnus-agent.el --- Legacy unplugged support for Gnus
+;;; gnus-agent.el --- Legacy unplugged support for Gnus  -*- lexical-binding: 
t; -*-
 
 ;; Copyright (C) 2004-2021 Free Software Foundation, Inc.
 
@@ -210,7 +210,7 @@ converted to the compressed format."
 ;; Therefore, hide the default prompt.
 (gnus-convert-mark-converter-prompt 'gnus-agent-unlist-expire-days t)
 
-(defun gnus-agent-unhook-expire-days (converting-to)
+(defun gnus-agent-unhook-expire-days (_converting-to)
   "Remove every lambda from `gnus-group-prepare-hook' that mention the
 symbol `gnus-agent-do-once' in their definition.  This should NOT be
 necessary as gnus-agent.el no longer adds them.  However, it is
diff --git a/lisp/gnus/mail-source.el b/lisp/gnus/mail-source.el
index c954f65..c5fcacb 100644
--- a/lisp/gnus/mail-source.el
+++ b/lisp/gnus/mail-source.el
@@ -1,4 +1,4 @@
-;;; mail-source.el --- functions for fetching mail
+;;; mail-source.el --- functions for fetching mail  -*- lexical-binding: t; -*-
 
 ;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
@@ -56,7 +56,6 @@
   "Where the mail backends will look for incoming mail.
 This variable is a list of mail source specifiers.
 See Info node `(gnus)Mail Source Specifiers'."
-  :group 'mail-source
   :version "24.4"
   :link '(custom-manual "(gnus)Mail Source Specifiers")
   :type `(choice
@@ -230,33 +229,27 @@ Leave mails for this many days" :value 14)))))
 If nil, the user will be prompted when an error occurs.  If non-nil,
 the error will be ignored."
   :version "22.1"
-  :group 'mail-source
   :type 'boolean)
 
 (defcustom mail-source-primary-source nil
   "Primary source for incoming mail.
 If non-nil, this maildrop will be checked periodically for new mail."
-  :group 'mail-source
   :type 'sexp)
 
 (defcustom mail-source-flash t
   "If non-nil, flash periodically when mail is available."
-  :group 'mail-source
   :type 'boolean)
 
 (defcustom mail-source-crash-box "~/.emacs-mail-crash-box"
   "File where mail will be stored while processing it."
-  :group 'mail-source
   :type 'file)
 
 (defcustom mail-source-directory message-directory
   "Directory where incoming mail source files (if any) will be stored."
-  :group 'mail-source
   :type 'directory)
 
 (defcustom mail-source-default-file-modes 384
   "Set the mode bits of all new mail files to this integer."
-  :group 'mail-source
   :type 'integer)
 
 (defcustom mail-source-delete-incoming
@@ -270,7 +263,6 @@ Removing of old files happens in `mail-source-callback', 
i.e. no
 old incoming files will be deleted unless you receive new mail.
 You may also set this variable to nil and call
 `mail-source-delete-old-incoming' interactively."
-  :group 'mail-source
   :version "22.2" ;; No Gnus / Gnus 5.10.10 (default changed)
   :type '(choice (const :tag "immediately" t)
                 (const :tag "never" nil)
@@ -281,28 +273,23 @@ You may also set this variable to nil and call
 This variable only applies when `mail-source-delete-incoming' is a positive
 number."
   :version "22.2" ;; No Gnus / Gnus 5.10.10 (default changed)
-  :group 'mail-source
   :type 'boolean)
 
 (defcustom mail-source-incoming-file-prefix "Incoming"
   "Prefix for file name for storing incoming mail."
-  :group 'mail-source
   :type 'string)
 
 (defcustom mail-source-report-new-mail-interval 5
   "Interval in minutes between checks for new mail."
-  :group 'mail-source
   :type 'number)
 
 (defcustom mail-source-idle-time-delay 5
   "Number of idle seconds to wait before checking for new mail."
-  :group 'mail-source
   :type 'number)
 
 (defcustom mail-source-movemail-program "movemail"
   "If non-nil, name of program for fetching new mail."
   :version "26.2"
-  :group 'mail-source
   :type '(choice (const nil) string))
 
 ;;; Internal variables.
@@ -393,13 +380,10 @@ All keywords that can be used must be listed here."))
 ;; suitable for usage in a `let' form
 (eval-and-compile
   (defun mail-source-bind-1 (type)
-    (let* ((defaults (cdr (assq type mail-source-keyword-map)))
-          default bind)
-      (while (setq default (pop defaults))
-       (push (list (mail-source-strip-keyword (car default))
-                   nil)
-             bind))
-      bind)))
+    (mapcar (lambda (default)
+             (list (mail-source-strip-keyword (car default))
+                   nil))
+           (cdr (assq type mail-source-keyword-map)))))
 
 (defmacro mail-source-bind (type-source &rest body)
   "Return a `let' form that binds all variables in source TYPE.
@@ -419,16 +403,19 @@ of the second `let' form.
 The variables bound and their default values are described by
 the `mail-source-keyword-map' variable."
   (declare (indent 1) (debug (sexp body)))
-  `(let* ,(mail-source-bind-1 (car type-source))
-     (mail-source-set-1 ,(cadr type-source))
-     ,@body))
-
+  ;; FIXME: Use lexical vars, i.e. don't initialize the vars inside
+  ;; `mail-source-set-1' via `set'.
+  (let ((bindings (mail-source-bind-1 (car type-source))))
+    `(with-suppressed-warnings ((lexical ,@(mapcar #'car bindings)))
+       (dlet ,bindings
+         (mail-source-set-1 ,(cadr type-source))
+         ,@body))))
 
 (defun mail-source-set-1 (source)
   (let* ((type (pop source))
          (defaults (cdr (assq type mail-source-keyword-map)))
          (search '(:max 1))
-         found default value keyword auth-info user-auth pass-auth)
+         found default value keyword user-auth pass-auth) ;; auth-info
 
     ;; append to the search the useful info from the source and the defaults:
     ;; user, host, and port
@@ -489,20 +476,16 @@ the `mail-source-keyword-map' variable."
 
 (eval-and-compile
   (defun mail-source-bind-common-1 ()
-    (let* ((defaults mail-source-common-keyword-map)
-          default bind)
-      (while (setq default (pop defaults))
-       (push (list (mail-source-strip-keyword (car default))
-                   nil)
-             bind))
-      bind)))
+    (mapcar (lambda (default)
+             (list (mail-source-strip-keyword (car default))
+                   nil))
+           mail-source-common-keyword-map)))
 
 (defun mail-source-set-common-1 (source)
   (let* ((type (pop source))
-        (defaults mail-source-common-keyword-map)
         (defaults-1 (cdr (assq type mail-source-keyword-map)))
-        default value keyword)
-    (while (setq default (pop defaults))
+        value keyword)
+    (dolist (default mail-source-common-keyword-map)
       (set (mail-source-strip-keyword (setq keyword (car default)))
           (if (setq value (plist-get source keyword))
               (mail-source-value value)
@@ -514,9 +497,13 @@ the `mail-source-keyword-map' variable."
   "Return a `let' form that binds all common variables.
 See `mail-source-bind'."
   (declare (indent 1) (debug (sexp body)))
-  `(let ,(mail-source-bind-common-1)
-     (mail-source-set-common-1 source)
-     ,@body))
+  ;; FIXME: Use lexical vars, i.e. don't initialize the vars inside
+  ;; `mail-source-set-common-1' via `set'.
+  (let ((bindings (mail-source-bind-common-1)))
+    `(with-suppressed-warnings ((lexical ,@(mapcar #'car bindings)))
+       (dlet ,bindings
+         (mail-source-set-common-1 ,source)
+         ,@body))))
 
 (defun mail-source-value (value)
   "Return the value of VALUE."
@@ -526,7 +513,7 @@ See `mail-source-bind'."
     value)
    ;; Function
    ((and (listp value) (symbolp (car value)) (fboundp (car value)))
-    (eval value))
+    (eval value t))
    ;; Just return the value.
    (t
     value)))
@@ -741,12 +728,13 @@ Deleting old (> %s day(s)) incoming mail file `%s'." diff 
bfile)
 (declare-function gnus-get-buffer-create "gnus" (name))
 (defun mail-source-call-script (script)
   (require 'gnus)
-  (let ((background nil)
+  (let (;; (background nil)
        (stderr (gnus-get-buffer-create " *mail-source-stderr*"))
        result)
     (when (string-match "& *$" script)
       (setq script (substring script 0 (match-beginning 0))
-           background 0))
+           ;; background 0
+           ))
     (setq result
          (call-process shell-file-name nil stderr nil
                        shell-command-switch script))
@@ -830,14 +818,14 @@ Deleting old (> %s day(s)) incoming mail file `%s'." diff 
bfile)
             ;; The default is to use pop3.el.
             (t
              (require 'pop3)
-             (let ((pop3-password password)
-                   (pop3-maildrop user)
-                   (pop3-mailhost server)
-                   (pop3-port port)
-                   (pop3-authentication-scheme
-                    (if (eq authentication 'apop) 'apop 'pass))
-                   (pop3-stream-type stream)
-                   (pop3-leave-mail-on-server leave))
+             (dlet ((pop3-password password)
+                    (pop3-maildrop user)
+                    (pop3-mailhost server)
+                    (pop3-port port)
+                    (pop3-authentication-scheme
+                     (if (eq authentication 'apop) 'apop 'pass))
+                    (pop3-stream-type stream)
+                    (pop3-leave-mail-on-server leave))
                (if (or debug-on-quit debug-on-error)
                    (save-excursion (pop3-movemail mail-source-crash-box))
                  (condition-case err
@@ -897,12 +885,12 @@ Deleting old (> %s day(s)) incoming mail file `%s'." diff 
bfile)
             ;; The default is to use pop3.el.
             (t
              (require 'pop3)
-             (let ((pop3-password password)
-                   (pop3-maildrop user)
-                   (pop3-mailhost server)
-                   (pop3-port port)
-                   (pop3-authentication-scheme
-                    (if (eq authentication 'apop) 'apop 'pass)))
+             (dlet ((pop3-password password)
+                    (pop3-maildrop user)
+                    (pop3-mailhost server)
+                    (pop3-port port)
+                    (pop3-authentication-scheme
+                     (if (eq authentication 'apop) 'apop 'pass)))
                (if (or debug-on-quit debug-on-error)
                    (save-excursion (pop3-get-message-count))
                  (condition-case err
@@ -932,7 +920,7 @@ authentication.  To do that, you need to set the
 `message-send-mail-function' variable as `message-smtpmail-send-it'
 and put the following line in your ~/.gnus.el file:
 
-\(add-hook \\='message-send-mail-hook \\='mail-source-touch-pop)
+\(add-hook \\='message-send-mail-hook #\\='mail-source-touch-pop)
 
 See the Gnus manual for details."
   (let ((sources (if mail-source-primary-source
@@ -976,6 +964,8 @@ See the Gnus manual for details."
     ;; (element 0 of the vector is nil if the timer is active).
     (aset mail-source-report-new-mail-idle-timer 0 nil)))
 
+(declare-function display-time-event-handler "time" ())
+
 (defun mail-source-report-new-mail (arg)
   "Toggle whether to report when new mail is available.
 This only works when `display-time' is enabled."
@@ -1088,7 +1078,8 @@ This only works when `display-time' is enabled."
       (if (and (imap-open server port stream authentication buf)
               (imap-authenticate
                user (or (cdr (assoc from mail-source-password-cache))
-                         password) buf))
+                         password)
+                buf))
           (let ((mailbox-list (if (listp mailbox) mailbox (list mailbox))))
             (dolist (mailbox mailbox-list)
               (when (imap-mailbox-select mailbox nil buf)
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el
index 3f67119..d2a0092 100644
--- a/lisp/gnus/message.el
+++ b/lisp/gnus/message.el
@@ -3675,7 +3675,7 @@ are null."
             ((functionp message-signature)
              (funcall message-signature))
             ((listp message-signature)
-             (eval message-signature))
+             (eval message-signature t))
             (t message-signature)))
           signature-file)
       (setq signature
@@ -3992,11 +3992,12 @@ Just \\[universal-argument] as argument means don't 
indent, insert no
 prefix, and don't delete any headers."
   (interactive "P")
   ;; eval the let forms contained in message-cite-style
-  (eval
-   `(let ,(if (symbolp message-cite-style)
-             (symbol-value message-cite-style)
-           message-cite-style)
-      (message--yank-original-internal ',arg))))
+  (let ((bindings (if (symbolp message-cite-style)
+                     (symbol-value message-cite-style)
+                   message-cite-style)))
+    (cl-progv (mapcar #'car bindings)
+        (mapcar (lambda (binding) (eval (cadr binding) t)) bindings)
+      (message--yank-original-internal arg))))
 
 (defun message-yank-buffer (buffer)
   "Insert BUFFER into the current buffer and quote it."
@@ -4627,7 +4628,7 @@ Valid types are `send', `return', `exit', `kill' and 
`postpone'."
        (funcall action))
        ;; Something to be evalled.
        (t
-       (eval action))))))
+       (eval action t))))))
 
 (defun message-send-mail-partially ()
   "Send mail as message/partial."
@@ -4943,7 +4944,7 @@ that instead."
            ;; Insert an extra newline if we need it to work around
            ;; Sun's bug that swallows newlines.
            (goto-char (1+ delimline))
-           (when (eval message-mailer-swallows-blank-line)
+           (when (eval message-mailer-swallows-blank-line t)
              (newline))
            (when message-interactive
              (with-current-buffer errbuf
diff --git a/lisp/gnus/mm-archive.el b/lisp/gnus/mm-archive.el
index 6173d86..1ecceee 100644
--- a/lisp/gnus/mm-archive.el
+++ b/lisp/gnus/mm-archive.el
@@ -1,4 +1,4 @@
-;;; mm-archive.el --- Functions for parsing archive files as MIME
+;;; mm-archive.el --- Functions for parsing archive files as MIME  -*- 
lexical-binding: t; -*-
 
 ;; Copyright (C) 2012-2021 Free Software Foundation, Inc.
 
@@ -100,11 +100,11 @@
       (goto-char (point-max))
       (mm-handle-set-undisplayer
        handle
-       `(lambda ()
-         (let ((inhibit-read-only t)
-               (end ,(point-marker)))
-           (remove-images ,start end)
-           (delete-region ,start end)))))))
+       (let ((end (point-marker)))
+        (lambda ()
+          (let ((inhibit-read-only t))
+            (remove-images start end)
+            (delete-region start end))))))))
 
 (provide 'mm-archive)
 
diff --git a/lisp/gnus/mm-bodies.el b/lisp/gnus/mm-bodies.el
index f35ba3a..d6b71f1 100644
--- a/lisp/gnus/mm-bodies.el
+++ b/lisp/gnus/mm-bodies.el
@@ -1,4 +1,4 @@
-;;; mm-bodies.el --- Functions for decoding MIME things
+;;; mm-bodies.el --- Functions for decoding MIME things  -*- lexical-binding: 
t; -*-
 
 ;; Copyright (C) 1998-2021 Free Software Foundation, Inc.
 
diff --git a/lisp/gnus/mm-encode.el b/lisp/gnus/mm-encode.el
index 31d6131..84a3b0a 100644
--- a/lisp/gnus/mm-encode.el
+++ b/lisp/gnus/mm-encode.el
@@ -1,4 +1,4 @@
-;;; mm-encode.el --- Functions for encoding MIME things
+;;; mm-encode.el --- Functions for encoding MIME things  -*- lexical-binding: 
t; -*-
 
 ;; Copyright (C) 1998-2021 Free Software Foundation, Inc.
 
diff --git a/lisp/gnus/mm-partial.el b/lisp/gnus/mm-partial.el
index 165c191..0c25c8f 100644
--- a/lisp/gnus/mm-partial.el
+++ b/lisp/gnus/mm-partial.el
@@ -1,4 +1,4 @@
-;;; mm-partial.el --- showing message/partial
+;;; mm-partial.el --- showing message/partial  -*- lexical-binding: t; -*-
 
 ;; Copyright (C) 2000-2021 Free Software Foundation, Inc.
 
@@ -39,7 +39,8 @@
                                            gnus-newsgroup-name)
          (when (search-forward id nil t)
            (let ((nhandles (mm-dissect-buffer
-                            nil gnus-article-loose-mime)) nid)
+                            nil gnus-article-loose-mime))
+                 nid)
              (if (consp (car nhandles))
                  (mm-destroy-parts nhandles)
                (setq nid (cdr (assq 'id
@@ -49,6 +50,8 @@
                  (push nhandles phandles))))))))
     phandles))
 
+(defvar gnus-displaying-mime)
+
 ;;;###autoload
 (defun mm-inline-partial (handle &optional no-display)
   "Show the partial part of HANDLE.
@@ -59,7 +62,7 @@ If NO-DISPLAY is nil, display it.  Otherwise, do nothing 
after replacing."
        phandles
        (b (point)) (n 1) total
        phandle nn ntotal
-       gnus-displaying-mime handles buffer)
+       gnus-displaying-mime handles) ;; buffer
     (unless (mm-handle-cache handle)
       (unless id
        (error "Can not find message/partial id"))
@@ -90,7 +93,7 @@ If NO-DISPLAY is nil, display it.  Otherwise, do nothing 
after replacing."
          (if ntotal
              (if total
                  (unless (eq total ntotal)
-                 (error "The numbers of total are different"))
+                   (error "The numbers of total are different"))
                (setq total ntotal)))
          (unless (< nn n)
            (unless (eq nn n)
@@ -132,9 +135,11 @@ If NO-DISPLAY is nil, display it.  Otherwise, do nothing 
after replacing."
                  (mm-merge-handles gnus-article-mime-handles handles)))
          (mm-handle-set-undisplayer
           handle
-          `(lambda ()
-             (let (buffer-read-only)
-               (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))))))))))
 
 (provide 'mm-partial)
 
diff --git a/lisp/gnus/mm-url.el b/lisp/gnus/mm-url.el
index 73106a2..3d58738 100644
--- a/lisp/gnus/mm-url.el
+++ b/lisp/gnus/mm-url.el
@@ -1,4 +1,4 @@
-;;; mm-url.el --- a wrapper of url functions/commands for Gnus
+;;; mm-url.el --- a wrapper of url functions/commands for Gnus  -*- 
lexical-binding: t; -*-
 
 ;; Copyright (C) 2001-2021 Free Software Foundation, Inc.
 
@@ -44,8 +44,7 @@
 (defcustom mm-url-use-external nil
   "If non-nil, use external grab program `mm-url-program'."
   :version "22.1"
-  :type 'boolean
-  :group 'mm-url)
+  :type 'boolean)
 
 (defvar mm-url-predefined-programs
   '((wget "wget" "--user-agent=mm-url" "-q" "-O" "-")
@@ -68,14 +67,12 @@ Likely values are `wget', `w3m', `lynx' and `curl'."
          (symbol :tag "w3m" w3m)
          (symbol :tag "lynx" lynx)
          (symbol :tag "curl" curl)
-         (string :tag "other"))
-  :group 'mm-url)
+         (string :tag "other")))
 
 (defcustom mm-url-arguments nil
   "The arguments for `mm-url-program'."
   :version "22.1"
-  :type '(repeat string)
-  :group 'mm-url)
+  :type '(repeat string))
 
 
 ;;; Internal variables
diff --git a/lisp/gnus/mm-util.el b/lisp/gnus/mm-util.el
index 329b9e8..92e04f9 100644
--- a/lisp/gnus/mm-util.el
+++ b/lisp/gnus/mm-util.el
@@ -144,9 +144,9 @@ is not available."
    ;; on there being some coding system matching each `mime-charset'
    ;; property defined, as there should be.)
    ((and (mm-coding-system-p charset)
-;;; Doing this would potentially weed out incorrect charsets.
-;;;     charset
-;;;     (eq charset (coding-system-get charset 'mime-charset))
+        ;; Doing this would potentially weed out incorrect charsets.
+        ;;      charset
+        ;;      (eq charset (coding-system-get charset 'mime-charset))
         )
     charset)
    ;; Use coding system Emacs knows.
@@ -160,7 +160,7 @@ is not available."
           form
           (prog2
               ;; Avoid errors...
-              (condition-case nil (eval form) (error nil))
+              (condition-case nil (eval form t) (error nil))
               ;; (message "Failed to eval `%s'" form))
               (mm-coding-system-p cs)
             (message "Added charset `%s' via `mm-charset-eval-alist'" cs))
diff --git a/lisp/gnus/mm-view.el b/lisp/gnus/mm-view.el
index 266f471..3e36d67 100644
--- a/lisp/gnus/mm-view.el
+++ b/lisp/gnus/mm-view.el
@@ -1,4 +1,4 @@
-;;; mm-view.el --- functions for viewing MIME objects
+;;; mm-view.el --- functions for viewing MIME objects  -*- lexical-binding: t; 
-*-
 
 ;; Copyright (C) 1998-2021 Free Software Foundation, Inc.
 
@@ -104,11 +104,10 @@ This is only used if `mm-inline-large-images' is set to
     (insert "\n")
     (mm-handle-set-undisplayer
      handle
-     `(lambda ()
-       (let ((b ,b)
-             (inhibit-read-only t))
-         (remove-images b b)
-         (delete-region b (1+ b)))))))
+     (lambda ()
+       (let ((inhibit-read-only t))
+        (remove-images b b)
+        (delete-region b (1+ b)))))))
 
 (defvar mm-w3m-setup nil
   "Whether gnus-article-mode has been setup to use emacs-w3m.")
@@ -137,7 +136,7 @@ This is only used if `mm-inline-large-images' is set to
                 (equal "multipart" (mm-handle-media-supertype elem)))
        (mm-w3m-cid-retrieve-1 url elem)))))
 
-(defun mm-w3m-cid-retrieve (url &rest args)
+(defun mm-w3m-cid-retrieve (url &rest _args)
   "Insert a content pointed by URL if it has the cid: scheme."
   (when (string-match "\\`cid:" url)
     (or (catch 'found-handle
@@ -149,6 +148,9 @@ This is only used if `mm-inline-large-images' is set to
            nil
          (message "Failed to find \"Content-ID: %s\"" url)))))
 
+(defvar w3m-force-redisplay)
+(defvar w3m-safe-url-regexp)
+
 (defun mm-inline-text-html-render-with-w3m (handle)
   "Render a text/html part using emacs-w3m."
   (mm-setup-w3m)
@@ -199,10 +201,11 @@ This is only used if `mm-inline-large-images' is set to
                               'keymap w3m-minor-mode-map)))
        (mm-handle-set-undisplayer
         handle
-        `(lambda ()
-           (let ((inhibit-read-only t))
-             (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)))))))))
 
 (defcustom mm-w3m-standalone-supports-m17n-p 'undecided
   "T means the w3m command supports the m17n feature."
@@ -378,10 +381,11 @@ This is only used if `mm-inline-large-images' is set to
        handle
        (if (= (point-min) (point-max))
           #'ignore
-        `(lambda ()
-           (let ((inhibit-read-only t))
-             (delete-region ,(copy-marker (point-min) t)
-                            ,(point-max-marker)))))))))
+        (let ((beg (copy-marker (point-min) t))
+              (end (point-max-marker)))
+          (lambda ()
+            (let ((inhibit-read-only t))
+              (delete-region beg end)))))))))
 
 (defun mm-insert-inline (handle text)
   "Insert TEXT inline from HANDLE."
@@ -391,12 +395,13 @@ This is only used if `mm-inline-large-images' is set to
       (insert "\n"))
     (mm-handle-set-undisplayer
      handle
-     `(lambda ()
-       (let ((inhibit-read-only t))
-         (delete-region ,(copy-marker b t)
-                        ,(point-marker)))))))
+     (let ((beg (copy-marker b t))
+           (end (point-marker)))
+       (lambda ()
+        (let ((inhibit-read-only t))
+          (delete-region beg end)))))))
 
-(defun mm-inline-audio (handle)
+(defun mm-inline-audio (_handle)
   (message "Not implemented"))
 
 (defun mm-view-message ()
@@ -413,6 +418,10 @@ This is only used if `mm-inline-large-images' is set to
   (fundamental-mode)
   (goto-char (point-min)))
 
+(defvar gnus-original-article-buffer)
+(defvar gnus-article-prepare-hook)
+(defvar gnus-displaying-mime)
+
 (defun mm-inline-message (handle)
   (let ((b (point))
        (bolp (bolp))
@@ -450,9 +459,11 @@ This is only used if `mm-inline-large-images' is set to
                (mm-merge-handles gnus-article-mime-handles handles)))
        (mm-handle-set-undisplayer
         handle
-        `(lambda ()
-           (let ((inhibit-read-only t))
-             (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)))))))))
 
 ;; Shut up byte-compiler.
 (defvar font-lock-mode-hook)
diff --git a/lisp/gnus/mml-sec.el b/lisp/gnus/mml-sec.el
index a050fe0..8d01d15 100644
--- a/lisp/gnus/mml-sec.el
+++ b/lisp/gnus/mml-sec.el
@@ -1,4 +1,4 @@
-;;; mml-sec.el --- A package with security functions for MML documents
+;;; mml-sec.el --- A package with security functions for MML documents  -*- 
lexical-binding: t; -*-
 
 ;; Copyright (C) 2000-2021 Free Software Foundation, Inc.
 
@@ -622,7 +622,7 @@ Passphrase caching in Emacs is NOT recommended.  Use 
gpg-agent instead."
                    mml-smime-passphrase-cache-expiry)
               mml-secure-passphrase-cache-expiry))))
 
-(defun mml-secure-passphrase-callback (context key-id standard)
+(defun mml-secure-passphrase-callback (context key-id _standard)
   "Ask for passphrase in CONTEXT for KEY-ID for STANDARD.
 The passphrase is read and cached."
   ;; Based on mml2015-epg-passphrase-callback.
@@ -906,7 +906,7 @@ If no one is selected, symmetric encryption will be 
performed.  "
        (error "No recipient specified")))
     recipients))
 
-(defun mml-secure-epg-encrypt (protocol cont &optional sign)
+(defun mml-secure-epg-encrypt (protocol _cont &optional sign)
   ;; Based on code appearing inside mml2015-epg-encrypt.
   (let* ((context (epg-make-context protocol))
         (config (epg-find-configuration 'OpenPGP))
diff --git a/lisp/gnus/mml-smime.el b/lisp/gnus/mml-smime.el
index e97e3e9..5c133e6 100644
--- a/lisp/gnus/mml-smime.el
+++ b/lisp/gnus/mml-smime.el
@@ -1,4 +1,4 @@
-;;; mml-smime.el --- S/MIME support for MML
+;;; mml-smime.el --- S/MIME support for MML  -*- lexical-binding: t; -*-
 
 ;; Copyright (C) 2000-2021 Free Software Foundation, Inc.
 
@@ -129,7 +129,7 @@ Whether the passphrase is cached at all is controlled by
     (if func
        (funcall func handle ctl))))
 
-(defun mml-smime-openssl-sign (cont)
+(defun mml-smime-openssl-sign (_cont)
   (when (null smime-keys)
     (customize-variable 'smime-keys)
     (error "No S/MIME keys configured, use customize to add your key"))
@@ -309,7 +309,7 @@ Whether the passphrase is cached at all is controlled by
                 (buffer-string) "\n")))))
   handle)
 
-(defun mml-smime-openssl-verify-test (handle ctl)
+(defun mml-smime-openssl-verify-test (_handle _ctl)
   smime-openssl-program)
 
 (defvar epg-user-id-alist)
@@ -369,8 +369,8 @@ Content-Disposition: attachment; filename=smime.p7s
       (goto-char (point-max)))))
 
 (defun mml-smime-epg-encrypt (cont)
-  (let* ((inhibit-redisplay t)
-        (boundary (mml-compute-boundary cont))
+  (let* ((inhibit-redisplay t)        ;FIXME: Why?
+        ;; (boundary (mml-compute-boundary cont))
         (cipher (mml-secure-epg-encrypt 'CMS cont)))
     (delete-region (point-min) (point-max))
     (goto-char (point-min))
@@ -388,7 +388,7 @@ Content-Disposition: attachment; filename=smime.p7m
 (defun mml-smime-epg-verify (handle ctl)
   (catch 'error
     (let ((inhibit-redisplay t)
-         context plain signature-file part signature)
+         context part signature) ;; plain signature-file
       (when (or (null (setq part (mm-find-raw-part-by-type
                                  ctl (or (mm-handle-multipart-ctl-parameter
                                           ctl 'protocol)
@@ -407,19 +407,20 @@ Content-Disposition: attachment; filename=smime.p7m
       (setq part (replace-regexp-in-string "\n" "\r\n" part)
            context (epg-make-context 'CMS))
       (condition-case error
-         (setq plain (epg-verify-string context (mm-get-part signature) part))
+         ;; (setq plain
+         (epg-verify-string context (mm-get-part signature) part) ;;)
        (error
         (mm-sec-error 'gnus-info "Failed")
-        (if (eq (car error) 'quit)
-            (mm-sec-status 'gnus-details "Quit.")
-          (mm-sec-status 'gnus-details (format "%S" error)))
+        (mm-sec-status 'gnus-details (if (eq (car error) 'quit)
+                                         "Quit."
+                                       (format "%S" error)))
         (throw 'error handle)))
       (mm-sec-status
        'gnus-info
        (epg-verify-result-to-string (epg-context-result-for context 'verify)))
       handle)))
 
-(defun mml-smime-epg-verify-test (handle ctl)
+(defun mml-smime-epg-verify-test (_handle _ctl)
   t)
 
 (provide 'mml-smime)
diff --git a/lisp/gnus/mml.el b/lisp/gnus/mml.el
index acde958..f77e5c6 100644
--- a/lisp/gnus/mml.el
+++ b/lisp/gnus/mml.el
@@ -1,4 +1,4 @@
-;;; mml.el --- A package for parsing and validating MML documents
+;;; mml.el --- A package for parsing and validating MML documents  -*- 
lexical-binding: t; -*-
 
 ;; Copyright (C) 1998-2021 Free Software Foundation, Inc.
 
@@ -241,34 +241,37 @@ part.  This is for the internal use, you should never 
modify the value.")
               (method (cdr (assq 'method taginfo)))
               tags)
          (save-excursion
-           (if (re-search-forward
-                "<#/?\\(multipart\\|part\\|external\\|mml\\)." nil t)
-               (setq secure-mode "multipart")
-             (setq secure-mode "part")))
+           (setq secure-mode
+                 (if (re-search-forward
+                      "<#/?\\(multipart\\|part\\|external\\|mml\\)."
+                      nil t)
+                     "multipart"
+                   "part")))
          (save-excursion
            (goto-char location)
            (re-search-forward "<#secure[^\n]*>\n"))
          (delete-region (match-beginning 0) (match-end 0))
-         (cond ((string= mode "sign")
-                (setq tags (list "sign" method)))
-               ((string= mode "encrypt")
-                (setq tags (list "encrypt" method)))
-               ((string= mode "signencrypt")
-                (setq tags (list "sign" method "encrypt" method)))
-               (t
-                (error "Unknown secure mode %s" mode)))
-         (eval `(mml-insert-tag ,secure-mode
-                                ,@tags
-                                ,(if keyfile "keyfile")
-                                ,keyfile
-                                ,@(apply #'append
-                                         (mapcar (lambda (certfile)
-                                                   (list "certfile" certfile))
-                                                 certfiles))
-                                ,(if recipients "recipients")
-                                ,recipients
-                                ,(if sender "sender")
-                                ,sender))
+         (setq tags (cond ((string= mode "sign")
+                           (list "sign" method))
+                          ((string= mode "encrypt")
+                           (list "encrypt" method))
+                          ((string= mode "signencrypt")
+                           (list "sign" method "encrypt" method))
+                          (t
+                           (error "Unknown secure mode %s" mode))))
+         (apply #'mml-insert-tag
+                secure-mode
+                `(,@tags
+                  ,(if keyfile "keyfile")
+                  ,keyfile
+                  ,@(apply #'append
+                           (mapcar (lambda (certfile)
+                                     (list "certfile" certfile))
+                                   certfiles))
+                  ,(if recipients "recipients")
+                  ,recipients
+                  ,(if sender "sender")
+                  ,sender))
          ;; restart the parse
          (goto-char location)))
        ((looking-at "<#multipart")
@@ -1456,7 +1459,7 @@ will be computed and used."
                 (file-name-nondirectory file)))
       (goto-char head))))
 
-(defun mml-dnd-attach-file (uri action)
+(defun mml-dnd-attach-file (uri _action)
   "Attach a drag and drop file.
 
 Ask for type, description or disposition according to
@@ -1587,6 +1590,16 @@ Should be adopted if code in `message-send-mail' is 
changed."
 (declare-function message-generate-headers      "message" (headers))
 (declare-function message-sort-headers          "message" ())
 
+(defvar gnus-newsgroup-name)
+(defvar gnus-displaying-mime)
+(defvar gnus-newsgroup-name)
+(defvar gnus-article-prepare-hook)
+(defvar gnus-newsgroup-charset)
+(defvar gnus-original-article-buffer)
+(defvar gnus-message-buffer)
+(defvar message-this-is-news)
+(defvar message-this-is-mail)
+
 (defun mml-preview (&optional raw)
   "Display current buffer with Gnus, in a new buffer.
 If RAW, display a raw encoded MIME message.
@@ -1598,7 +1611,8 @@ or the `pop-to-buffer' function."
   (interactive "P")
   (setq mml-preview-buffer (generate-new-buffer
                            (concat (if raw "*Raw MIME preview of "
-                                     "*MIME preview of ") (buffer-name))))
+                                     "*MIME preview of ")
+                                   (buffer-name))))
   (require 'gnus-msg)                ; for gnus-setup-posting-charset
   (save-excursion
     (let* ((buf (current-buffer))
@@ -1655,7 +1669,8 @@ or the `pop-to-buffer' function."
       (use-local-map nil)
       (add-hook 'kill-buffer-hook
                (lambda ()
-                 (mm-destroy-parts gnus-article-mime-handles)) nil t)
+                 (mm-destroy-parts gnus-article-mime-handles))
+               nil t)
       (setq buffer-read-only t)
       (local-set-key "q" (lambda () (interactive) (kill-buffer nil)))
       (local-set-key "=" (lambda () (interactive) (delete-other-windows)))
@@ -1704,7 +1719,7 @@ or the `pop-to-buffer' function."
       cont)
     (let ((alist mml-tweak-sexp-alist))
       (while alist
-       (if (eval (caar alist))
+       (if (eval (caar alist) t)
            (funcall (cdar alist) cont))
        (setq alist (cdr alist)))))
   cont)
diff --git a/lisp/gnus/mml1991.el b/lisp/gnus/mml1991.el
index a87e642..05f44a1 100644
--- a/lisp/gnus/mml1991.el
+++ b/lisp/gnus/mml1991.el
@@ -1,4 +1,4 @@
-;;; mml1991.el --- Old PGP message format (RFC 1991) support for MML
+;;; mml1991.el --- Old PGP message format (RFC 1991) support for MML  -*- 
lexical-binding: t; -*-
 
 ;; Copyright (C) 1998-2021 Free Software Foundation, Inc.
 
@@ -82,7 +82,7 @@ Whether the passphrase is cached at all is controlled by
 (defvar mml1991-decrypt-function 'mailcrypt-decrypt)
 (defvar mml1991-verify-function 'mailcrypt-verify)
 
-(defun mml1991-mailcrypt-sign (cont)
+(defun mml1991-mailcrypt-sign (_cont)
   (let ((text (current-buffer))
        headers signature
        (result-buffer (get-buffer-create "*GPG Result*")))
@@ -118,7 +118,7 @@ Whether the passphrase is cached at all is controlled by
 (declare-function mc-encrypt-generic "ext:mc-toplev"
                   (&optional recipients scheme start end from sign))
 
-(defun mml1991-mailcrypt-encrypt (cont &optional sign)
+(defun mml1991-mailcrypt-encrypt (_cont &optional sign)
   (let ((text (current-buffer))
        (mc-pgp-always-sign
         (or mc-pgp-always-sign
@@ -171,8 +171,9 @@ Whether the passphrase is cached at all is controlled by
 (defvar pgg-default-user-id)
 (defvar pgg-errors-buffer)
 (defvar pgg-output-buffer)
+(defvar pgg-text-mode)
 
-(defun mml1991-pgg-sign (cont)
+(defun mml1991-pgg-sign (_cont)
   (let ((pgg-text-mode t)
        (pgg-default-user-id (or (message-options-get 'mml-sender)
                                 pgg-default-user-id))
@@ -209,7 +210,7 @@ Whether the passphrase is cached at all is controlled by
        (buffer-string)))
     t))
 
-(defun mml1991-pgg-encrypt (cont &optional sign)
+(defun mml1991-pgg-encrypt (_cont &optional sign)
   (goto-char (point-min))
   (when (re-search-forward "^$" nil t)
     (let ((cte (save-restriction
@@ -257,7 +258,7 @@ Whether the passphrase is cached at all is controlled by
 (autoload 'epg-configuration "epg-config")
 (autoload 'epg-expand-group "epg-config")
 
-(defun mml1991-epg-sign (cont)
+(defun mml1991-epg-sign (_cont)
   (let ((inhibit-redisplay t)
        headers cte)
     ;; Don't sign headers.
diff --git a/lisp/gnus/mml2015.el b/lisp/gnus/mml2015.el
index 8eda593..751f3b0 100644
--- a/lisp/gnus/mml2015.el
+++ b/lisp/gnus/mml2015.el
@@ -1,4 +1,4 @@
-;;; mml2015.el --- MIME Security with Pretty Good Privacy (PGP)
+;;; mml2015.el --- MIME Security with Pretty Good Privacy (PGP)  -*- 
lexical-binding: t; -*-
 
 ;; Copyright (C) 2000-2021 Free Software Foundation, Inc.
 
@@ -185,7 +185,7 @@ If set, it overrides the setting of 
`mml2015-sign-with-sender'."
       (cadr err)
     (format "%S" (cdr err))))
 
-(defun mml2015-mailcrypt-decrypt (handle ctl)
+(defun mml2015-mailcrypt-decrypt (handle _ctl)
   (catch 'error
     (let (child handles result)
       (unless (setq child (mm-find-part-by-type
@@ -479,6 +479,7 @@ If set, it overrides the setting of 
`mml2015-sign-with-sender'."
 (defvar pgg-default-user-id)
 (defvar pgg-errors-buffer)
 (defvar pgg-output-buffer)
+(defvar pgg-text-mode)
 
 (autoload 'pgg-decrypt-region "pgg")
 (autoload 'pgg-verify-region "pgg")
@@ -486,10 +487,10 @@ If set, it overrides the setting of 
`mml2015-sign-with-sender'."
 (autoload 'pgg-encrypt-region "pgg")
 (autoload 'pgg-parse-armor "pgg-parse")
 
-(defun mml2015-pgg-decrypt (handle ctl)
+(defun mml2015-pgg-decrypt (handle _ctl)
   (catch 'error
     (let ((pgg-errors-buffer mml2015-result-buffer)
-         child handles result decrypt-status)
+         child handles decrypt-status) ;; result
       (unless (setq child (mm-find-part-by-type
                           (cdr handle)
                           "application/octet-stream" nil t))
@@ -751,7 +752,7 @@ If set, it overrides the setting of 
`mml2015-sign-with-sender'."
   (let ((key-image (mml2015-epg-key-image key-id)))
     (if (not key-image)
        ""
-      (condition-case error
+      (condition-case nil
          (let ((result "  "))
            (put-text-property
             1 2 'display
@@ -770,10 +771,10 @@ If set, it overrides the setting of 
`mml2015-sign-with-sender'."
 (defun mml2015-epg-verify-result-to-string (verify-result)
   (mapconcat #'mml2015-epg-signature-to-string verify-result "\n"))
 
-(defun mml2015-epg-decrypt (handle ctl)
+(defun mml2015-epg-decrypt (handle _ctl)
   (catch 'error
     (let ((inhibit-redisplay t)
-         context plain child handles result decrypt-status)
+         context plain child handles) ;; decrypt-status result
       (unless (setq child (mm-find-part-by-type
                           (cdr handle)
                           "application/octet-stream" nil t))
@@ -851,7 +852,7 @@ If set, it overrides the setting of 
`mml2015-sign-with-sender'."
 (defun mml2015-epg-verify (handle ctl)
   (catch 'error
     (let ((inhibit-redisplay t)
-         context plain signature-file part signature)
+         context part signature) ;; signature-file plain
       (when (or (null (setq part (mm-find-raw-part-by-type
                                  ctl (or (mm-handle-multipart-ctl-parameter
                                           ctl 'protocol)
@@ -866,12 +867,13 @@ If set, it overrides the setting of 
`mml2015-sign-with-sender'."
            signature (mm-get-part signature)
            context (epg-make-context))
       (condition-case error
-         (setq plain (epg-verify-string context signature part))
+         ;; (setq plain
+         (epg-verify-string context signature part) ;;)
        (error
         (mm-sec-error 'gnus-info "Failed")
-        (if (eq (car error) 'quit)
-            (mm-sec-status 'gnus-details "Quit.")
-          (mm-sec-status 'gnus-details (mml2015-format-error error)))
+        (mm-sec-status 'gnus-details (if (eq (car error) 'quit)
+                                         "Quit."
+                                       (mml2015-format-error error)))
         (throw 'error handle)))
       (mm-sec-status 'gnus-info
        (mml2015-epg-verify-result-to-string
@@ -978,7 +980,7 @@ If set, it overrides the setting of 
`mml2015-sign-with-sender'."
       handle)))
 
 ;;;###autoload
-(defun mml2015-decrypt-test (handle ctl)
+(defun mml2015-decrypt-test (_handle _ctl)
   mml2015-use)
 
 ;;;###autoload
@@ -990,7 +992,7 @@ If set, it overrides the setting of 
`mml2015-sign-with-sender'."
       handle)))
 
 ;;;###autoload
-(defun mml2015-verify-test (handle ctl)
+(defun mml2015-verify-test (_handle _ctl)
   mml2015-use)
 
 ;;;###autoload
diff --git a/lisp/gnus/nnagent.el b/lisp/gnus/nnagent.el
index 1f21eee..76a7e21 100644
--- a/lisp/gnus/nnagent.el
+++ b/lisp/gnus/nnagent.el
@@ -1,4 +1,4 @@
-;;; nnagent.el --- offline backend for Gnus
+;;; nnagent.el --- offline backend for Gnus  -*- lexical-binding: t; -*-
 
 ;; Copyright (C) 1997-2021 Free Software Foundation, Inc.
 
@@ -86,7 +86,7 @@
                       server dir)
       t))))
 
-(deffoo nnagent-retrieve-groups (groups &optional server)
+(deffoo nnagent-retrieve-groups (_groups &optional _server)
   (save-excursion
     (cond
      ((file-exists-p (gnus-agent-lib-file "groups"))
@@ -106,13 +106,13 @@
        (funcall (gnus-get-function gnus-command-method 'request-type)
                 (gnus-group-real-name group) article)))))
 
-(deffoo nnagent-request-newgroups (date server)
+(deffoo nnagent-request-newgroups (_date _server)
   nil)
 
-(deffoo nnagent-request-update-info (group info &optional server)
+(deffoo nnagent-request-update-info (_group _info &optional _server)
   nil)
 
-(deffoo nnagent-request-post (&optional server)
+(deffoo nnagent-request-post (&optional _server)
   (gnus-agent-insert-meta-information 'news gnus-command-method)
   (gnus-request-accept-article "nndraft:queue" nil t t))
 
@@ -184,7 +184,7 @@
        t)
       'nov)))
 
-(deffoo nnagent-request-expire-articles (articles group &optional server force)
+(deffoo nnagent-request-expire-articles (articles _group &optional _server 
_force)
   articles)
 
 (deffoo nnagent-request-group (group &optional server dont-check info)
@@ -249,7 +249,7 @@
   (nnoo-parent-function 'nnagent 'nnml-request-regenerate
                        (list (nnagent-server server))))
 
-(deffoo nnagent-retrieve-group-data-early (server infos)
+(deffoo nnagent-retrieve-group-data-early (_server _infos)
   nil)
 
 ;; Use nnml functions for just about everything.
diff --git a/lisp/gnus/nnbabyl.el b/lisp/gnus/nnbabyl.el
index 130f56a..3e6f9e8 100644
--- a/lisp/gnus/nnbabyl.el
+++ b/lisp/gnus/nnbabyl.el
@@ -1,4 +1,4 @@
-;;; nnbabyl.el --- rmail mbox access for Gnus
+;;; nnbabyl.el --- rmail mbox access for Gnus  -*- lexical-binding: t; -*-
 
 ;; Copyright (C) 1995-2021 Free Software Foundation, Inc.
 
@@ -70,7 +70,7 @@
 
 (nnoo-define-basics nnbabyl)
 
-(deffoo nnbabyl-retrieve-headers (articles &optional group server fetch-old)
+(deffoo nnbabyl-retrieve-headers (articles &optional group server _fetch-old)
   (with-current-buffer nntp-server-buffer
     (erase-buffer)
     (let ((number (length articles))
@@ -185,7 +185,7 @@
              (cons nnbabyl-current-group article)
            (nnbabyl-article-group-number)))))))
 
-(deffoo nnbabyl-request-group (group &optional server dont-check info)
+(deffoo nnbabyl-request-group (group &optional server dont-check _info)
   (let ((active (cadr (assoc group nnbabyl-group-alist))))
     (save-excursion
       (cond
@@ -224,10 +224,10 @@
         (insert-buffer-substring in-buf)))
      (nnmail-save-active nnbabyl-group-alist nnbabyl-active-file))))
 
-(deffoo nnbabyl-close-group (group &optional server)
+(deffoo nnbabyl-close-group (_group &optional _server)
   t)
 
-(deffoo nnbabyl-request-create-group (group &optional server args)
+(deffoo nnbabyl-request-create-group (group &optional _server _args)
   (nnmail-activate 'nnbabyl)
   (unless (assoc group nnbabyl-group-alist)
     (push (list group (cons 1 0))
@@ -235,18 +235,20 @@
     (nnmail-save-active nnbabyl-group-alist nnbabyl-active-file))
   t)
 
-(deffoo nnbabyl-request-list (&optional server)
+(deffoo nnbabyl-request-list (&optional _server)
   (save-excursion
     (nnmail-find-file nnbabyl-active-file)
     (setq nnbabyl-group-alist (nnmail-get-active))
     t))
 
-(deffoo nnbabyl-request-newgroups (date &optional server)
+(deffoo nnbabyl-request-newgroups (_date &optional server)
   (nnbabyl-request-list server))
 
-(deffoo nnbabyl-request-list-newsgroups (&optional server)
+(deffoo nnbabyl-request-list-newsgroups (&optional _server)
   (nnheader-report 'nnbabyl "nnbabyl: LIST NEWSGROUPS is not implemented."))
 
+(defvar nnml-current-directory)
+
 (deffoo nnbabyl-request-expire-articles
     (articles newsgroup &optional server force)
   (nnbabyl-possibly-change-newsgroup newsgroup server)
@@ -263,7 +265,8 @@
                    (nnmail-expired-article-p
                     newsgroup
                     (buffer-substring
-                     (point) (progn (end-of-line) (point))) force))
+                     (point) (progn (end-of-line) (point)))
+                    force))
              (progn
                (unless (eq nnmail-expiry-target 'delete)
                  (with-temp-buffer
@@ -292,7 +295,7 @@
       (nconc rest articles))))
 
 (deffoo nnbabyl-request-move-article
-    (article group server accept-form &optional last move-is-internal)
+    (article group server accept-form &optional last _move-is-internal)
   (let ((buf (gnus-get-buffer-create " *nnbabyl move*"))
        result)
     (and
@@ -304,7 +307,7 @@
               "^X-Gnus-Newsgroup:"
               (save-excursion (search-forward "\n\n" nil t) (point)) t)
         (delete-region (point-at-bol) (progn (forward-line 1) (point))))
-       (setq result (eval accept-form))
+       (setq result (eval accept-form t))
        (kill-buffer (current-buffer))
        result)
      (save-excursion
@@ -554,13 +557,12 @@
               (with-current-buffer nnbabyl-mbox-buffer
                 (= (buffer-size) (nnheader-file-size nnbabyl-mbox-file))))
     ;; This buffer has changed since we read it last.  Possibly.
-    (save-excursion
-      (let ((delim (concat "^" nnbabyl-mail-delimiter))
-           (alist nnbabyl-group-alist)
-           start end number)
-       (set-buffer (setq nnbabyl-mbox-buffer
-                         (nnheader-find-file-noselect
-                          nnbabyl-mbox-file nil t)))
+    (let ((delim (concat "^" nnbabyl-mail-delimiter))
+          (alist nnbabyl-group-alist)
+          start end number)
+      (with-current-buffer (setq nnbabyl-mbox-buffer
+                                 (nnheader-find-file-noselect
+                                  nnbabyl-mbox-file nil t))
        ;; Save previous buffer mode.
        (setq nnbabyl-previous-buffer-mode
              (cons (cons (point-min) (point-max))
diff --git a/lisp/gnus/nndiary.el b/lisp/gnus/nndiary.el
index c1ac3cc..15003fa 100644
--- a/lisp/gnus/nndiary.el
+++ b/lisp/gnus/nndiary.el
@@ -1,4 +1,4 @@
-;;; nndiary.el --- A diary back end for Gnus
+;;; nndiary.el --- A diary back end for Gnus  -*- lexical-binding: t; -*-
 
 ;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
@@ -149,7 +149,6 @@ In order to make this clear, here are some examples:
 
 - (360 . minute): for an appointment at 18:30 and 15 seconds, this would
   pop up the appointment message at 12:30."
-  :group 'nndiary
   :type '(repeat (cons :format "%v\n"
                       (integer :format "%v")
                       (choice :format "%[%v(s)%] before...\n"
@@ -163,8 +162,7 @@ In order to make this clear, here are some examples:
 
 (defcustom nndiary-week-starts-on-monday nil
   "Whether a week starts on monday (otherwise, sunday)."
-  :type 'boolean
-  :group 'nndiary)
+  :type 'boolean)
 
 
 (define-obsolete-variable-alias 'nndiary-request-create-group-hooks
@@ -172,7 +170,6 @@ In order to make this clear, here are some examples:
 (defcustom nndiary-request-create-group-functions nil
   "Hook run after `nndiary-request-create-group' is executed.
 The hook functions will be called with the full group name as argument."
-  :group 'nndiary
   :type 'hook)
 
 (define-obsolete-variable-alias 'nndiary-request-update-info-hooks
@@ -180,7 +177,6 @@ The hook functions will be called with the full group name 
as argument."
 (defcustom nndiary-request-update-info-functions nil
   "Hook run after `nndiary-request-update-info' is executed.
 The hook functions will be called with the full group name as argument."
-  :group 'nndiary
   :type 'hook)
 
 (define-obsolete-variable-alias 'nndiary-request-accept-article-hooks
@@ -189,12 +185,10 @@ The hook functions will be called with the full group 
name as argument."
   "Hook run before accepting an article.
 Executed near the beginning of `nndiary-request-accept-article'.
 The hook functions will be called with the article in the current buffer."
-  :group 'nndiary
   :type 'hook)
 
 (defcustom nndiary-check-directory-twice t
   "If t, check directories twice to avoid NFS failures."
-  :group 'nndiary
   :type 'boolean)
 
 
@@ -475,7 +469,7 @@ all.  This may very well take some time.")
       (cons (if group-num (car group-num) group)
            (string-to-number (file-name-nondirectory path)))))))
 
-(deffoo nndiary-request-group (group &optional server dont-check info)
+(deffoo nndiary-request-group (group &optional server dont-check _info)
   (let ((file-name-coding-system nnmail-pathname-coding-system))
     (cond
      ((not (nndiary-possibly-change-directory group server))
@@ -509,11 +503,11 @@ all.  This may very well take some time.")
     (nndiary-possibly-change-directory group server)
     (nnmail-get-new-mail 'nndiary 'nndiary-save-nov nndiary-directory group)))
 
-(deffoo nndiary-close-group (group &optional server)
+(deffoo nndiary-close-group (_group &optional _server)
   (setq nndiary-article-file-alist nil)
   t)
 
-(deffoo nndiary-request-create-group (group &optional server args)
+(deffoo nndiary-request-create-group (group &optional server _args)
   (nndiary-possibly-change-directory nil server)
   (nnmail-activate 'nndiary)
   (cond
@@ -541,7 +535,7 @@ all.  This may very well take some time.")
       t))
    ))
 
-(deffoo nndiary-request-list (&optional server)
+(deffoo nndiary-request-list (&optional _server)
   (save-excursion
     (let ((nnmail-file-coding-system nnmail-active-file-coding-system)
          (file-name-coding-system nnmail-pathname-coding-system))
@@ -549,10 +543,10 @@ all.  This may very well take some time.")
     (setq nndiary-group-alist (nnmail-get-active))
     t))
 
-(deffoo nndiary-request-newgroups (date &optional server)
+(deffoo nndiary-request-newgroups (_date &optional server)
   (nndiary-request-list server))
 
-(deffoo nndiary-request-list-newsgroups (&optional server)
+(deffoo nndiary-request-list-newsgroups (&optional _server)
   (save-excursion
     (nnmail-find-file nndiary-newsgroups-file)))
 
@@ -596,7 +590,7 @@ all.  This may very well take some time.")
     (nconc rest articles)))
 
 (deffoo nndiary-request-move-article
-    (article group server accept-form &optional last move-is-internal)
+    (article group server accept-form &optional last _move-is-internal)
   (let ((buf (gnus-get-buffer-create " *nndiary move*"))
        result)
     (nndiary-possibly-change-directory group server)
@@ -609,7 +603,7 @@ all.  This may very well take some time.")
           nndiary-article-file-alist)
        (with-current-buffer buf
         (insert-buffer-substring nntp-server-buffer)
-        (setq result (eval accept-form))
+        (setq result (eval accept-form t))
         (kill-buffer (current-buffer))
         result))
      (progn
@@ -772,7 +766,7 @@ all.  This may very well take some time.")
 
 ;;; Interface optional functions ============================================
 
-(deffoo nndiary-request-update-info (group info &optional server)
+(deffoo nndiary-request-update-info (group info &optional _server)
   (nndiary-possibly-change-directory group)
   (let ((timestamp (gnus-group-parameter-value (gnus-info-params info)
                                               'timestamp t)))
@@ -1039,6 +1033,8 @@ all.  This may very well take some time.")
   ;; Save the active file.
   (nnmail-save-active nndiary-group-alist nndiary-active-file))
 
+(defvar nndiary-files) ; dynamically bound in nndiary-generate-nov-databases-1
+
 (defun nndiary-generate-nov-databases-1 (dir &optional seen no-active)
   "Regenerate the NOV database in DIR."
   (interactive "DRegenerate NOV in: ")
@@ -1068,7 +1064,6 @@ all.  This may very well take some time.")
        (unless no-active
          (nnmail-save-active nndiary-group-alist nndiary-active-file))))))
 
-(defvar nndiary-files) ; dynamically bound in nndiary-generate-nov-databases-1
 (defun nndiary-generate-active-info (dir)
   ;; Update the active info for this group.
   (let* ((group (nnheader-file-to-group
diff --git a/lisp/gnus/nndir.el b/lisp/gnus/nndir.el
index 46351d0..bfc2283 100644
--- a/lisp/gnus/nndir.el
+++ b/lisp/gnus/nndir.el
@@ -1,4 +1,4 @@
-;;; nndir.el --- single directory newsgroup access for Gnus
+;;; nndir.el --- single directory newsgroup access for Gnus  -*- 
lexical-binding: t; -*-
 
 ;; Copyright (C) 1995-2021 Free Software Foundation, Inc.
 
diff --git a/lisp/gnus/nndoc.el b/lisp/gnus/nndoc.el
index c68e201..172433e 100644
--- a/lisp/gnus/nndoc.el
+++ b/lisp/gnus/nndoc.el
@@ -1,4 +1,4 @@
-;;; nndoc.el --- single file access for Gnus
+;;; nndoc.el --- single file access for Gnus  -*- lexical-binding: t; -*-
 
 ;; Copyright (C) 1995-2021 Free Software Foundation, Inc.
 
@@ -225,7 +225,7 @@ from the document.")
 
 (nnoo-define-basics nndoc)
 
-(deffoo nndoc-retrieve-headers (articles &optional newsgroup server fetch-old)
+(deffoo nndoc-retrieve-headers (articles &optional newsgroup server _fetch-old)
   (when (nndoc-possibly-change-buffer newsgroup server)
     (with-current-buffer nntp-server-buffer
       (erase-buffer)
@@ -256,11 +256,10 @@ from the document.")
 
 (deffoo nndoc-request-article (article &optional newsgroup server buffer)
   (nndoc-possibly-change-buffer newsgroup server)
-  (save-excursion
-    (let ((buffer (or buffer nntp-server-buffer))
-         (entry (cdr (assq article nndoc-dissection-alist)))
-         beg)
-      (set-buffer buffer)
+  (let ((buffer (or buffer nntp-server-buffer))
+        (entry (cdr (assq article nndoc-dissection-alist)))
+        beg)
+    (with-current-buffer buffer
       (erase-buffer)
       (when entry
        (cond
@@ -281,7 +280,7 @@ from the document.")
            (funcall nndoc-article-transform-function article))
          t))))))
 
-(deffoo nndoc-request-group (group &optional server dont-check info)
+(deffoo nndoc-request-group (group &optional server dont-check _info)
   "Select news GROUP."
   (let (number)
     (cond
@@ -302,7 +301,7 @@ from the document.")
     (nndoc-request-group group server))
   t)
 
-(deffoo nndoc-request-type (group &optional article)
+(deffoo nndoc-request-type (_group &optional article)
   (cond ((not article) 'unknown)
        (nndoc-post-type nndoc-post-type)
        (t 'unknown)))
@@ -318,19 +317,19 @@ from the document.")
   (setq nndoc-dissection-alist nil)
   t)
 
-(deffoo nndoc-request-list (&optional server)
+(deffoo nndoc-request-list (&optional _server)
   t)
 
-(deffoo nndoc-request-newgroups (date &optional server)
+(deffoo nndoc-request-newgroups (_date &optional _server)
   nil)
 
-(deffoo nndoc-request-list-newsgroups (&optional server)
+(deffoo nndoc-request-list-newsgroups (&optional _server)
   nil)
 
 
 ;;; Internal functions.
 
-(defun nndoc-possibly-change-buffer (group source)
+(defun nndoc-possibly-change-buffer (group _source)
   (let (buf)
     (cond
      ;; The current buffer is this group's buffer.
@@ -678,7 +677,7 @@ from the document.")
        (search-forward "\ncommit " nil t)
        (search-forward "\nAuthor: " nil t)))
 
-(defun nndoc-transform-git-article (article)
+(defun nndoc-transform-git-article (_article)
   (goto-char (point-min))
   (when (re-search-forward "^Author: " nil t)
     (replace-match "From: " t t)))
@@ -702,7 +701,7 @@ from the document.")
          (re-search-forward "^\\\\\\\\\n\\(Paper\\( (\\*cross-listing\\*)\\)?: 
[a-zA-Z\\.-]+/[0-9]+\\|arXiv:\\)" nil t))
     t))
 
-(defun nndoc-transform-lanl-gov-announce (article)
+(defun nndoc-transform-lanl-gov-announce (_article)
   (let ((case-fold-search nil))
     (goto-char (point-max))
     (when (re-search-backward "^\\\\\\\\ +( *\\([^ ]*\\) , *\\([^ ]*\\))" nil 
t)
@@ -859,7 +858,7 @@ from the document.")
          nil)
        (goto-char point))))
 
-(deffoo nndoc-request-accept-article (group &optional server last)
+(deffoo nndoc-request-accept-article (_group &optional _server _last)
   nil)
 
 ;;;
diff --git a/lisp/gnus/nndraft.el b/lisp/gnus/nndraft.el
index 9e70bb6..394b6fc 100644
--- a/lisp/gnus/nndraft.el
+++ b/lisp/gnus/nndraft.el
@@ -1,4 +1,4 @@
-;;; nndraft.el --- draft article access for Gnus
+;;; nndraft.el --- draft article access for Gnus  -*- lexical-binding: t; -*-
 
 ;; Copyright (C) 1995-2021 Free Software Foundation, Inc.
 
@@ -79,7 +79,7 @@ are generated if and only if they are also in 
`message-draft-headers'."
                     server nndraft-directory)
     t)))
 
-(deffoo nndraft-retrieve-headers (articles &optional group server fetch-old)
+(deffoo nndraft-retrieve-headers (articles &optional group server _fetch-old)
   (nndraft-possibly-change-group group)
   (with-current-buffer nntp-server-buffer
     (erase-buffer)
@@ -108,7 +108,7 @@ are generated if and only if they are also in 
`message-draft-headers'."
        (nnheader-fold-continuation-lines)
        'headers))))
 
-(deffoo nndraft-request-article (id &optional group server buffer)
+(deffoo nndraft-request-article (id &optional group _server buffer)
   (nndraft-possibly-change-group group)
   (when (numberp id)
     ;; We get the newest file of the auto-saved file and the
@@ -145,7 +145,7 @@ are generated if and only if they are also in 
`message-draft-headers'."
     ;;(message-remove-header "date")
     t))
 
-(deffoo nndraft-request-update-info (group info &optional server)
+(deffoo nndraft-request-update-info (group info &optional _server)
   (nndraft-possibly-change-group group)
   (setf (gnus-info-read info)
        (gnus-update-read-articles
@@ -210,7 +210,7 @@ are generated if and only if they are also in 
`message-draft-headers'."
                        'exit 'postpone 'kill)
     article))
 
-(deffoo nndraft-request-group (group &optional server dont-check info)
+(deffoo nndraft-request-group (group &optional server dont-check _info)
   (nndraft-possibly-change-group group)
   (unless dont-check
     (let* ((pathname (nnmail-group-pathname group nndraft-directory))
@@ -229,7 +229,7 @@ are generated if and only if they are also in 
`message-draft-headers'."
                        (list group server dont-check)))
 
 (deffoo nndraft-request-move-article (article group server accept-form
-                                     &optional last move-is-internal)
+                                     &optional _last _move-is-internal)
   (nndraft-possibly-change-group group)
   (let ((buf (gnus-get-buffer-create " *nndraft move*"))
        result)
@@ -238,7 +238,7 @@ are generated if and only if they are also in 
`message-draft-headers'."
      (with-current-buffer buf
        (erase-buffer)
        (insert-buffer-substring nntp-server-buffer)
-       (setq result (eval accept-form))
+       (setq result (eval accept-form t))
        (kill-buffer (current-buffer))
        result)
      (null (nndraft-request-expire-articles (list article) group server 
'force))
@@ -292,7 +292,7 @@ are generated if and only if they are also in 
`message-draft-headers'."
     (nnoo-parent-function 'nndraft 'nnmh-request-replace-article
                          (list article group buffer))))
 
-(deffoo nndraft-request-create-group (group &optional server args)
+(deffoo nndraft-request-create-group (group &optional _server _args)
   (nndraft-possibly-change-group group)
   (if (file-exists-p nndraft-current-directory)
       (if (file-directory-p nndraft-current-directory)
@@ -322,12 +322,10 @@ are generated if and only if they are also in 
`message-draft-headers'."
         args))
 
 (defun nndraft-auto-save-file-name (file)
-  (save-excursion
+  (with-current-buffer (gnus-get-buffer-create " *draft tmp*")
+    (setq buffer-file-name file)
     (prog1
-       (progn
-         (set-buffer (gnus-get-buffer-create " *draft tmp*"))
-         (setq buffer-file-name file)
-         (make-auto-save-file-name))
+        (make-auto-save-file-name)
       (kill-buffer (current-buffer)))))
 
 (defun nndraft-articles ()
diff --git a/lisp/gnus/nneething.el b/lisp/gnus/nneething.el
index 014ad3a..d881d6c 100644
--- a/lisp/gnus/nneething.el
+++ b/lisp/gnus/nneething.el
@@ -1,4 +1,4 @@
-;;; nneething.el --- arbitrary file access for Gnus
+;;; nneething.el --- arbitrary file access for Gnus  -*- lexical-binding: t; 
-*-
 
 ;; Copyright (C) 1995-2021 Free Software Foundation, Inc.
 
@@ -77,7 +77,7 @@ included.")
 
 (nnoo-define-basics nneething)
 
-(deffoo nneething-retrieve-headers (articles &optional group server fetch-old)
+(deffoo nneething-retrieve-headers (articles &optional group _server 
_fetch-old)
   (nneething-possibly-change-directory group)
 
   (with-current-buffer nntp-server-buffer
@@ -114,7 +114,7 @@ included.")
        (nnheader-fold-continuation-lines)
        'headers))))
 
-(deffoo nneething-request-article (id &optional group server buffer)
+(deffoo nneething-request-article (id &optional group _server buffer)
   (nneething-possibly-change-directory group)
   (let ((file (unless (stringp id)
                (nneething-file-name id)))
@@ -143,7 +143,7 @@ included.")
             (insert "\n"))
           t))))
 
-(deffoo nneething-request-group (group &optional server dont-check info)
+(deffoo nneething-request-group (group &optional server dont-check _info)
   (nneething-possibly-change-directory group server)
   (unless dont-check
     (nneething-create-mapping)
@@ -156,16 +156,16 @@ included.")
        group)))
   t)
 
-(deffoo nneething-request-list (&optional server dir)
+(deffoo nneething-request-list (&optional _server _dir)
   (nnheader-report 'nneething "LIST is not implemented."))
 
-(deffoo nneething-request-newgroups (date &optional server)
+(deffoo nneething-request-newgroups (_date &optional _server)
   (nnheader-report 'nneething "NEWSGROUPS is not implemented."))
 
-(deffoo nneething-request-type (group &optional article)
+(deffoo nneething-request-type (_group &optional _article)
   'unknown)
 
-(deffoo nneething-close-group (group &optional server)
+(deffoo nneething-close-group (_group &optional _server)
   (setq nneething-current-directory nil)
   t)
 
diff --git a/lisp/gnus/nnfolder.el b/lisp/gnus/nnfolder.el
index 405ab2f..1dd784d 100644
--- a/lisp/gnus/nnfolder.el
+++ b/lisp/gnus/nnfolder.el
@@ -1,4 +1,4 @@
-;;; nnfolder.el --- mail folder access for Gnus
+;;; nnfolder.el --- mail folder access for Gnus  -*- lexical-binding: t; -*-
 
 ;; Copyright (C) 1995-2021 Free Software Foundation, Inc.
 
@@ -261,7 +261,7 @@ all.  This may very well take some time.")
                                      (point) (point-at-eol)))
                    -1))))))))
 
-(deffoo nnfolder-request-group (group &optional server dont-check info)
+(deffoo nnfolder-request-group (group &optional server dont-check _info)
   (nnfolder-possibly-change-group group server t)
   (save-excursion
     (cond ((not (assoc group nnfolder-group-alist))
@@ -314,7 +314,7 @@ all.  This may very well take some time.")
 ;; over the buffer again unless we add new mail to it or modify it in some
 ;; way.
 
-(deffoo nnfolder-close-group (group &optional server force)
+(deffoo nnfolder-close-group (group &optional _server _force)
   ;; Make sure we _had_ the group open.
   (when (or (assoc group nnfolder-buffer-alist)
            (equal group nnfolder-current-group))
@@ -342,7 +342,7 @@ all.  This may very well take some time.")
        nnfolder-current-buffer nil)
   t)
 
-(deffoo nnfolder-request-create-group (group &optional server args)
+(deffoo nnfolder-request-create-group (group &optional server _args)
   (nnfolder-possibly-change-group nil server)
   (nnmail-activate 'nnfolder)
   (cond ((zerop (length group))
@@ -369,7 +369,7 @@ all.  This may very well take some time.")
       (setq nnfolder-group-alist (nnmail-get-active)))
     t))
 
-(deffoo nnfolder-request-newgroups (date &optional server)
+(deffoo nnfolder-request-newgroups (_date &optional server)
   (nnfolder-possibly-change-group nil server)
   (nnfolder-request-list server))
 
@@ -383,9 +383,8 @@ all.  This may very well take some time.")
 ;; current folder.
 
 (defun nnfolder-existing-articles ()
-  (save-excursion
-    (when nnfolder-current-buffer
-      (set-buffer nnfolder-current-buffer)
+  (when nnfolder-current-buffer
+    (with-current-buffer nnfolder-current-buffer
       (goto-char (point-min))
       (let ((marker (concat "\n" nnfolder-article-marker))
            (number "[0-9]+")
@@ -395,12 +394,13 @@ all.  This may very well take some time.")
          (let ((newnum (string-to-number (match-string 0))))
            (if (nnmail-within-headers-p)
                (push newnum numbers))))
-      ;; The article numbers are increasing, so this result is sorted.
+        ;; The article numbers are increasing, so this result is sorted.
        (nreverse numbers)))))
 
 (autoload 'gnus-request-group "gnus-int")
 (declare-function gnus-request-create-group "gnus-int"
                   (group &optional gnus-command-method args))
+(defvar nnfolder-current-directory)
 
 (deffoo nnfolder-request-expire-articles (articles newsgroup
                                                   &optional server force)
@@ -463,7 +463,7 @@ all.  This may very well take some time.")
       (gnus-sorted-difference articles (nreverse deleted-articles)))))
 
 (deffoo nnfolder-request-move-article (article group server accept-form
-                                              &optional last move-is-internal)
+                                              &optional last _move-is-internal)
   (save-excursion
     (let ((buf (gnus-get-buffer-create " *nnfolder move*"))
          result)
@@ -478,7 +478,7 @@ all.  This may very well take some time.")
                 (save-excursion (and (search-forward "\n\n" nil t) (point)))
                 t)
           (gnus-delete-line))
-        (setq result (eval accept-form))
+        (setq result (eval accept-form t))
         (kill-buffer buf)
         result)
        (save-excursion
@@ -499,7 +499,7 @@ all.  This may very well take some time.")
   (save-excursion
     (nnfolder-possibly-change-group group server)
     (nnmail-check-syntax)
-    (let ((buf (current-buffer))
+    (let (;; (buf (current-buffer))
          result art-group)
       (goto-char (point-min))
       (when (looking-at "X-From-Line: ")
diff --git a/lisp/gnus/nngateway.el b/lisp/gnus/nngateway.el
index 15e4876..c10989a 100644
--- a/lisp/gnus/nngateway.el
+++ b/lisp/gnus/nngateway.el
@@ -1,4 +1,4 @@
-;;; nngateway.el --- posting news via mail gateways
+;;; nngateway.el --- posting news via mail gateways  -*- lexical-binding: t; 
-*-
 
 ;; Copyright (C) 1996-2021 Free Software Foundation, Inc.
 
diff --git a/lisp/gnus/nnheader.el b/lisp/gnus/nnheader.el
index ae8506c..708887c 100644
--- a/lisp/gnus/nnheader.el
+++ b/lisp/gnus/nnheader.el
@@ -1,4 +1,4 @@
-;;; nnheader.el --- header access macros for Gnus and its backends
+;;; nnheader.el --- header access macros for Gnus and its backends  -*- 
lexical-binding: t; -*-
 
 ;; Copyright (C) 1987-1990, 1993-1998, 2000-2021 Free Software
 ;; Foundation, Inc.
diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el
index 1215131..f4f4ef8 100644
--- a/lisp/gnus/nnimap.el
+++ b/lisp/gnus/nnimap.el
@@ -1,4 +1,4 @@
-;;; nnimap.el --- IMAP interface for Gnus
+;;; nnimap.el --- IMAP interface for Gnus  -*- lexical-binding: t; -*-
 
 ;; Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
@@ -143,8 +143,7 @@ textual parts.")
 (defcustom nnimap-request-articles-find-limit nil
   "Limit the number of articles to look for after moving an article."
   :type '(choice (const nil) integer)
-  :version "24.4"
-  :group 'nnimap)
+  :version "24.4")
 
 (define-obsolete-variable-alias
   'nnimap-split-download-body-default 'nnimap-split-download-body
@@ -1005,7 +1004,7 @@ during splitting, which may be slow."
                            internal-move-group server message-id
                            nnimap-request-articles-find-limit)))))
          ;; Move the article to a different method.
-         (when-let* ((result (eval accept-form)))
+         (when-let* ((result (eval accept-form t)))
            (nnimap-change-group group server)
            (nnimap-delete-article article)
            result))))))
@@ -1166,7 +1165,7 @@ If LIMIT, first try to limit the search to the N last 
articles."
        7 "Article marked for deletion, but not expunged.")
       nil))))
 
-(deffoo nnimap-request-scan (&optional group server)
+(deffoo nnimap-request-scan (&optional _group server)
   (when (and (nnimap-change-group nil server)
             nnimap-inbox
             nnimap-split-methods)
diff --git a/lisp/gnus/nnmail.el b/lisp/gnus/nnmail.el
index 59d6137..9826bc6 100644
--- a/lisp/gnus/nnmail.el
+++ b/lisp/gnus/nnmail.el
@@ -1,4 +1,4 @@
-;;; nnmail.el --- mail support functions for the Gnus mail backends
+;;; nnmail.el --- mail support functions for the Gnus mail backends  -*- 
lexical-binding: t; -*-
 
 ;; Copyright (C) 1995-2021 Free Software Foundation, Inc.
 
@@ -598,7 +598,7 @@ These will be logged to the \"*nnmail split*\" buffer."
 
 
 
-(defun nnmail-request-post (&optional server)
+(defun nnmail-request-post (&optional _server)
   (mail-send-and-exit nil))
 
 (defvar nnmail-file-coding-system 'raw-text
@@ -664,7 +664,7 @@ nn*-request-list should have been called before calling 
this function."
   (let ((buffer (current-buffer))
        group-assoc group max min)
     (while (not (eobp))
-      (condition-case err
+      (condition-case nil
          (progn
            (narrow-to-region (point) (point-at-eol))
            (setq group (read buffer)
@@ -712,7 +712,7 @@ If SOURCE is a directory spec, try to return the group name 
component."
   (if (eq (car source) 'directory)
       (let ((file (file-name-nondirectory file)))
        (mail-source-bind (directory source)
-         (if (string-match (concat (regexp-quote suffix) "$") file)
+         (if (string-match (concat (regexp-quote suffix) "\\'") file)
              (substring file 0 (match-beginning 0))
            nil)))
     nil))
@@ -1332,14 +1332,15 @@ Eudora has a broken References line, but an OK 
In-Reply-To."
 (declare-function gnus-activate-group "gnus-start"
                   (group &optional scan dont-check method dont-sub-check))
 
-(defun nnmail-do-request-post (accept-func &optional server)
+(defun nnmail-do-request-post (accept-func &optional _server)
   "Utility function to directly post a message to an nnmail-derived group.
 Calls ACCEPT-FUNC (which should be `nnchoke-request-accept-article')
 to actually put the message in the right group."
   (let ((success t))
     (dolist (mbx (message-unquote-tokens
                  (message-tokenize-header
-                  (message-fetch-field "Newsgroups") ", ")) success)
+                  (message-fetch-field "Newsgroups") ", "))
+                success)
       (let ((to-newsgroup (gnus-group-prefixed-name mbx gnus-command-method)))
        (or (gnus-active to-newsgroup)
            (gnus-activate-group to-newsgroup)
@@ -1396,7 +1397,7 @@ See the documentation for the variable 
`nnmail-split-fancy' for details."
      ;; Builtin : operation.
      ((eq (car split) ':)
       (nnmail-log-split split)
-      (nnmail-split-it (save-excursion (eval (cdr split)))))
+      (nnmail-split-it (save-excursion (eval (cdr split) t))))
 
      ;; Builtin ! operation.
      ((eq (car split) '!)
@@ -1433,11 +1434,11 @@ See the documentation for the variable 
`nnmail-split-fancy' for details."
              ;; we do not exclude foo.list just because
              ;; the header is: ``To: x-foo, foo''
              (goto-char end)
-             (if (and (re-search-backward (cadr split-rest)
-                                          after-header-name t)
-                      (> (match-end 0) start-of-value))
-                 (setq split-rest nil)
-               (setq split-rest (cddr split-rest))))
+             (setq split-rest
+                    (unless (and (re-search-backward (cadr split-rest)
+                                                    after-header-name t)
+                                (> (match-end 0) start-of-value))
+                      (cddr split-rest))))
            (when split-rest
              (goto-char end)
              ;; Someone might want to do a \N sub on this match, so
@@ -1811,10 +1812,10 @@ be called once per group or once for all groups."
            (setq source (append source
                                 (list
                                  :predicate
-                                 (gnus-byte-compile
-                                  `(lambda (file)
+                                 (let ((str (concat group suffix)))
+                                   (lambda (file)
                                      (string-equal
-                                      ,(concat group suffix)
+                                      str
                                       (file-name-nondirectory file)))))))))
        (when nnmail-fetched-sources
          (if (member source nnmail-fetched-sources)
@@ -1835,17 +1836,19 @@ be called once per group or once for all groups."
                    (condition-case cond
                        (mail-source-fetch
                         source
-                        (gnus-byte-compile
-                         `(lambda (file orig-file)
+                        (let ((smsym (intern (format "%s-save-mail" method)))
+                              (ansym (intern (format "%s-active-number" 
method)))
+                              (src source))
+                          (lambda (file orig-file)
                             (nnmail-split-incoming
-                             file ',(intern (format "%s-save-mail" method))
-                             ',spool-func
+                             file smsym
+                             spool-func
                              (or in-group
                                  (if (equal file orig-file)
                                      nil
                                    (nnmail-get-split-group orig-file
-                                                           ',source)))
-                             ',(intern (format "%s-active-number" method))))))
+                                                           src)))
+                             ansym))))
                      ((error quit)
                       (message "Mail source %s failed: %s" source cond)
                       0)))
@@ -1917,7 +1920,7 @@ If TIME is nil, then return the cutoff time for oldness 
instead."
                     (cdr group-art))
            (gnus-group-mark-article-read target (cdr group-art))))))))
 
-(defun nnmail-fancy-expiry-target (group)
+(defun nnmail-fancy-expiry-target (_group)
   "Return a target expiry group determined by `nnmail-fancy-expiry-targets'."
   (let* (header
         (case-fold-search nil)
diff --git a/lisp/gnus/nnmairix.el b/lisp/gnus/nnmairix.el
index 54d6c52..4b8f69f 100644
--- a/lisp/gnus/nnmairix.el
+++ b/lisp/gnus/nnmairix.el
@@ -1,4 +1,4 @@
-;;; nnmairix.el --- Mairix back end for Gnus, the Emacs newsreader
+;;; nnmairix.el --- Mairix back end for Gnus, the Emacs newsreader  -*- 
lexical-binding: t; -*-
 
 ;; Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
@@ -219,20 +219,17 @@ server will be this prefix plus a random number.  You can 
delete
 unused nnmairix groups on the back end using
 `nnmairix-purge-old-groups'."
   :version "23.1"
-  :type 'string
-  :group 'nnmairix)
+  :type 'string)
 
 (defcustom nnmairix-mairix-output-buffer "*mairix output*"
   "Buffer used for mairix output."
   :version "23.1"
-  :type 'string
-  :group 'nnmairix)
+  :type 'string)
 
 (defcustom nnmairix-customize-query-buffer "*mairix query*"
   "Name of the buffer for customizing Mairix queries."
   :version "23.1"
-  :type 'string
-  :group 'nnmairix)
+  :type 'string)
 
 (defcustom nnmairix-mairix-update-options '("-F" "-Q")
   "Options when calling mairix for updating the database.
@@ -240,21 +237,18 @@ The default is \"-F\" and \"-Q\" for making updates 
faster.  You
 should call mairix without these options from time to
 time (e.g. via cron job)."
   :version "23.1"
-  :type '(repeat string)
-  :group 'nnmairix)
+  :type '(repeat string))
 
 (defcustom nnmairix-mairix-search-options '("-Q")
   "Options when calling mairix for searching.
 The default is \"-Q\" for making searching faster."
   :version "23.1"
-  :type '(repeat string)
-  :group 'nnmairix)
+  :type '(repeat string))
 
 (defcustom nnmairix-mairix-synchronous-update nil
   "Set this to t if you want Emacs to wait for mairix updating the database."
   :version "23.1"
-  :type 'boolean
-  :group 'nnmairix)
+  :type 'boolean)
 
 (defcustom nnmairix-rename-files-for-nnml t
   "Rename nnml mail files so that they are consecutively numbered.
@@ -263,8 +257,7 @@ article numbers which will produce wrong article counts by
 Gnus.  This option controls whether nnmairix should rename the
 files consecutively."
   :version "23.1"
-  :type 'boolean
-  :group 'nnmairix)
+  :type 'boolean)
 
 (defcustom nnmairix-widget-fields-list
   '(("from" "f" "From") ("to" "t" "To") ("cc" "c" "Cc")
@@ -288,16 +281,14 @@ nil for disabling this)."
                          (const :tag "Subject" "subject")
                          (const :tag "Message ID" "Message-ID"))
                  (string :tag "Command")
-                 (string :tag "Description")))
-  :group 'nnmairix)
+                 (string :tag "Description"))))
 
 (defcustom nnmairix-widget-select-window-function
   (lambda () (select-window (get-largest-window)))
   "Function for selecting the window for customizing the mairix query.
 The default chooses the largest window in the current frame."
   :version "23.1"
-  :type 'function
-  :group 'nnmairix)
+  :type 'function)
 
 (defcustom nnmairix-propagate-marks-upon-close t
   "Flag if marks should be propagated upon closing a group.
@@ -308,8 +299,7 @@ call `nnmairix-propagate-marks'."
   :version "23.1"
   :type '(choice (const :tag "always" t)
                 (const :tag "ask" ask)
-                (const :tag "never" nil))
-  :group 'nnmairix)
+                (const :tag "never" nil)))
 
 (defcustom nnmairix-propagate-marks-to-nnmairix-groups nil
   "Flag if marks from original articles should be seen in nnmairix groups.
@@ -319,8 +309,7 @@ e.g. an IMAP server (which stores the marks in the maildir 
file
 name).  You may safely set this to t for testing - the worst that
 can happen are wrong marks in nnmairix groups."
   :version "23.1"
-  :type 'boolean
-  :group 'nnmairix)
+  :type 'boolean)
 
 (defcustom nnmairix-only-use-registry nil
   "Use only the registry for determining original group(s).
@@ -330,16 +319,14 @@ propagating marks).  If set to nil, it will also try to 
determine
 the group from an additional mairix search which might be slow
 when propagating lots of marks."
   :version "23.1"
-  :type 'boolean
-  :group 'nnmairix)
+  :type 'boolean)
 
 (defcustom nnmairix-allowfast-default nil
   "Whether fast entering should be the default for nnmairix groups.
 You may set this to t to make entering the group faster, but note that
 this might lead to problems, especially when used with marks propagation."
   :version "23.1"
-  :type 'boolean
-  :group 'nnmairix)
+  :type 'boolean)
 
 ;; ==== Other variables
 
@@ -417,7 +404,7 @@ Other back ends might or might not work.")
   (setq nnmairix-current-server server)
   (nnoo-change-server 'nnmairix server definitions))
 
-(deffoo nnmairix-request-group (group &optional server fast info)
+(deffoo nnmairix-request-group (group &optional server fast _info)
   ;; Call mairix and request group on back end server
   (when server (nnmairix-open-server server))
   (let* ((qualgroup (if server
@@ -430,7 +417,7 @@ Other back ends might or might not work.")
         (backendmethod (gnus-server-to-method
                         (format "%s:%s" (symbol-name nnmairix-backend)
                                 nnmairix-backend-server)))
-        rval mfolder folderpath args)
+        rval mfolder folderpath) ;; args
     (cond
      ((not folder)
       ;; No folder parameter -> error
@@ -510,12 +497,12 @@ Other back ends might or might not work.")
        nil))))))
 
 
-(deffoo nnmairix-request-create-group (group &optional server args)
+(deffoo nnmairix-request-create-group (group &optional server _args)
   (let ((qualgroup (if server (gnus-group-prefixed-name group (list 'nnmairix 
server))
                     group))
        (exist t)
        (count 0)
-       groupname info)
+       groupname) ;; info
     (when server (nnmairix-open-server server))
     (gnus-group-add-parameter qualgroup '(query . nil))
     (gnus-group-add-parameter qualgroup '(threads . nil))
@@ -574,7 +561,7 @@ Other back ends might or might not work.")
 (deffoo nnmairix-request-list (&optional server)
   (when server (nnmairix-open-server server))
   (if (nnmairix-call-backend "request-list" nnmairix-backend-server)
-      (let (cpoint cur qualgroup folder)
+      (let (cpoint cur qualgroup) ;; folder
        (with-current-buffer nntp-server-buffer
          (goto-char (point-min))
          (setq cpoint (point))
@@ -603,7 +590,7 @@ Other back ends might or might not work.")
     (nnmairix-open-server server))
   (let* ((qualgroup (gnus-group-prefixed-name group (list 'nnmairix 
nnmairix-current-server)))
         (propmarks (gnus-group-get-parameter qualgroup 'propmarks))
-        (propto (gnus-group-get-parameter qualgroup 'propto t))
+        ;; (propto (gnus-group-get-parameter qualgroup 'propto t))
         (corr (nnmairix-get-numcorr group server))
         (folder (nnmairix-get-backend-folder group server)))
     (save-excursion
@@ -611,7 +598,7 @@ Other back ends might or might not work.")
        (let ((type (nth 1 cur))
              (cmdmarks (nth 2 cur))
              (range (gnus-uncompress-range (nth 0 cur)))
-             mid ogroup number method temp)
+             mid ogroup temp) ;; number method
          (when (and corr
                     (not (zerop (cadr corr))))
            (setq range (mapcar (lambda (arg)
@@ -674,7 +661,7 @@ Other back ends might or might not work.")
     (nnmairix-open-server server))
   (let* ((qualgroup (gnus-group-prefixed-name group (list 'nnmairix 
nnmairix-current-server)))
         (propmarks (gnus-group-get-parameter qualgroup 'propmarks))
-        method)
+        ) ;; method
     (when (and propmarks
               nnmairix-marks-cache)
       (when (or (eq nnmairix-propagate-marks-upon-close t)
@@ -689,9 +676,9 @@ Other back ends might or might not work.")
 (autoload 'nnimap-request-update-info-internal "nnimap")
 
 (deffoo nnmairix-request-marks (group info &optional server)
-;; propagate info from underlying IMAP folder to nnmairix group
-;; This is currently experimental and must be explicitly activated
-;; with nnmairix-propagate-marks-to-nnmairix-group
+  ;; propagate info from underlying IMAP folder to nnmairix group
+  ;; This is currently experimental and must be explicitly activated
+  ;; with nnmairix-propagate-marks-to-nnmairix-group
   (when server
     (nnmairix-open-server server))
   (let* ((qualgroup (gnus-group-prefixed-name
@@ -703,7 +690,7 @@ Other back ends might or might not work.")
         (corr (nnmairix-get-numcorr group server))
         (docorr (and corr (not (zerop (cadr corr)))))
         (folderinfo `(,group 1 ((1 . 1))))
-        readrange marks)
+        ) ;; readrange marks
       (when (and propmarks
                 nnmairix-propagate-marks-to-nnmairix-groups)
        ;; these groups are not subscribed, so we have to ask the back end 
directly
@@ -714,8 +701,8 @@ Other back ends might or might not work.")
        (setf (gnus-info-read info)
              (if docorr
                  (nnmairix-map-range
-                  ;; FIXME: Use lexical-binding.
-                  `(lambda (x) (+ x ,(cadr corr)))
+                  (let ((off (cadr corr)))
+                    (lambda (x) (+ x off)))
                   (gnus-info-read folderinfo))
                (gnus-info-read folderinfo)))
        ;; set other marks
@@ -725,8 +712,8 @@ Other back ends might or might not work.")
                            (cons
                             (car cur)
                             (nnmairix-map-range
-                             ;; FIXME: Use lexical-binding.
-                             `(lambda (x) (+ x ,(cadr corr)))
+                             (let ((off (cadr corr)))
+                               (lambda (x) (+ x off)))
                              (list (cadr cur)))))
                          (gnus-info-marks folderinfo))
                (gnus-info-marks folderinfo))))
@@ -757,10 +744,9 @@ called interactively, user will be asked for parameters."
   (when (not (listp query))
     (setq query (list query)))
   (when (and server group query)
-    (save-excursion
-      (let ((groupname (gnus-group-prefixed-name group server))
-           info)
-       (set-buffer gnus-group-buffer)
+    (let ((groupname (gnus-group-prefixed-name group server))
+          ) ;; info
+      (with-current-buffer gnus-group-buffer
        (gnus-group-make-group group server)
        (gnus-group-set-parameter groupname 'query  query)
        (gnus-group-set-parameter groupname 'threads threads)
@@ -792,7 +778,7 @@ called interactively, user will be asked for parameters."
   (interactive)
   (let ((char-header nnmairix-interactive-query-parameters)
        (server (nnmairix-backend-to-server gnus-current-select-method))
-        query achar header finished group threads cq)
+        query achar header finished group threads) ;; cq
     (when (or (not (gnus-buffer-live-p gnus-article-buffer))
              (not (gnus-buffer-live-p gnus-summary-buffer)))
       (error "No article or summary buffer"))
@@ -810,7 +796,8 @@ called interactively, user will be asked for parameters."
            (setq achar nil)))
        (set-buffer gnus-article-buffer)
        (setq header nil)
-       (when (setq cq (nth 1 (assoc achar char-header)))
+       (when ;; (setq cq
+           (nth 1 (assoc achar char-header)) ;;)
          (setq header
                (nnmairix-replace-illegal-chars
                 (gnus-fetch-field (nth 1 (assoc achar char-header))))))
@@ -841,7 +828,7 @@ All necessary information will be queried from the user."
        (hidden (and (string-match "^nn\\(imap\\|maildir\\)$" backend)
                     (y-or-n-p
                      "Does the back end server work with maildir++ (i.e. 
hidden directories)? ")))
-       create)
+       ) ;; create
 
     (apply (intern (format "%s-%s" backend "open-server"))
           (list servername))
@@ -1023,7 +1010,7 @@ before deleting a group on the back end.  SERVER 
specifies nnmairix server."
     (if (nnmairix-open-server (nth 1 server))
        (when (nnmairix-call-backend
               "request-list" nnmairix-backend-server)
-         (let (cur qualgroup folder)
+         (let (cur qualgroup) ;; folder
            (with-current-buffer nntp-server-buffer
              (goto-char (point-min))
              (while (re-search-forward nnmairix-group-regexp (point-max) t)
@@ -1186,7 +1173,7 @@ Marks propagation has to be enabled for this to work."
     (error "Not in a nnmairix group"))
   (save-excursion
     (let ((mid (mail-header-message-id (gnus-summary-article-header)))
-         groups cur)
+         groups) ;; cur
       (when mid
        (setq groups (nnmairix-determine-original-group-from-registry mid))
        (unless (or groups
@@ -1313,7 +1300,7 @@ If ALL is t, return also the unopened/failed ones."
   "Return list of valid back end servers for nnmairix groups."
   (let ((alist gnus-opened-servers)
        (mairixservers (nnmairix-get-nnmairix-servers t))
-       server mserver openedserver occ cur)
+       server mserver openedserver occ) ;; cur
     ;; Get list of all nnmairix backends (i.e. backends which are
     ;; already occupied)
     (dolist (cur mairixservers)
@@ -1407,7 +1394,7 @@ TYPE is either `nov' or `headers'."
     (let ((buf (gnus-get-buffer-create " *nnmairix buffer*"))
          (corr (not (zerop numc)))
          (name (buffer-name nntp-server-buffer))
-         header cur xref)
+         cur xref) ;; header
       (with-current-buffer buf
        (erase-buffer)
        (set-buffer nntp-server-buffer)
@@ -1600,7 +1587,7 @@ search in raw mode."
   (when (not (gnus-buffer-live-p gnus-article-buffer))
     (error "No article buffer available"))
   (let ((server (nth 1 gnus-current-select-method))
-       mid rval group allgroups)
+       mid group allgroups)
     ;; get message id
     (with-current-buffer gnus-article-buffer
       (gnus-summary-toggle-header 1)
@@ -1831,10 +1818,10 @@ MVALUES may contain values from current article."
   (widget-create 'push-button
                 :notify
                 (if mvalues
-                    (lambda (&rest ignore)
+                    (lambda (&rest _ignore)
                       (nnmairix-widget-send-query nnmairix-widgets
                                                   t))
-                  (lambda (&rest ignore)
+                  (lambda (&rest _ignore)
                     (nnmairix-widget-send-query nnmairix-widgets
                                                 nil)))
                 "Send Query")
@@ -1842,16 +1829,16 @@ MVALUES may contain values from current article."
   (widget-create 'push-button
                 :notify
                 (if mvalues
-                    (lambda (&rest ignore)
+                    (lambda (&rest _ignore)
                       (nnmairix-widget-create-group nnmairix-widgets
                                                     t))
-                  (lambda (&rest ignore)
+                  (lambda (&rest _ignore)
                     (nnmairix-widget-create-group nnmairix-widgets
                                                   nil)))
                 "Create permanent group")
   (widget-insert "   ")
   (widget-create 'push-button
-                :notify (lambda (&rest ignore)
+                :notify (lambda (&rest _ignore)
                           (kill-buffer nnmairix-customize-query-buffer))
                 "Cancel")
   (use-local-map widget-keymap)
@@ -1926,7 +1913,7 @@ If WITHVALUES is t, query is based on current article."
 (defun nnmairix-widget-create-query (&optional values)
   "Create widgets for creating mairix queries.
 Fill in VALUES if based on an article."
-  (let (allwidgets)
+  ;;(let (allwidgets)
     (when (get-buffer nnmairix-customize-query-buffer)
       (kill-buffer nnmairix-customize-query-buffer))
     (switch-to-buffer nnmairix-customize-query-buffer)
@@ -1957,7 +1944,7 @@ Fill in VALUES if based on an article."
     (when (member 'threads nnmairix-widget-other)
       (widget-insert "\n")
       (nnmairix-widget-add "Threads" 'checkbox nil))
-      (widget-insert " Show full threads\n\n")))
+      (widget-insert " Show full threads\n\n")) ;; )
 
 (defun nnmairix-widget-build-editable-fields (values)
   "Build editable field widgets in `nnmairix-widget-fields-list'.
@@ -1974,7 +1961,7 @@ VALUES may contain values for editable fields from 
current article."
                 (concat "c" field)
                 (widget-create 'checkbox
                                :tag field
-                               :notify (lambda (widget &rest ignore)
+                               :notify (lambda (widget &rest _ignore)
                                          (nnmairix-widget-toggle-activate 
widget))
                                nil)))
               (list
diff --git a/lisp/gnus/nnmbox.el b/lisp/gnus/nnmbox.el
index a4863c3..66c2267 100644
--- a/lisp/gnus/nnmbox.el
+++ b/lisp/gnus/nnmbox.el
@@ -1,4 +1,4 @@
-;;; nnmbox.el --- mail mbox access for Gnus
+;;; nnmbox.el --- mail mbox access for Gnus  -*- lexical-binding: t; -*-
 
 ;; Copyright (C) 1995-2021 Free Software Foundation, Inc.
 
@@ -76,7 +76,7 @@
 
 (nnoo-define-basics nnmbox)
 
-(deffoo nnmbox-retrieve-headers (sequence &optional newsgroup server fetch-old)
+(deffoo nnmbox-retrieve-headers (sequence &optional newsgroup server 
_fetch-old)
   (with-current-buffer nntp-server-buffer
     (erase-buffer)
     (let ((number (length sequence))
@@ -168,7 +168,7 @@
                 (cons nnmbox-current-group article)
               (nnmbox-article-group-number nil))))))))
 
-(deffoo nnmbox-request-group (group &optional server dont-check info)
+(deffoo nnmbox-request-group (group &optional server dont-check _info)
   (nnmbox-possibly-change-newsgroup nil server)
   (let ((active (cadr (assoc group nnmbox-group-alist))))
     (cond
@@ -207,17 +207,16 @@
    (file-name-directory nnmbox-mbox-file)
    group
    (lambda ()
-     (save-excursion
-       (let ((in-buf (current-buffer)))
-        (set-buffer nnmbox-mbox-buffer)
+     (let ((in-buf (current-buffer)))
+       (with-current-buffer nnmbox-mbox-buffer
         (goto-char (point-max))
         (insert-buffer-substring in-buf)))
      (nnmbox-save-active nnmbox-group-alist nnmbox-active-file))))
 
-(deffoo nnmbox-close-group (group &optional server)
+(deffoo nnmbox-close-group (_group &optional _server)
   t)
 
-(deffoo nnmbox-request-create-group (group &optional server args)
+(deffoo nnmbox-request-create-group (group &optional _server _args)
   (nnmail-activate 'nnmbox)
   (unless (assoc group nnmbox-group-alist)
     (push (list group (cons 1 0))
@@ -225,7 +224,7 @@
     (nnmbox-save-active nnmbox-group-alist nnmbox-active-file))
   t)
 
-(deffoo nnmbox-request-list (&optional server)
+(deffoo nnmbox-request-list (&optional _server)
   (save-excursion
     (let ((nnmail-file-coding-system
           nnmbox-active-file-coding-system))
@@ -233,12 +232,14 @@
     (setq nnmbox-group-alist (nnmail-get-active))
     t))
 
-(deffoo nnmbox-request-newgroups (date &optional server)
+(deffoo nnmbox-request-newgroups (_date &optional server)
   (nnmbox-request-list server))
 
-(deffoo nnmbox-request-list-newsgroups (&optional server)
+(deffoo nnmbox-request-list-newsgroups (&optional _server)
   (nnheader-report 'nnmbox "LIST NEWSGROUPS is not implemented."))
 
+(defvar nnml-current-directory)
+
 (deffoo nnmbox-request-expire-articles
     (articles newsgroup &optional server force)
   (nnmbox-possibly-change-newsgroup newsgroup server)
@@ -279,7 +280,7 @@
       (nconc rest articles))))
 
 (deffoo nnmbox-request-move-article
-    (article group server accept-form &optional last move-is-internal)
+    (article group server accept-form &optional last _move-is-internal)
   (let ((buf (gnus-get-buffer-create " *nnmbox move*"))
        result)
     (and
@@ -292,7 +293,7 @@
               "^X-Gnus-Newsgroup:"
               (save-excursion (search-forward "\n\n" nil t) (point)) t)
         (gnus-delete-line))
-       (setq result (eval accept-form))
+       (setq result (eval accept-form t))
        (kill-buffer buf)
        result)
      (save-excursion
@@ -622,16 +623,15 @@
           (with-current-buffer nnmbox-mbox-buffer
             (= (buffer-size) (nnheader-file-size nnmbox-mbox-file))))
       ()
-    (save-excursion
-      (let ((delim (concat "^" message-unix-mail-delimiter))
-           (alist nnmbox-group-alist)
-           (nnmbox-group-building-active-articles t)
-           start end end-header number)
-       (set-buffer (setq nnmbox-mbox-buffer
-                         (let ((nnheader-file-coding-system
-                                nnmbox-file-coding-system))
-                           (nnheader-find-file-noselect
-                            nnmbox-mbox-file t t))))
+    (let ((delim (concat "^" message-unix-mail-delimiter))
+          (alist nnmbox-group-alist)
+          (nnmbox-group-building-active-articles t)
+          start end end-header number)
+      (with-current-buffer (setq nnmbox-mbox-buffer
+                                 (let ((nnheader-file-coding-system
+                                        nnmbox-file-coding-system))
+                                   (nnheader-find-file-noselect
+                                    nnmbox-mbox-file t t)))
        (mm-enable-multibyte)
        (buffer-disable-undo)
        (gnus-add-buffer)
diff --git a/lisp/gnus/nnmh.el b/lisp/gnus/nnmh.el
index 46abf46..231583f 100644
--- a/lisp/gnus/nnmh.el
+++ b/lisp/gnus/nnmh.el
@@ -1,4 +1,4 @@
-;;; nnmh.el --- mhspool access for Gnus
+;;; nnmh.el --- mhspool access for Gnus  -*- lexical-binding: t; -*-
 
 ;; Copyright (C) 1995-2021 Free Software Foundation, Inc.
 
@@ -72,7 +72,7 @@ as unread by Gnus.")
 
 (nnoo-define-basics nnmh)
 
-(deffoo nnmh-retrieve-headers (articles &optional newsgroup server fetch-old)
+(deffoo nnmh-retrieve-headers (articles &optional newsgroup server _fetch-old)
   (with-current-buffer nntp-server-buffer
     (erase-buffer)
     (let* ((file nil)
@@ -147,7 +147,7 @@ as unread by Gnus.")
         (save-excursion (nnmail-find-file file))
         (string-to-number (file-name-nondirectory file)))))
 
-(deffoo nnmh-request-group (group &optional server dont-check info)
+(deffoo nnmh-request-group (group &optional server dont-check _info)
   (nnheader-init-server-buffer)
   (nnmh-possibly-change-directory group server)
   (let ((pathname (nnmail-group-pathname group nnmh-directory))
@@ -188,9 +188,11 @@ as unread by Gnus.")
          (nnheader-report 'nnmh "Empty group %s" group)
          (nnheader-insert (format "211 0 1 0 %s\n" group))))))))))
 
-(deffoo nnmh-request-scan (&optional group server)
+(deffoo nnmh-request-scan (&optional group _server)
   (nnmail-get-new-mail 'nnmh nil nnmh-directory group))
 
+(defvar nnmh-toplev)
+
 (deffoo nnmh-request-list (&optional server dir)
   (nnheader-insert "")
   (nnmh-possibly-change-directory nil server)
@@ -201,13 +203,12 @@ as unread by Gnus.")
   (setq nnmh-group-alist (nnmail-get-active))
   t)
 
-(defvar nnmh-toplev)
 (defun nnmh-request-list-1 (dir)
   (setq dir (expand-file-name dir))
   ;; Recurse down all directories.
   (let ((files (nnheader-directory-files dir t nil t))
        (max 0)
-       min rdir num subdirectoriesp file)
+       min num subdirectoriesp file) ;; rdir
     ;; Recurse down directories.
     (setq subdirectoriesp
          ;; link number always 1 on MS Windows :(
@@ -252,7 +253,7 @@ as unread by Gnus.")
          (or min 1))))))
   t)
 
-(deffoo nnmh-request-newgroups (date &optional server)
+(deffoo nnmh-request-newgroups (_date &optional server)
   (nnmh-request-list server))
 
 (deffoo nnmh-request-expire-articles (articles newsgroup
@@ -291,11 +292,11 @@ as unread by Gnus.")
     (nnheader-message 5 "")
     (nconc rest articles)))
 
-(deffoo nnmh-close-group (group &optional server)
+(deffoo nnmh-close-group (_group &optional _server)
   t)
 
-(deffoo nnmh-request-move-article (article group server accept-form
-                                          &optional last move-is-internal)
+(deffoo nnmh-request-move-article ( article group server accept-form
+                                   &optional _last _move-is-internal)
   (let ((buf (gnus-get-buffer-create " *nnmh move*"))
        result)
     (and
@@ -304,7 +305,7 @@ as unread by Gnus.")
      (with-current-buffer buf
        (erase-buffer)
        (insert-buffer-substring nntp-server-buffer)
-       (setq result (eval accept-form))
+       (setq result (eval accept-form t))
        (kill-buffer (current-buffer))
        result)
      (progn
@@ -350,7 +351,7 @@ as unread by Gnus.")
        nil (if (nnheader-be-verbose 5) nil 'nomesg))
       t)))
 
-(deffoo nnmh-request-create-group (group &optional server args)
+(deffoo nnmh-request-create-group (group &optional server _args)
   (nnheader-init-server-buffer)
   (unless (assoc group nnmh-group-alist)
     (let (active)
diff --git a/lisp/gnus/nnml.el b/lisp/gnus/nnml.el
index eaa2004..18acc73 100644
--- a/lisp/gnus/nnml.el
+++ b/lisp/gnus/nnml.el
@@ -1,4 +1,4 @@
-;;; nnml.el --- mail spool access for Gnus
+;;; nnml.el --- mail spool access for Gnus  -*- lexical-binding: t; -*-
 
 ;; Copyright (C) 1995-2021 Free Software Foundation, Inc.
 
@@ -111,7 +111,7 @@ non-nil.")
 
 (nnoo-define-basics nnml)
 
-(defun nnml-group-pathname (group &optional file server)
+(defun nnml-group-pathname (group &optional file _server)
   "Return an absolute file name of FILE for GROUP on SERVER."
   (nnmail-group-pathname group nnml-directory file))
 
@@ -215,7 +215,7 @@ non-nil.")
       (cons (if group-num (car group-num) group)
            (string-to-number (file-name-nondirectory path)))))))
 
-(deffoo nnml-request-group (group &optional server dont-check info)
+(deffoo nnml-request-group (group &optional server dont-check _info)
   (let ((file-name-coding-system nnmail-pathname-coding-system))
     (cond
      ((not (nnml-possibly-change-directory group server))
@@ -252,11 +252,11 @@ non-nil.")
    (t
     (nnmail-get-new-mail 'nnml 'nnml-save-incremental-nov nnml-directory 
nil))))
 
-(deffoo nnml-close-group (group &optional server)
+(deffoo nnml-close-group (_group &optional _server)
   (setq nnml-article-file-alist nil)
   t)
 
-(deffoo nnml-request-create-group (group &optional server args)
+(deffoo nnml-request-create-group (group &optional server _args)
   (nnml-possibly-change-directory nil server)
   (nnmail-activate 'nnml)
   (cond
@@ -283,7 +283,7 @@ non-nil.")
       (nnmail-save-active nnml-group-alist nnml-active-file)
       t))))
 
-(deffoo nnml-request-list (&optional server)
+(deffoo nnml-request-list (&optional _server)
   (save-excursion
     (let ((nnmail-file-coding-system nnmail-active-file-coding-system)
          (file-name-coding-system nnmail-pathname-coding-system))
@@ -291,10 +291,10 @@ non-nil.")
     (setq nnml-group-alist (nnmail-get-active))
     t))
 
-(deffoo nnml-request-newgroups (date &optional server)
+(deffoo nnml-request-newgroups (_date &optional server)
   (nnml-request-list server))
 
-(deffoo nnml-request-list-newsgroups (&optional server)
+(deffoo nnml-request-list-newsgroups (&optional _server)
   (save-excursion
     (nnmail-find-file nnml-newsgroups-file)))
 
@@ -360,7 +360,7 @@ non-nil.")
     (nconc rest articles)))
 
 (deffoo nnml-request-move-article
-    (article group server accept-form &optional last move-is-internal)
+    (article group server accept-form &optional last _move-is-internal)
   (let ((buf (gnus-get-buffer-create " *nnml move*"))
        (file-name-coding-system nnmail-pathname-coding-system)
        result)
@@ -374,7 +374,7 @@ non-nil.")
           nnml-article-file-alist)
        (with-current-buffer buf
         (insert-buffer-substring nntp-server-buffer)
-        (setq result (eval accept-form))
+        (setq result (eval accept-form t))
         (kill-buffer (current-buffer))
         result))
      (progn
@@ -411,8 +411,8 @@ non-nil.")
       (and
        (nnmail-activate 'nnml)
        (if (and (not (setq result (nnmail-article-group
-                                  `(lambda (group)
-                                     (nnml-active-number group ,server)))))
+                                  (lambda (group)
+                                    (nnml-active-number group server)))))
                (yes-or-no-p "Moved to `junk' group; delete article? "))
           (setq result 'junk)
         (setq result (car (nnml-save-mail result server t))))
@@ -889,7 +889,7 @@ Unless no-active is non-nil, update the active file too."
   (let* ((dir (file-name-as-directory dir))
         (nov (concat dir nnml-nov-file-name))
         (nov-buffer (gnus-get-buffer-create " *nov*"))
-        chars file headers)
+        chars headers) ;; file
     (with-current-buffer nov-buffer
       ;; Init the nov buffer.
       (buffer-disable-undo)
diff --git a/lisp/gnus/nnnil.el b/lisp/gnus/nnnil.el
index 7d40079..36a8bc4 100644
--- a/lisp/gnus/nnnil.el
+++ b/lisp/gnus/nnnil.el
@@ -1,4 +1,4 @@
-;;; nnnil.el --- empty backend for Gnus
+;;; nnnil.el --- empty backend for Gnus  -*- lexical-binding: t; -*-
 
 ;; This file is in the public domain.
 
@@ -32,31 +32,31 @@
 
 (defvar nnnil-status-string "")
 
-(defun nnnil-retrieve-headers (articles &optional group server fetch-old)
+(defun nnnil-retrieve-headers (_articles &optional _group _server _fetch-old)
   (with-current-buffer nntp-server-buffer
     (erase-buffer))
   'nov)
 
-(defun nnnil-open-server (server &optional definitions)
+(defun nnnil-open-server (_server &optional _definitions)
   t)
 
-(defun nnnil-close-server (&optional server)
+(defun nnnil-close-server (&optional _server)
   t)
 
 (defun nnnil-request-close ()
   t)
 
-(defun nnnil-server-opened (&optional server)
+(defun nnnil-server-opened (&optional _server)
   t)
 
-(defun nnnil-status-message (&optional server)
+(defun nnnil-status-message (&optional _server)
   nnnil-status-string)
 
-(defun nnnil-request-article (article &optional group server to-buffer)
+(defun nnnil-request-article (_article &optional _group _server _to-buffer)
   (setq nnnil-status-string "No such group")
   nil)
 
-(defun nnnil-request-group (group &optional server fast info)
+(defun nnnil-request-group (_group &optional _server _fast _info)
   (let (deactivate-mark)
     (with-current-buffer nntp-server-buffer
       (erase-buffer)
@@ -64,15 +64,15 @@
   (setq nnnil-status-string "No such group")
   nil)
 
-(defun nnnil-close-group (group &optional server)
+(defun nnnil-close-group (_group &optional _server)
   t)
 
-(defun nnnil-request-list (&optional server)
+(defun nnnil-request-list (&optional _server)
   (with-current-buffer nntp-server-buffer
     (erase-buffer))
   t)
 
-(defun nnnil-request-post (&optional server)
+(defun nnnil-request-post (&optional _server)
   (setq nnnil-status-string "Read-only server")
   nil)
 
diff --git a/lisp/gnus/nnoo.el b/lisp/gnus/nnoo.el
index cd0a5e6..e7bed3f 100644
--- a/lisp/gnus/nnoo.el
+++ b/lisp/gnus/nnoo.el
@@ -1,4 +1,4 @@
-;;; nnoo.el --- OO Gnus Backends
+;;; nnoo.el --- OO Gnus Backends  -*- lexical-binding: t; -*-
 
 ;; Copyright (C) 1996-2021 Free Software Foundation, Inc.
 
@@ -81,24 +81,19 @@
 
 (defmacro nnoo-import (backend &rest imports)
   (declare (indent 1))
-  `(nnoo-import-1 ',backend ',imports))
-
-(defun nnoo-import-1 (backend imports)
   (let ((call-function
-        (if (symbolp (car imports)) (pop imports) 'nnoo-parent-function))
-       imp functions function)
-    (while (setq imp (pop imports))
-      (setq functions
-           (or (cdr imp)
-               (nnoo-functions (car imp))))
-      (while functions
-       (unless (fboundp
-                (setq function
-                      (nnoo-symbol backend
-                                   (nnoo-rest-symbol (car functions)))))
-         (eval `(deffoo ,function (&rest args)
-                  (,call-function ',backend ',(car functions) args))))
-       (pop functions)))))
+        (if (symbolp (car imports)) (pop imports) 'nnoo-parent-function)))
+    `(progn
+       ,@(mapcan
+          (lambda (imp)
+            (mapcar
+            (lambda (fun)
+              (let ((function (nnoo-symbol backend (nnoo-rest-symbol fun))))
+                `(unless (fboundp ',function)
+                   (deffoo ,function (&rest args)
+                     (,call-function ',backend ',fun args)))))
+            (or (cdr imp) (nnoo-functions (car imp)))))
+         imports))))
 
 (defun nnoo-parent-function (backend function args)
   (let ((pbackend (nnoo-backend function))
@@ -131,22 +126,21 @@
 
 (defmacro nnoo-map-functions (backend &rest maps)
   (declare (indent 1))
-  `(nnoo-map-functions-1 ',backend ',maps))
-
-(defun nnoo-map-functions-1 (backend maps)
-  (let (m margs i)
-    (while (setq m (pop maps))
-      (setq i 0
-           margs nil)
-      (while (< i (length (cdr m)))
-       (if (numberp (nth i (cdr m)))
-           (push `(nth ,i args) margs)
-         (push (nth i (cdr m)) margs))
-       (cl-incf i))
-      (eval `(deffoo ,(nnoo-symbol backend (nnoo-rest-symbol (car m)))
+  `(progn
+     ,@(mapcar
+        (lambda (m)
+          (let ((margs nil))
+            (dotimes (i (length (cdr m)))
+             (push (if (numberp (nth i (cdr m)))
+                       `(nth ,i args)
+                     (nth i (cdr m)))
+                   margs))
+           `(deffoo ,(nnoo-symbol backend (nnoo-rest-symbol (car m)))
                 (&rest args)
+              (ignore args) ;; Not always used!
               (nnoo-parent-function ',backend ',(car m)
-                                    ,(cons 'list (nreverse margs))))))))
+                                    ,(cons 'list (nreverse margs))))))
+       maps)))
 
 (defun nnoo-backend (symbol)
   (string-match "^[^-]+-" (symbol-name symbol))
@@ -264,7 +258,7 @@
              nnoo-state-alist))
   t)
 
-(defun nnoo-status-message (backend server)
+(defun nnoo-status-message (backend _server)
   (nnheader-get-report backend))
 
 (defun nnoo-server-opened (backend server)
@@ -273,19 +267,27 @@
 
 (defmacro nnoo-define-basics (backend)
   "Define `close-server', `server-opened' and `status-message'."
-  `(eval-and-compile
-     (nnoo-define-basics-1 ',backend)))
-
-(defun nnoo-define-basics-1 (backend)
-  (dolist (function '(server-opened status-message))
-    (eval `(deffoo ,(nnoo-symbol backend function) (&optional server)
-            (,(nnoo-symbol 'nnoo function) ',backend server))))
-  (dolist (function '(close-server))
-    (eval `(deffoo ,(nnoo-symbol backend function) (&optional server defs)
-            (,(nnoo-symbol 'nnoo function) ',backend server))))
-  (eval `(deffoo ,(nnoo-symbol backend 'open-server)
-            (server &optional defs)
-          (nnoo-change-server ',backend server defs))))
+  (let ((form
+         ;; We wrap the definitions in `when t' here so that a subsequent
+         ;; "real" definition of one those doesn't trigger a "defined multiple
+         ;; times" warning.
+         `(when t
+            ,@(mapcar (lambda (fun)
+                       `(deffoo ,(nnoo-symbol backend fun) (&optional server)
+                         (,(nnoo-symbol 'nnoo fun) ',backend server)))
+                    '(server-opened status-message))
+          (deffoo ,(nnoo-symbol backend 'close-server) (&optional server _defs)
+             (,(nnoo-symbol 'nnoo 'close-server) ',backend server))
+           (deffoo ,(nnoo-symbol backend 'open-server) (server &optional defs)
+             (nnoo-change-server ',backend server defs)))))
+    ;; Wrapping with `when' has the downside that the compiler now doesn't
+    ;; "know" that these functions are defined, so to avoid "not known to be
+    ;; defined" warnings we eagerly define them during the compilation.
+    ;; This is fairly nasty since it will override previous "real" definitions
+    ;; (e.g. when compiling this in an Emacs instance that's running Gnus), but
+    ;; that's also what the previous code did, so it sucks but is not worse.
+    (eval form t)
+    form))
 
 (defmacro nnoo-define-skeleton (backend)
   "Define all required backend functions for BACKEND.
@@ -294,17 +296,15 @@ All functions will return nil and report an error."
      (nnoo-define-skeleton-1 ',backend)))
 
 (defun nnoo-define-skeleton-1 (backend)
-  (let ((functions '(retrieve-headers
-                    request-close request-article
-                    request-group close-group
-                    request-list request-post request-list-newsgroups))
-       function fun)
-    (while (setq function (pop functions))
-      (when (not (fboundp (setq fun (nnoo-symbol backend function))))
-       (eval `(deffoo ,fun
-                  (&rest args)
-                (nnheader-report ',backend ,(format "%s-%s not implemented"
-                                                    backend function))))))))
+  (dolist (op '(retrieve-headers
+               request-close request-article
+               request-group close-group
+               request-list request-post request-list-newsgroups))
+    (let ((fun (nnoo-symbol backend op)))
+      (unless (fboundp fun)
+       (let ((msg (format "%s-%s not implemented" backend op)))
+         (defalias fun
+           (lambda (&rest _args) (nnheader-report backend msg))))))))
 
 (defun nnoo-set (server &rest args)
   (let ((parents (nnoo-parents (car server)))
diff --git a/lisp/gnus/nnregistry.el b/lisp/gnus/nnregistry.el
index e78f93d..15e41e9 100644
--- a/lisp/gnus/nnregistry.el
+++ b/lisp/gnus/nnregistry.el
@@ -1,5 +1,4 @@
-;;; nnregistry.el --- access to articles via Gnus' message-id registry
-;;; -*- coding: utf-8 -*-
+;;; nnregistry.el --- access to articles via Gnus' message-id registry  -*- 
lexical-binding: t; -*-
 
 ;; Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
@@ -36,21 +35,21 @@
 
 (nnoo-declare nnregistry)
 
-(deffoo nnregistry-server-opened (server)
+(deffoo nnregistry-server-opened (_server)
   gnus-registry-enabled)
 
-(deffoo nnregistry-close-server (server &optional defs)
+(deffoo nnregistry-close-server (_server &optional _defs)
   t)
 
-(deffoo nnregistry-status-message (server)
+(deffoo nnregistry-status-message (_server)
   nil)
 
-(deffoo nnregistry-open-server (server &optional defs)
+(deffoo nnregistry-open-server (_server &optional _defs)
   gnus-registry-enabled)
 
 (defvar nnregistry-within-nnregistry nil)
 
-(deffoo nnregistry-request-article (id &optional group server buffer)
+(deffoo nnregistry-request-article (id &optional _group _server buffer)
   (and (not nnregistry-within-nnregistry)
        (let* ((nnregistry-within-nnregistry t)
              (group (nth 0 (gnus-registry-get-id-key id 'group)))
diff --git a/lisp/gnus/nnrss.el b/lisp/gnus/nnrss.el
index a340c9e..0501d9e 100644
--- a/lisp/gnus/nnrss.el
+++ b/lisp/gnus/nnrss.el
@@ -1,4 +1,4 @@
-;;; nnrss.el --- interfacing with RSS
+;;; nnrss.el --- interfacing with RSS  -*- lexical-binding: t; -*-
 
 ;; Copyright (C) 2001-2021 Free Software Foundation, Inc.
 
@@ -100,7 +100,6 @@ Note that you have to regenerate all the nnrss groups if 
you change
 the value.  Moreover, you should be patient even if you are made to
 read the same articles twice, that arises for the difference of the
 versions of xml.el."
-  :group 'nnrss
   :type 'coding-system)
 
 (defvar nnrss-compatible-encoding-alist
@@ -126,7 +125,7 @@ for decoding when the cdr that the data specify is not 
available.")
       (setq group (decode-coding-string group 'utf-8))
     group))
 
-(deffoo nnrss-retrieve-headers (articles &optional group server fetch-old)
+(deffoo nnrss-retrieve-headers (articles &optional group server _fetch-old)
   (setq group (nnrss-decode-group-name group))
   (nnrss-possibly-change-group group server)
   (let (e)
@@ -174,7 +173,7 @@ for decoding when the cdr that the data specify is not 
available.")
                    "\n")))))
   'nov)
 
-(deffoo nnrss-request-group (group &optional server dont-check info)
+(deffoo nnrss-request-group (group &optional server dont-check _info)
   (setq group (nnrss-decode-group-name group))
   (nnheader-message 6 "nnrss: Requesting %s..." group)
   (nnrss-possibly-change-group group server)
@@ -189,7 +188,7 @@ for decoding when the cdr that the data specify is not 
available.")
         t))
     (nnheader-message 6 "nnrss: Requesting %s...done" group)))
 
-(deffoo nnrss-close-group (group &optional server)
+(deffoo nnrss-close-group (_group &optional _server)
   t)
 
 (deffoo nnrss-request-article (article &optional group server buffer)
@@ -201,7 +200,7 @@ for decoding when the cdr that the data specify is not 
available.")
   (nnrss-possibly-change-group group server)
   (let ((e (assq article nnrss-group-data))
        (nntp-server-buffer (or buffer nntp-server-buffer))
-       post err)
+       err)
     (when e
       (with-current-buffer nntp-server-buffer
        (erase-buffer)
@@ -223,7 +222,7 @@ for decoding when the cdr that the data specify is not 
available.")
                   (cons '("Newsgroups" . utf-8)
                         rfc2047-header-encoding-alist)
                 rfc2047-header-encoding-alist))
-             rfc2047-encode-encoded-words body fn)
+             rfc2047-encode-encoded-words body)
          (when (or text link enclosure comments)
            (insert "\n")
            (insert "<#multipart type=alternative>\n"
@@ -312,7 +311,7 @@ for decoding when the cdr that the data specify is not 
available.")
       ;; we return the article number.
       (cons nnrss-group (car e))))))
 
-(deffoo nnrss-open-server (server &optional defs connectionless)
+(deffoo nnrss-open-server (server &optional defs _connectionless)
   (nnrss-read-server-data server)
   (nnoo-change-server 'nnrss server defs)
   t)
@@ -336,7 +335,7 @@ for decoding when the cdr that the data specify is not 
available.")
        (nnrss-save-group-data group server))
     not-expirable))
 
-(deffoo nnrss-request-delete-group (group &optional force server)
+(deffoo nnrss-request-delete-group (group &optional _force server)
   (setq group (nnrss-decode-group-name group))
   (nnrss-possibly-change-group group server)
   (let (elem)
@@ -562,7 +561,7 @@ which RSS 2.0 allows."
 
 ;;; URL interface
 
-(defun nnrss-no-cache (url)
+(defun nnrss-no-cache (_url)
   "")
 
 (defun nnrss-insert (url)
@@ -614,7 +613,7 @@ which RSS 2.0 allows."
 
 (defun nnrss-check-group (group server)
   (let (file xml subject url extra changed author date feed-subject
-            enclosure comments rss-ns rdf-ns content-ns dc-ns
+            enclosure comments rss-ns  content-ns dc-ns ;; rdf-ns
             hash-index)
     (if (and nnrss-use-local
             (file-exists-p (setq file (expand-file-name
@@ -638,7 +637,7 @@ which RSS 2.0 allows."
        (setq changed t))
       (setq xml (nnrss-fetch url)))
     (setq dc-ns (nnrss-get-namespace-prefix xml 
"http://purl.org/dc/elements/1.1/";)
-         rdf-ns (nnrss-get-namespace-prefix xml 
"http://www.w3.org/1999/02/22-rdf-syntax-ns#";)
+         ;; rdf-ns (nnrss-get-namespace-prefix xml 
"http://www.w3.org/1999/02/22-rdf-syntax-ns#";)
          rss-ns (nnrss-get-namespace-prefix xml "http://purl.org/rss/1.0/";)
          content-ns (nnrss-get-namespace-prefix xml 
"http://purl.org/rss/1.0/modules/content/";))
     (dolist (item (nreverse (nnrss-find-el (intern (concat rss-ns "item")) 
xml)))
diff --git a/lisp/gnus/nnspool.el b/lisp/gnus/nnspool.el
index cb85417..ce9ab3c 100644
--- a/lisp/gnus/nnspool.el
+++ b/lisp/gnus/nnspool.el
@@ -1,4 +1,4 @@
-;;; nnspool.el --- spool access for GNU Emacs
+;;; nnspool.el --- spool access for GNU Emacs  -*- lexical-binding: t; -*-
 
 ;; Copyright (C) 1988-1990, 1993-1998, 2000-2021 Free Software
 ;; Foundation, Inc.
@@ -126,7 +126,7 @@ there.")
 
 (nnoo-define-basics nnspool)
 
-(deffoo nnspool-retrieve-headers (articles &optional group server fetch-old)
+(deffoo nnspool-retrieve-headers (articles &optional group _server fetch-old)
   "Retrieve the headers of ARTICLES."
   (with-current-buffer nntp-server-buffer
     (erase-buffer)
@@ -203,7 +203,7 @@ there.")
                     server nnspool-spool-directory)
     t)))
 
-(deffoo nnspool-request-article (id &optional group server buffer)
+(deffoo nnspool-request-article (id &optional group _server buffer)
   "Select article by message ID (or number)."
   (nnspool-possibly-change-directory group)
   (let ((nntp-server-buffer (or buffer nntp-server-buffer))
@@ -222,7 +222,7 @@ there.")
             (cons nnspool-current-group id)
           ag))))
 
-(deffoo nnspool-request-body (id &optional group server)
+(deffoo nnspool-request-body (id &optional group _server)
   "Select article body by message ID (or number)."
   (nnspool-possibly-change-directory group)
   (let ((res (nnspool-request-article id)))
@@ -233,7 +233,7 @@ there.")
          (delete-region (point-min) (point)))
        res))))
 
-(deffoo nnspool-request-head (id &optional group server)
+(deffoo nnspool-request-head (id &optional group _server)
   "Select article head by message ID (or number)."
   (nnspool-possibly-change-directory group)
   (let ((res (nnspool-request-article id)))
@@ -245,7 +245,7 @@ there.")
        (nnheader-fold-continuation-lines)))
     res))
 
-(deffoo nnspool-request-group (group &optional server dont-check info)
+(deffoo nnspool-request-group (group &optional _server dont-check _info)
   "Select news GROUP."
   (let ((pathname (nnspool-article-pathname group))
        dir)
@@ -269,26 +269,26 @@ there.")
          (nnheader-report 'nnspool "Empty group %s" group)
          (nnheader-insert "211 0 0 0 %s\n" group))))))
 
-(deffoo nnspool-request-type (group &optional article)
+(deffoo nnspool-request-type (_group &optional _article)
   'news)
 
-(deffoo nnspool-close-group (group &optional server)
+(deffoo nnspool-close-group (_group &optional _server)
   t)
 
-(deffoo nnspool-request-list (&optional server)
+(deffoo nnspool-request-list (&optional _server)
   "List active newsgroups."
   (save-excursion
     (or (nnspool-find-file nnspool-active-file)
        (nnheader-report 'nnspool (nnheader-file-error nnspool-active-file)))))
 
-(deffoo nnspool-request-list-newsgroups (&optional server)
+(deffoo nnspool-request-list-newsgroups (&optional _server)
   "List newsgroups (defined in NNTP2)."
   (save-excursion
     (or (nnspool-find-file nnspool-newsgroups-file)
        (nnheader-report 'nnspool (nnheader-file-error
                                   nnspool-newsgroups-file)))))
 
-(deffoo nnspool-request-list-distributions (&optional server)
+(deffoo nnspool-request-list-distributions (&optional _server)
   "List distributions (defined in NNTP2)."
   (save-excursion
     (or (nnspool-find-file nnspool-distributions-file)
@@ -296,7 +296,7 @@ there.")
                                   nnspool-distributions-file)))))
 
 ;; Suggested by Hallvard B Furuseth <h.b.furuseth@usit.uio.no>.
-(deffoo nnspool-request-newgroups (date &optional server)
+(deffoo nnspool-request-newgroups (date &optional _server)
   "List groups created after DATE."
   (if (nnspool-find-file nnspool-active-times-file)
       (save-excursion
@@ -323,7 +323,7 @@ there.")
        t)
     nil))
 
-(deffoo nnspool-request-post (&optional server)
+(deffoo nnspool-request-post (&optional _server)
   "Post a new news in current buffer."
   (save-excursion
     (let* ((process-connection-type nil) ; t bugs out on Solaris
@@ -356,7 +356,7 @@ there.")
 
 ;;; Internal functions.
 
-(defun nnspool-inews-sentinel (proc status)
+(defun nnspool-inews-sentinel (proc _status)
   (with-current-buffer (process-buffer proc)
     (goto-char (point-min))
     (if (or (zerop (buffer-size))
diff --git a/lisp/gnus/nntp.el b/lisp/gnus/nntp.el
index c2bb960..1eb604d 100644
--- a/lisp/gnus/nntp.el
+++ b/lisp/gnus/nntp.el
@@ -335,16 +335,16 @@ retried once before actually displaying the error report."
 
     (apply #'error args)))
 
-(defmacro nntp-copy-to-buffer (buffer start end)
+(defsubst nntp-copy-to-buffer (buffer start end)
   "Copy string from unibyte current buffer to multibyte buffer."
-  `(let ((string (buffer-substring ,start ,end)))
-     (with-current-buffer ,buffer
+  (let ((string (buffer-substring start end)))
+     (with-current-buffer buffer
        (erase-buffer)
        (insert string)
        (goto-char (point-min))
        nil)))
 
-(defsubst nntp-wait-for (process wait-for buffer &optional decode discard)
+(defun nntp-wait-for (process wait-for buffer &optional decode discard)
   "Wait for WAIT-FOR to arrive from PROCESS."
 
   (with-current-buffer (process-buffer process)
@@ -436,7 +436,7 @@ retried once before actually displaying the error report."
     (when process
       (process-buffer process))))
 
-(defsubst nntp-retrieve-data (command address _port buffer
+(defun nntp-retrieve-data (command address _port buffer
                                      &optional wait-for callback decode)
   "Use COMMAND to retrieve data into BUFFER from PORT on ADDRESS."
   (let ((process (or (nntp-find-connection buffer)
@@ -469,7 +469,7 @@ retried once before actually displaying the error report."
              nil)))
       (nnheader-report 'nntp "Couldn't open connection to %s" address))))
 
-(defsubst nntp-send-command (wait-for &rest strings)
+(defun nntp-send-command (wait-for &rest strings)
   "Send STRINGS to server and wait until WAIT-FOR returns."
   (when (not (or nnheader-callback-function
                  nntp-inhibit-output))
@@ -1330,7 +1330,7 @@ If SEND-IF-FORCE, only send authinfo to the server if the
     (dolist (entry nntp-server-action-alist)
       (when (string-match (car entry) nntp-server-type)
        (if (not (functionp (cadr entry)))
-           (eval (cadr entry))
+           (eval (cadr entry) t)
          (funcall (cadr entry)))))))
 
 (defun nntp-async-wait (process wait-for buffer decode callback)
diff --git a/lisp/gnus/nnvirtual.el b/lisp/gnus/nnvirtual.el
index 902df86..b3b701e 100644
--- a/lisp/gnus/nnvirtual.el
+++ b/lisp/gnus/nnvirtual.el
@@ -1,4 +1,4 @@
-;;; nnvirtual.el --- virtual newsgroups access for Gnus
+;;; nnvirtual.el --- virtual newsgroups access for Gnus  -*- lexical-binding: 
t; -*-
 
 ;; Copyright (C) 1994-2021 Free Software Foundation, Inc.
 
@@ -94,8 +94,8 @@ It is computed from the marks of individual component 
groups.")
 (nnoo-define-basics nnvirtual)
 
 
-(deffoo nnvirtual-retrieve-headers (articles &optional newsgroup
-                                            server fetch-old)
+(deffoo nnvirtual-retrieve-headers (articles &optional _newsgroup
+                                            server _fetch-old)
   (when (nnvirtual-possibly-change-server server)
     (with-current-buffer nntp-server-buffer
       (erase-buffer)
@@ -186,7 +186,7 @@ It is computed from the marks of individual component 
groups.")
 
 (defvoo nnvirtual-last-accessed-component-group nil)
 
-(deffoo nnvirtual-request-article (article &optional group server buffer)
+(deffoo nnvirtual-request-article (article &optional _group server buffer)
   (when (nnvirtual-possibly-change-server server)
     (if (stringp article)
        ;; This is a fetch by Message-ID.
@@ -250,7 +250,7 @@ It is computed from the marks of individual component 
groups.")
       t)))
 
 
-(deffoo nnvirtual-request-group (group &optional server dont-check info)
+(deffoo nnvirtual-request-group (group &optional server dont-check _info)
   (nnvirtual-possibly-change-server server)
   (setq nnvirtual-component-groups
        (delete (nnvirtual-current-group) nnvirtual-component-groups))
@@ -269,7 +269,7 @@ It is computed from the marks of individual component 
groups.")
                     nnvirtual-mapping-len nnvirtual-mapping-len group))))
 
 
-(deffoo nnvirtual-request-type (group &optional article)
+(deffoo nnvirtual-request-type (_group &optional article)
   (if (not article)
       'unknown
     (if (numberp article)
@@ -279,7 +279,7 @@ It is computed from the marks of individual component 
groups.")
       (gnus-request-type
        nnvirtual-last-accessed-component-group nil))))
 
-(deffoo nnvirtual-request-update-mark (group article mark)
+(deffoo nnvirtual-request-update-mark (_group article mark)
   (let* ((nart (nnvirtual-map-article article))
         (cgroup (car nart)))
     (when (and nart
@@ -291,22 +291,22 @@ It is computed from the marks of individual component 
groups.")
   mark)
 
 
-(deffoo nnvirtual-close-group (group &optional server)
+(deffoo nnvirtual-close-group (_group &optional server)
   (when (and (nnvirtual-possibly-change-server server)
             (not (gnus-ephemeral-group-p (nnvirtual-current-group))))
     (nnvirtual-update-read-and-marked t t))
   t)
 
 
-(deffoo nnvirtual-request-newgroups (date &optional server)
+(deffoo nnvirtual-request-newgroups (_date &optional _server)
   (nnheader-report 'nnvirtual "NEWGROUPS is not supported."))
 
 
-(deffoo nnvirtual-request-list-newsgroups (&optional server)
+(deffoo nnvirtual-request-list-newsgroups (&optional _server)
   (nnheader-report 'nnvirtual "LIST NEWSGROUPS is not implemented."))
 
 
-(deffoo nnvirtual-request-update-info (group info &optional server)
+(deffoo nnvirtual-request-update-info (_group info &optional server)
   (when (and (nnvirtual-possibly-change-server server)
             (not nnvirtual-info-installed))
     ;; Install the precomputed lists atomically, so the virtual group
@@ -321,7 +321,7 @@ It is computed from the marks of individual component 
groups.")
     t))
 
 
-(deffoo nnvirtual-catchup-group (group &optional server all)
+(deffoo nnvirtual-catchup-group (_group &optional server all)
   (when (and (nnvirtual-possibly-change-server server)
             (not (gnus-ephemeral-group-p (nnvirtual-current-group))))
     ;; copy over existing marks first, in case they set anything
@@ -339,12 +339,12 @@ It is computed from the marks of individual component 
groups.")
        (gnus-group-catchup-current nil all)))))
 
 
-(deffoo nnvirtual-find-group-art (group article)
+(deffoo nnvirtual-find-group-art (_group article)
   "Return the real group and article for virtual GROUP and ARTICLE."
   (nnvirtual-map-article article))
 
 
-(deffoo nnvirtual-request-post (&optional server)
+(deffoo nnvirtual-request-post (&optional _server)
   (if (not gnus-message-group-art)
       (nnheader-report 'nnvirtual "Can't post to an nnvirtual group")
     (let ((group (car (nnvirtual-find-group-art
@@ -353,8 +353,8 @@ It is computed from the marks of individual component 
groups.")
       (gnus-request-post (gnus-find-method-for-group group)))))
 
 
-(deffoo nnvirtual-request-expire-articles (articles group
-                                                   &optional server force)
+(deffoo nnvirtual-request-expire-articles ( _articles _group
+                                           &optional server _force)
   (nnvirtual-possibly-change-server server)
   (setq nnvirtual-component-groups
        (delete (nnvirtual-current-group) nnvirtual-component-groups))
diff --git a/lisp/gnus/nnweb.el b/lisp/gnus/nnweb.el
index 2a94825..af715a1 100644
--- a/lisp/gnus/nnweb.el
+++ b/lisp/gnus/nnweb.el
@@ -1,4 +1,4 @@
-;;; nnweb.el --- retrieving articles via web search engines
+;;; nnweb.el --- retrieving articles via web search engines  -*- 
lexical-binding: t; -*-
 
 ;; Copyright (C) 1996-2021 Free Software Foundation, Inc.
 
@@ -96,7 +96,7 @@ Valid types include `google', `dejanews', and `gmane'.")
 
 (nnoo-define-basics nnweb)
 
-(deffoo nnweb-retrieve-headers (articles &optional group server fetch-old)
+(deffoo nnweb-retrieve-headers (articles &optional group server _fetch-old)
   (nnweb-possibly-change-server group server)
   (with-current-buffer nntp-server-buffer
     (erase-buffer)
@@ -117,7 +117,7 @@ Valid types include `google', `dejanews', and `gmane'.")
     (nnweb-write-active)
     (nnweb-write-overview group)))
 
-(deffoo nnweb-request-group (group &optional server dont-check info)
+(deffoo nnweb-request-group (group &optional server dont-check _info)
   (nnweb-possibly-change-server group server)
   (unless (or nnweb-ephemeral-p
              dont-check
@@ -154,17 +154,16 @@ Valid types include `google', `dejanews', and `gmane'.")
                (and (stringp article)
                     (nnweb-definition 'id t)
                     (let ((fetch (nnweb-definition 'id))
-                          art active)
-                      (when (string-match "^<\\(.*\\)>$" article)
-                        (setq art (match-string 1 article)))
+                          (art (when (string-match "^<\\(.*\\)>$" article)
+                                 (match-string 1 article))))
                       (when (and fetch art)
                         (setq url (format fetch
                                           (mm-url-form-encode-xwfu art)))
                         (mm-url-insert url)
                         (if (nnweb-definition 'reference t)
                             (setq article
-                                  (funcall (nnweb-definition
-                                            'reference) article)))))))
+                                  (funcall (nnweb-definition 'reference)
+                                           article)))))))
        (unless nnheader-callback-function
          (funcall (nnweb-definition 'article)))
        (nnheader-report 'nnweb "Fetched article %s" article)
@@ -184,19 +183,19 @@ Valid types include `google', `dejanews', and `gmane'.")
     (nnmail-generate-active (list (assoc server nnweb-group-alist)))
     t))
 
-(deffoo nnweb-request-update-info (group info &optional server))
+(deffoo nnweb-request-update-info (_group _info &optional _server))
 
 (deffoo nnweb-asynchronous-p ()
   nil)
 
-(deffoo nnweb-request-create-group (group &optional server args)
+(deffoo nnweb-request-create-group (group &optional server _args)
   (nnweb-possibly-change-server nil server)
   (nnweb-request-delete-group group)
   (push `(,group ,(cons 1 0)) nnweb-group-alist)
   (nnweb-write-active)
   t)
 
-(deffoo nnweb-request-delete-group (group &optional force server)
+(deffoo nnweb-request-delete-group (group &optional _force server)
   (nnweb-possibly-change-server group server)
   (gnus-alist-pull group nnweb-group-alist t)
   (nnweb-write-active)
@@ -317,7 +316,7 @@ Valid types include `google', `dejanews', and `gmane'.")
   (let ((i 0)
        (case-fold-search t)
        (active (cadr (assoc nnweb-group nnweb-group-alist)))
-       Subject Score Date Newsgroups From
+       Subject Date Newsgroups From
        map url mid)
     (unless active
       (push (list nnweb-group (setq active (cons 1 0)))
diff --git a/lisp/gnus/score-mode.el b/lisp/gnus/score-mode.el
index b8726c0..d3ed360 100644
--- a/lisp/gnus/score-mode.el
+++ b/lisp/gnus/score-mode.el
@@ -1,4 +1,4 @@
-;;; score-mode.el --- mode for editing Gnus score files
+;;; score-mode.el --- mode for editing Gnus score files  -*- lexical-binding: 
t; -*-
 
 ;; Copyright (C) 1996, 2001-2021 Free Software Foundation, Inc.
 
diff --git a/lisp/gnus/smiley.el b/lisp/gnus/smiley.el
index 9884bcc..3ee5947 100644
--- a/lisp/gnus/smiley.el
+++ b/lisp/gnus/smiley.el
@@ -1,4 +1,4 @@
-;;; smiley.el --- displaying smiley faces
+;;; smiley.el --- displaying smiley faces  -*- lexical-binding: t; -*-
 
 ;; Copyright (C) 2000-2021 Free Software Foundation, Inc.
 
diff --git a/lisp/gnus/smime.el b/lisp/gnus/smime.el
index 147c51d..8900be5 100644
--- a/lisp/gnus/smime.el
+++ b/lisp/gnus/smime.el
@@ -135,8 +135,7 @@ certificates to be sent with every message to each address."
   :type '(repeat (list (string :tag "Mail address")
                       (file :tag "File name")
                       (repeat :tag "Additional certificate files"
-                              (file :tag "File name"))))
-  :group 'smime)
+                              (file :tag "File name")))))
 
 (defcustom smime-CA-directory nil
   "Directory containing certificates for CAs you trust.
@@ -148,16 +147,14 @@ $ ln -s ca.pem \\=`openssl x509 -noout -hash -in 
ca.pem\\=`.0
 where `ca.pem' is the file containing a PEM encoded X.509 CA
 certificate."
   :type '(choice (const :tag "none" nil)
-                directory)
-  :group 'smime)
+                directory))
 
 (defcustom smime-CA-file nil
   "Files containing certificates for CAs you trust.
 File should contain certificates in PEM format."
   :version "22.1"
   :type '(choice (const :tag "none" nil)
-                file)
-  :group 'smime)
+                file))
 
 (defcustom smime-certificate-directory "~/Mail/certs/"
   "Directory containing other people's certificates.
@@ -166,8 +163,7 @@ and the files themselves should be in PEM format."
 ;The S/MIME library provide simple functionality for fetching
 ;certificates into this directory, so there is no need to populate it
 ;manually.
-  :type 'directory
-  :group 'smime)
+  :type 'directory)
 
 (defcustom smime-openssl-program
   (and (condition-case ()
@@ -176,8 +172,7 @@ and the files themselves should be in PEM format."
        "openssl")
   "Name of OpenSSL binary or nil if none."
   :type '(choice string
-                 (const :tag "none" nil))
-  :group 'smime)
+                 (const :tag "none" nil)))
 
 ;; OpenSSL option to select the encryption cipher
 
@@ -191,8 +186,7 @@ and the files themselves should be in PEM format."
                 (const :tag "AES 128 bits" "-aes128")
                 (const :tag "RC2 40 bits" "-rc2-40")
                 (const :tag "RC2 64 bits" "-rc2-64")
-                (const :tag "RC2 128 bits" "-rc2-128"))
-  :group 'smime)
+                (const :tag "RC2 128 bits" "-rc2-128")))
 
 (defcustom smime-crl-check nil
   "Check revocation status of signers certificate using CRLs.
@@ -212,24 +206,21 @@ certificate with .r0 as file name extension.
 At least OpenSSL version 0.9.7 is required for this to work."
   :type '(choice (const :tag "No check" nil)
                 (const :tag "Check certificate" "-crl_check")
-                (const :tag "Check certificate chain" "-crl_check_all"))
-  :group 'smime)
+                (const :tag "Check certificate chain" "-crl_check_all")))
 
 (defcustom smime-dns-server nil
   "DNS server to query certificates from.
 If nil, use system defaults."
   :version "22.1"
   :type '(choice (const :tag "System defaults")
-                string)
-  :group 'smime)
+                string))
 
 (defcustom smime-ldap-host-list nil
   "A list of LDAP hosts with S/MIME user certificates.
 If needed search base, binddn, passwd, etc. for the LDAP host
 must be set in `ldap-host-parameters-alist'."
   :type '(repeat (string :tag "Host name"))
-  :version "23.1" ;; No Gnus
-  :group 'smime)
+  :version "23.1") ;; No Gnus
 
 (defvar smime-details-buffer "*OpenSSL output*")
 
diff --git a/lisp/gnus/spam-report.el b/lisp/gnus/spam-report.el
index e212556..d87a6c2 100644
--- a/lisp/gnus/spam-report.el
+++ b/lisp/gnus/spam-report.el
@@ -1,4 +1,4 @@
-;;; spam-report.el --- Reporting spam
+;;; spam-report.el --- Reporting spam  -*- lexical-binding: t; -*-
 
 ;; Copyright (C) 2002-2021 Free Software Foundation, Inc.
 
@@ -43,8 +43,7 @@ If you are using spam.el, consider setting 
gnus-spam-process-newsgroups
 or the gnus-group-spam-exit-processor-report-gmane group/topic parameter
 instead."
   :type '(radio (const nil)
-               (regexp :value "^nntp\\+.*:gmane\\."))
-  :group 'spam-report)
+               (regexp :value "^nntp\\+.*:gmane\\.")))
 
 (defcustom spam-report-gmane-use-article-number t
   "Whether the article number (faster!) or the header should be used.
@@ -52,8 +51,7 @@ instead."
 You must set this to nil if you don't read Gmane groups directly
 from news.gmane.org, e.g. when using local newsserver such as
 leafnode."
-  :type 'boolean
-  :group 'spam-report)
+  :type 'boolean)
 
 (defcustom spam-report-url-ping-function
   'spam-report-url-ping-plain
@@ -66,23 +64,20 @@ The function must accept the arguments `host' and `report'."
                 spam-report-url-ping-mm-url)
          (const :tag "Store request URLs in `spam-report-requests-file'"
                 spam-report-url-to-file)
-         (function :tag "User defined function" nil))
-  :group 'spam-report)
+         (function :tag "User defined function" nil)))
 
 (defcustom spam-report-requests-file
   (nnheader-concat gnus-directory "spam/" "spam-report-requests.url")
   ;; Is there a convention for the extension of such a file?
   ;; Should we use `spam-directory'?
   "File where spam report request are stored."
-  :type 'file
-  :group 'spam-report)
+  :type 'file)
 
 (defcustom spam-report-resend-to nil
   "Email address that spam articles are resent to when reporting.
 If not set, the user will be prompted to enter a value which will be
 saved for future use."
-  :type '(choice (const :tag "Prompt" nil) string)
-  :group 'spam-report)
+  :type '(choice (const :tag "Prompt" nil) string))
 
 (defvar spam-report-url-ping-temp-agent-function nil
   "Internal variable for `spam-report-agentize' and `spam-report-deagentize'.
@@ -232,8 +227,7 @@ the function specified by `spam-report-url-ping-function'."
 This is initialized based on `user-mail-address'."
   :type '(choice string
                 (const :tag "Don't expose address" nil))
-  :version "23.1" ;; No Gnus
-  :group 'spam-report)
+  :version "23.1") ;; No Gnus
 
 (defvar spam-report-user-agent
   (if spam-report-user-mail-address
diff --git a/lisp/gnus/spam-stat.el b/lisp/gnus/spam-stat.el
index 89c2deb..3da882c 100644
--- a/lisp/gnus/spam-stat.el
+++ b/lisp/gnus/spam-stat.el
@@ -1,4 +1,4 @@
-;;; spam-stat.el --- detecting spam based on statistics
+;;; spam-stat.el --- detecting spam based on statistics  -*- lexical-binding: 
t; -*-
 
 ;; Copyright (C) 2002-2021 Free Software Foundation, Inc.
 
@@ -135,42 +135,35 @@ whether a buffer contains spam or not."
 (defcustom spam-stat-file "~/.spam-stat.el"
   "File used to save and load the dictionary.
 See `spam-stat-to-hash-table' for the format of the file."
-  :type 'file
-  :group 'spam-stat)
+  :type 'file)
 
 (defcustom spam-stat-unknown-word-score 0.2
   "The score to use for unknown words.
 Also used for words that don't appear often enough."
-  :type 'number
-  :group 'spam-stat)
+  :type 'number)
 
 (defcustom spam-stat-max-word-length 15
   "Only words shorter than this will be considered."
-  :type 'integer
-  :group 'spam-stat)
+  :type 'integer)
 
 (defcustom spam-stat-max-buffer-length 10240
   "Only the beginning of buffers will be analyzed.
 This variable says how many characters this will be."
-  :type 'integer
-  :group 'spam-stat)
+  :type 'integer)
 
 (defcustom spam-stat-split-fancy-spam-group "mail.spam"
   "Name of the group where spam should be stored.
 If `spam-stat-split-fancy' is used in fancy splitting rules.  Has
 no effect when spam-stat is invoked through spam.el."
-  :type 'string
-  :group 'spam-stat)
+  :type 'string)
 
 (defcustom spam-stat-split-fancy-spam-threshold 0.9
   "Spam score threshold in spam-stat-split-fancy."
-  :type 'number
-  :group 'spam-stat)
+  :type 'number)
 
 (defcustom spam-stat-washing-hook nil
   "Hook applied to each message before analysis."
-  :type 'hook
-  :group 'spam-stat)
+  :type 'hook)
 
 (defcustom spam-stat-score-buffer-user-functions nil
   "List of additional scoring functions.
@@ -187,8 +180,7 @@ Also be careful when defining such functions.  If they take 
a long
 time, they will slow down your mail splitting.  Thus, if the buffer is
 large, don't forget to use smaller regions, by wrapping your work in,
 say, `with-spam-stat-max-buffer-size'."
-  :type '(repeat sexp)
-  :group 'spam-stat)
+  :type '(repeat sexp))
 
 (defcustom spam-stat-process-directory-age 90
   "Max. age of files to be processed in directory, in days.
@@ -197,8 +189,7 @@ When using `spam-stat-process-spam-directory' or
 been touched in this many days will be considered.  Without
 this filter, re-training spam-stat with several thousand messages
 will start to take a very long time."
-  :type 'number
-  :group 'spam-stat)
+  :type 'number)
 
 (defvar spam-stat-last-saved-at nil
   "Time stamp of last change of spam-stat-file on this run")
@@ -260,9 +251,6 @@ Use `spam-stat-ngood', `spam-stat-nbad', `spam-stat-good',
 (defvar spam-stat-nbad 0
   "The number of bad mails in the dictionary.")
 
-(defvar spam-stat-error-holder nil
-  "A holder for condition-case errors while scoring buffers.")
-
 (defsubst spam-stat-good (entry)
   "Return the number of times this word belongs to good mails."
   (aref entry 0))
@@ -486,8 +474,8 @@ The default score for unknown words is stored in
 These are the words whose spam-stat differs the most from 0.5.
 The list returned contains elements of the form \(WORD SCORE DIFF),
 where DIFF is the difference between SCORE and 0.5."
-  (let (result word score)
-    (maphash (lambda (word ignore)
+  (let (result score)
+    (maphash (lambda (word _ignore)
               (setq score (spam-stat-score-word word)
                     result (cons (list word score (abs (- score 0.5)))
                                  result)))
@@ -507,8 +495,7 @@ Add user supplied modifications if supplied."
          (/ prod (+ prod (apply #'* (mapcar #'(lambda (x) (- 1 x))
                                             probs)))))
         (score1s
-         (condition-case
-             spam-stat-error-holder
+         (condition-case nil
              (spam-stat-score-buffer-user score0)
            (error nil)))
         (ans
@@ -531,7 +518,7 @@ Add user supplied modifications if supplied."
 Use this function on `nnmail-split-fancy'.  If you are interested in
 the raw data used for the last run of `spam-stat-score-buffer',
 check the variable `spam-stat-score-data'."
-  (condition-case spam-stat-error-holder
+  (condition-case err
       (progn
        (set-buffer spam-stat-buffer)
        (goto-char (point-min))
@@ -541,7 +528,7 @@ check the variable `spam-stat-score-data'."
                    (push entry nnmail-split-trace))
                  spam-stat-score-data))
          spam-stat-split-fancy-spam-group))
-    (error (message "Error in spam-stat-split-fancy: %S" 
spam-stat-error-holder)
+    (error (message "Error in spam-stat-split-fancy: %S" err)
           nil)))
 
 ;; Testing
diff --git a/lisp/gnus/spam-wash.el b/lisp/gnus/spam-wash.el
index 1c755fb..fe6dd7d 100644
--- a/lisp/gnus/spam-wash.el
+++ b/lisp/gnus/spam-wash.el
@@ -1,4 +1,4 @@
-;;; spam-wash.el --- wash spam before analysis
+;;; spam-wash.el --- wash spam before analysis  -*- lexical-binding: t; -*-
 
 ;; Copyright (C) 2004, 2007-2021 Free Software Foundation, Inc.
 
@@ -42,8 +42,7 @@
             (gnus-article-buffer (current-buffer))
             (handles (or (mm-dissect-buffer nil gnus-article-loose-mime)
                          (and gnus-article-emulate-mime
-                              (mm-uu-dissect))))
-            handle)
+                              (mm-uu-dissect)))))
          (when gnus-article-mime-handles
            (mm-destroy-parts gnus-article-mime-handles)
            (setq gnus-article-mime-handle-alist nil))
diff --git a/lisp/gnus/spam.el b/lisp/gnus/spam.el
index 3f4fd36..502cb5d 100644
--- a/lisp/gnus/spam.el
+++ b/lisp/gnus/spam.el
@@ -1,4 +1,4 @@
-;;; spam.el --- Identifying spam
+;;; spam.el --- Identifying spam  -*- lexical-binding: t; -*-
 
 ;; Copyright (C) 2002-2021 Free Software Foundation, Inc.
 
@@ -321,8 +321,8 @@ Default to t if one of the spam-use-* variables is set."
   :type 'string
   :group 'spam)
 
-;;; TODO: deprecate this variable, it's confusing since it's a list of strings,
-;;; not regular expressions
+;; TODO: deprecate this variable, it's confusing since it's a list of strings,
+;; not regular expressions
 (defcustom spam-junk-mailgroups (cons
                                  spam-split-group
                                  '("mail.junk" "poste.pourriel"))
@@ -1387,7 +1387,7 @@ In the case of mover backends, checks the setting of
          (gnus-check-backend-function
           'request-move-article gnus-newsgroup-name))
         (respool-method (gnus-find-method-for-group gnus-newsgroup-name))
-        article mark deletep respool valid-move-destinations)
+        deletep respool valid-move-destinations)
 
     (when (member 'respool groups)
       (setq respool t)                  ; boolean for later
@@ -1807,7 +1807,7 @@ See the Info node `(gnus)Fancy Mail Splitting' for more 
details."
            (log-function (if unregister
                              'spam-log-undo-registration
                            'spam-log-processing-to-registry))
-           article articles)
+           articles)
 
       (when run-function
         ;; make list of articles, using specific-articles if given
@@ -1836,7 +1836,7 @@ See the Info node `(gnus)Fancy Mail Splitting' for more 
details."
       ;; return the number of articles processed
       (length articles))))
 
-;;; log a ham- or spam-processor invocation to the registry
+;; log a ham- or spam-processor invocation to the registry
 (defun spam-log-processing-to-registry (id type classification backend group)
   (when spam-log-to-registry
     (if (and (stringp id)
@@ -1855,7 +1855,7 @@ See the Info node `(gnus)Fancy Mail Splitting' for more 
details."
         "%s call with bad ID, type, classification, spam-backend, or group"
         "spam-log-processing-to-registry")))))
 
-;;; check if a ham- or spam-processor registration has been done
+;; check if a ham- or spam-processor registration has been done
 (defun spam-log-registered-p (id type)
   (when spam-log-to-registry
     (if (and (stringp id)
@@ -1868,8 +1868,8 @@ See the Info node `(gnus)Fancy Mail Splitting' for more 
details."
                  "spam-log-registered-p"))
         nil))))
 
-;;; check what a ham- or spam-processor registration says
-;;; returns nil if conflicting registrations are found
+;; check what a ham- or spam-processor registration says
+;; returns nil if conflicting registrations are found
 (defun spam-log-registration-type (id type)
   (let ((count 0)
         decision)
@@ -1885,7 +1885,7 @@ See the Info node `(gnus)Fancy Mail Splitting' for more 
details."
       decision)))
 
 
-;;; check if a ham- or spam-processor registration needs to be undone
+;; check if a ham- or spam-processor registration needs to be undone
 (defun spam-log-unregistration-needed-p (id type classification backend)
   (when spam-log-to-registry
     (if (and (stringp id)
@@ -1908,9 +1908,9 @@ See the Info node `(gnus)Fancy Mail Splitting' for more 
details."
         nil))))
 
 
-;;; undo a ham- or spam-processor registration (the group is not used)
+;; undo a ham- or spam-processor registration (the group is not used)
 (defun spam-log-undo-registration (id type classification backend
-                                      &optional group)
+                                      &optional _group)
   (when (and spam-log-to-registry
              (spam-log-unregistration-needed-p id type classification backend))
     (if (and (stringp id)
@@ -1918,7 +1918,7 @@ See the Info node `(gnus)Fancy Mail Splitting' for more 
details."
              (spam-classification-valid-p classification)
              (spam-backend-valid-p backend))
         (let ((cell-list (gnus-registry-get-id-key id type))
-              new-cell-list found)
+              new-cell-list)
           (dolist (cell cell-list)
             (unless (and (eq classification (nth 0 cell))
                          (eq backend (nth 1 cell)))
@@ -2034,94 +2034,83 @@ See the Info node `(gnus)Fancy Mail Splitting' for more 
details."
 
 ;;{{{ BBDB
 
-;;; original idea for spam-check-BBDB from Alexander Kotelnikov
-;;; <sacha@giotto.sj.ru>
+;; original idea for spam-check-BBDB from Alexander Kotelnikov
+;; <sacha@giotto.sj.ru>
 
 ;; all this is done inside a condition-case to trap errors
 
 ;; Autoloaded in message, which we require.
 (declare-function gnus-extract-address-components "gnus-util" (from))
 
-(eval-and-compile
-  (condition-case nil
-      (progn
-       (require 'bbdb)
-       (require 'bbdb-com))
-    (file-error
-     ;; `bbdb-records' should not be bound as an autoload function
-     ;; before loading bbdb because of `bbdb-hashtable-size'.
-     (defalias 'bbdb-buffer 'ignore)
-     (defalias 'bbdb-create-internal 'ignore)
-     (defalias 'bbdb-records 'ignore)
-     (defalias 'spam-BBDB-register-routine 'ignore)
-     (defalias 'spam-enter-ham-BBDB 'ignore)
-     (defalias 'spam-exists-in-BBDB-p 'ignore)
-     (defalias 'bbdb-gethash 'ignore)
-     nil)))
-
-(eval-and-compile
-  (when (featurep 'bbdb-com)
-    ;; when the BBDB changes, we want to clear out our cache
-    (defun spam-clear-cache-BBDB (&rest immaterial)
-      (spam-clear-cache 'spam-use-BBDB))
-
-    (add-hook 'bbdb-change-hook 'spam-clear-cache-BBDB)
-
-    (defun spam-enter-ham-BBDB (addresses &optional remove)
-      "Enter an address into the BBDB; implies ham (non-spam) sender"
-      (dolist (from addresses)
-        (when (stringp from)
-          (let* ((parsed-address (gnus-extract-address-components from))
-                 (name (or (nth 0 parsed-address) "Ham Sender"))
-                 (remove-function (if remove
-                                      'bbdb-delete-record-internal
-                                    'ignore))
-                 (net-address (nth 1 parsed-address))
-                 (record (and net-address
-                              (spam-exists-in-BBDB-p net-address))))
-            (when net-address
-              (gnus-message 6 "%s address %s %s BBDB"
-                            (if remove "Deleting" "Adding")
-                            from
-                            (if remove "from" "to"))
-              (if record
-                  (funcall remove-function record)
-                (bbdb-create-internal name nil net-address nil nil
-                                      "ham sender added by spam.el")))))))
-
-    (defun spam-BBDB-register-routine (articles &optional unregister)
-      (let (addresses)
-        (dolist (article articles)
-          (when (stringp (spam-fetch-field-from-fast article))
-            (push (spam-fetch-field-from-fast article) addresses)))
-        ;; now do the register/unregister action
-        (spam-enter-ham-BBDB addresses unregister)))
-
-    (defun spam-BBDB-unregister-routine (articles)
-      (spam-BBDB-register-routine articles t))
-
-    (defsubst spam-exists-in-BBDB-p (net)
-      (when (and (stringp net) (not (zerop (length net))))
-        (bbdb-records)
-        (bbdb-gethash (downcase net))))
-
-    (defun spam-check-BBDB ()
-      "Mail from people in the BBDB is classified as ham or non-spam"
-      (let ((net (message-fetch-field "from")))
-        (when net
-          (setq net (nth 1 (gnus-extract-address-components net)))
-          (if (spam-exists-in-BBDB-p net)
-              t
-            (if spam-use-BBDB-exclusive
-                spam-split-group
-              nil)))))))
+(require 'bbdb nil 'noerror)
+(require 'bbdb-com nil 'noerror)
+
+(declare-function bbdb-records "bbdb" ())
+(declare-function bbdb-gethash "bbdb" (key &optional predicate))
+(declare-function bbdb-create-internal "bbdb-com" (&rest spec))
+
+;; when the BBDB changes, we want to clear out our cache
+(defun spam-clear-cache-BBDB (&rest _immaterial)
+  (spam-clear-cache 'spam-use-BBDB))
+
+(when (featurep 'bbdb-com)
+  (add-hook 'bbdb-change-hook #'spam-clear-cache-BBDB))
+
+(defun spam-enter-ham-BBDB (addresses &optional remove)
+  "Enter an address into the BBDB; implies ham (non-spam) sender"
+  (dolist (from addresses)
+    (when (stringp from)
+      (let* ((parsed-address (gnus-extract-address-components from))
+             (name (or (nth 0 parsed-address) "Ham Sender"))
+             (remove-function (if remove
+                                  'bbdb-delete-record-internal
+                                'ignore))
+             (net-address (nth 1 parsed-address))
+             (record (and net-address
+                          (spam-exists-in-BBDB-p net-address))))
+        (when net-address
+          (gnus-message 6 "%s address %s %s BBDB"
+                        (if remove "Deleting" "Adding")
+                        from
+                        (if remove "from" "to"))
+          (if record
+              (funcall remove-function record)
+            (bbdb-create-internal name nil net-address nil nil
+                                  "ham sender added by spam.el")))))))
+
+(defun spam-BBDB-register-routine (articles &optional unregister)
+  (let (addresses)
+    (dolist (article articles)
+      (when (stringp (spam-fetch-field-from-fast article))
+        (push (spam-fetch-field-from-fast article) addresses)))
+    ;; now do the register/unregister action
+    (spam-enter-ham-BBDB addresses unregister)))
+
+(defun spam-BBDB-unregister-routine (articles)
+  (spam-BBDB-register-routine articles t))
+
+(defun spam-exists-in-BBDB-p (net)
+  (when (and (stringp net) (not (zerop (length net))))
+    (bbdb-records)
+    (bbdb-gethash (downcase net))))
+
+(defun spam-check-BBDB ()
+  "Mail from people in the BBDB is classified as ham or non-spam"
+  (let ((net (message-fetch-field "from")))
+    (when net
+      (setq net (nth 1 (gnus-extract-address-components net)))
+      (if (spam-exists-in-BBDB-p net)
+          t
+        (if spam-use-BBDB-exclusive
+            spam-split-group
+          nil)))))
 
 ;;}}}
 
 ;;{{{ ifile
 
-;;; check the ifile backend; return nil if the mail was NOT classified
-;;; as spam
+;; check the ifile backend; return nil if the mail was NOT classified
+;; as spam
 
 
 (defun spam-get-ifile-database-parameter ()
@@ -2160,8 +2149,7 @@ See `spam-ifile-database'."
 Uses `gnus-newsgroup-name' if category is nil (for ham registration)."
   (let ((category (or category gnus-newsgroup-name))
         (add-or-delete-option (if unregister "-d" "-i"))
-        (db (spam-get-ifile-database-parameter))
-        parameters)
+        (db (spam-get-ifile-database-parameter)))
     (with-temp-buffer
       (dolist (article articles)
         (let ((article-string (spam-get-article-as-string article)))
@@ -2194,8 +2182,7 @@ Uses `gnus-newsgroup-name' if category is nil (for ham 
registration)."
 (defun spam-check-stat ()
   "Check the spam-stat backend for the classification of this message."
   (let ((spam-stat-split-fancy-spam-group spam-split-group) ; override
-       (spam-stat-buffer (buffer-name)) ; stat the current buffer
-       category return)
+       (spam-stat-buffer (buffer-name))) ; stat the current buffer
     (spam-stat-split-fancy)))
 
 (defun spam-stat-register-spam-routine (articles &optional unregister)
@@ -2240,7 +2227,7 @@ Uses `gnus-newsgroup-name' if category is nil (for ham 
registration)."
   (let ((kill-whole-line t))
     (kill-line)))
 
-;;; address can be a list, too
+;; address can be a list, too
 (defun spam-enter-whitelist (address &optional remove)
   "Enter ADDRESS (list or single) into the whitelist.
 With a non-nil REMOVE, remove them."
@@ -2249,7 +2236,7 @@ With a non-nil REMOVE, remove them."
   (setq spam-whitelist-cache nil)
   (spam-clear-cache 'spam-use-whitelist))
 
-;;; address can be a list, too
+;; address can be a list, too
 (defun spam-enter-blacklist (address &optional remove)
   "Enter ADDRESS (list or single) into the blacklist.
 With a non-nil REMOVE, remove them."
@@ -2310,8 +2297,8 @@ With a non-nil REMOVE, remove the ADDRESSES."
           (cl-return)))
       found)))
 
-;;; returns t if the sender is in the whitelist, nil or
-;;; spam-split-group otherwise
+;; returns t if the sender is in the whitelist, nil or
+;; spam-split-group otherwise
 (defun spam-check-whitelist ()
   ;; FIXME!  Should it detect when file timestamps change?
   (unless spam-whitelist-cache
@@ -2345,8 +2332,7 @@ With a non-nil REMOVE, remove the ADDRESSES."
       (nreverse contents))))
 
 (defun spam-from-listed-p (type)
-  (let ((from (message-fetch-field "from"))
-        found)
+  (let ((from (message-fetch-field "from")))
     (spam-filelist-check-cache type from)))
 
 (defun spam-filelist-register-routine (articles blacklist &optional unregister)
@@ -2356,7 +2342,7 @@ With a non-nil REMOVE, remove the ADDRESSES."
          (if blacklist 'spam-enter-blacklist 'spam-enter-whitelist))
         (remove-function
          (if blacklist 'spam-enter-whitelist 'spam-enter-blacklist))
-        from addresses unregister-list article-unregister-list)
+        addresses unregister-list article-unregister-list)
     (dolist (article articles)
       (let ((from (spam-fetch-field-from-fast article))
             (id (spam-fetch-field-message-id-fast article))
@@ -2573,13 +2559,13 @@ With a non-nil REMOVE, remove the ADDRESSES."
 (defun spam-spamoracle-learn-ham (articles &optional unregister)
   (spam-spamoracle-learn articles nil unregister))
 
-(defun spam-spamoracle-unlearn-ham (articles &optional unregister)
+(defun spam-spamoracle-unlearn-ham (articles &optional _unregister)
   (spam-spamoracle-learn-ham articles t))
 
 (defun spam-spamoracle-learn-spam (articles &optional unregister)
   (spam-spamoracle-learn articles t unregister))
 
-(defun spam-spamoracle-unlearn-spam (articles &optional unregister)
+(defun spam-spamoracle-unlearn-spam (articles &optional _unregister)
   (spam-spamoracle-learn-spam articles t))
 
 ;;}}}



reply via email to

[Prev in Thread] Current Thread [Next in Thread]