]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/gnus: Use closures now that we activated `lexical-binding`
authorStefan Monnier <monnier@iro.umontreal.ca>
Sat, 30 Jan 2021 23:56:37 +0000 (18:56 -0500)
committerStefan Monnier <monnier@iro.umontreal.ca>
Sat, 30 Jan 2021 23:56:37 +0000 (18:56 -0500)
* lisp/gnus/nnml.el (nnml-request-accept-article):
* lisp/gnus/nnmairix.el (nnmairix-request-marks):
* lisp/gnus/nnmail.el (nnmail-get-new-mail-1):
* lisp/gnus/mm-view.el (mm-inline-image)
(mm-inline-text-html-render-with-w3m, mm-inline-text)
(mm-insert-inline, mm-inline-message):
* lisp/gnus/mm-partial.el (mm-inline-partial):
* lisp/gnus/mm-archive.el (mm-archive-dissect-and-inline):
* lisp/gnus/gnus-util.el (gnus-create-info-command):
* lisp/gnus/gnus-topic.el (gnus-topic-edit-parameters)
(gnus-topic-sort-topics-1):
* lisp/gnus/gnus-sum.el (gnus-summary-edit-article):
* lisp/gnus/gnus-srvr.el (gnus-server-edit-server):
* lisp/gnus/gnus-msg.el (gnus-inews-make-draft)
(gnus-inews-add-send-actions, gnus-summary-cancel-article)
(gnus-summary-supersede-article, gnus-summary-resend-message)
(gnus-configure-posting-styles):
* lisp/gnus/gnus-kill.el (gnus-execute):
* lisp/gnus/gnus-html.el (gnus-html-wash-images):
* lisp/gnus/gnus-group.el (gnus-group-edit-group)
(gnus-group-nnimap-edit-acl):
* lisp/gnus/gnus-draft.el (gnus-draft-edit-message, gnus-draft-setup):
* lisp/gnus/gnus-art.el (gnus-article-edit-part)
(gnus-mm-display-part, gnus-article-edit):
* lisp/gnus/gnus-agent.el (gnus-category-edit-predicate)
(gnus-category-edit-score, gnus-category-edit-groups):
Use closures instead of `(lambda ...).

* lisp/gnus/nnoo.el (noo--defalias): New function.
(nnoo-import-1, nnoo-define-skeleton-1): Use it to avoid `eval`.

18 files changed:
lisp/gnus/gnus-agent.el
lisp/gnus/gnus-art.el
lisp/gnus/gnus-draft.el
lisp/gnus/gnus-group.el
lisp/gnus/gnus-html.el
lisp/gnus/gnus-kill.el
lisp/gnus/gnus-msg.el
lisp/gnus/gnus-srvr.el
lisp/gnus/gnus-sum.el
lisp/gnus/gnus-topic.el
lisp/gnus/gnus-util.el
lisp/gnus/mm-archive.el
lisp/gnus/mm-partial.el
lisp/gnus/mm-view.el
lisp/gnus/nnmail.el
lisp/gnus/nnmairix.el
lisp/gnus/nnml.el
lisp/gnus/nnoo.el

index 86c471197d59504f074b9af2ca32d6784eeb24fa..cbe3505cd104616a48a5ea0d06652b9fd10f4c18 100644 (file)
@@ -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."
index 25ebc305947f15e785835dc0c66c62dcc002bdf2..39b182f2cda7f92789cfdc80c94d6e618243f6aa 100644 (file)
@@ -5002,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))
@@ -5768,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)
@@ -7280,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."
index a4bcae23bd6618b51610db62ab51ca9608770bdf..f68e9d6b7494a65bd2d546487e7ea4e1a96c7479 100644 (file)
     (let ((gnus-verbose-backends nil))
       (gnus-request-expire-articles (list article) group t))
     (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)))))
+     (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)
@@ -274,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
index 6d969609c4c62290b858a8979a45cb35a490272d..eec64fd217add133e5a86f9e5cceb7cebad7bb48 100644 (file)
@@ -2930,8 +2930,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
@@ -3378,9 +3378,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>.
index 962d7337ecdc3f1f0f25b14490ac37a24343dfc7..be62bfd81f5f2f70fcc8f42664ae7a7635c33441 100644 (file)
@@ -177,9 +177,9 @@ fit these criteria."
          (add-text-properties
           start end
           (list 'image-url url
-                'image-displayer `(lambda (url start end)
-                                    (gnus-html-display-image url start end
-                                                             ,alt-text))
+                '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
index 00a4f11c6c078dba5ced484902c90a42c589cea4..b0e6cb59d52607a090b9a4a2ba28c19ac8039ae7 100644 (file)
@@ -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)))
index 1bd62516b14f6ff56bd14d36fa9dc6e73406b6cd..45e665be8c3456dd8c27109ead024f35ed9408f7 100644 (file)
@@ -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)
@@ -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)
@@ -820,8 +821,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 +857,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))))
@@ -1387,11 +1389,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*"
@@ -1916,47 +1919,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)
index 54b5a7d5fa93316525ded27aeaeddcafb4a7f5eb..a305e343f69a9745a521d91310bd3d1c636f2a43 100644 (file)
@@ -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)
index 39110338c33197f9bbe0b3a2c13e70a45f46e417..456e7b0f8c43f3d4b8b140450a5d5fbda75e42d1 100644 (file)
@@ -10676,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)
 
index bbcccfee2f0599201cbe8e3640a3455823baecbc..e7d1cf86161294962fe9b957f636570075a2b803 100644 (file)
@@ -1608,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."
@@ -1693,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)))))))
index f8d43253865fa464b3eb093239ecc176f353e6a1..3c7c948c2b5a721fab3f1b579702083babf355bf 100644 (file)
@@ -1234,14 +1234,17 @@ 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)))
+  (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)
index d550045e0a23a6dcf3faf1e2ff6b7d5d6d32e733..1ecceeedeb760d837b86db08ae679241309facf2 100644 (file)
       (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)
 
index 8f5d45d67d806cdb491d70f12c86243ecb42d486..0c25c8f8bcd67df0cbae0763296a4a0a52d216bd 100644 (file)
@@ -135,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)
 
index f4c1cf9a6c8f6256c2ac0969237e43b44078b5bc..3e36d6724ea3d08a20bf6d15b329abe1cf26d2bd 100644 (file)
@@ -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.")
@@ -202,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."
@@ -381,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."
@@ -394,10 +395,11 @@ 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)
   (message "Not implemented"))
@@ -457,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)
index ac56e8f4b9bd2a98b168576e9d07c8360c2a0477..9826bc6172cfe023dd9c5cbc3f1e1b94aadd5c16 100644 (file)
@@ -1783,7 +1783,7 @@ be called once per group or once for all groups."
       (assq 'directory mail-sources)))
 
 (defun nnmail-get-new-mail-1 (method exit-func temp
-                             group _in-group spool-func)
+                             group in-group spool-func)
   (let* ((sources mail-sources)
         fetching-sources
         (i 0)
@@ -1812,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)
@@ -1836,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)))
index a2de5e061e0107025dc212a5217216e48a13a394..c6aaf460ece644657ac36503fca85024d15ade50 100644 (file)
@@ -701,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
@@ -712,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))))
index 7bd295399cc2ab544683da0f7fd39afd095c8ea8..18acc73aadd764886d99380c8a83cd8f051ea151 100644 (file)
@@ -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))))
index 2260fd694e4cf8261e670388ae9763ac6e407914..7759951662aa61ac758ea94da304e116f3411f5a 100644 (file)
@@ -49,6 +49,9 @@
        (defun ,func ,args ,@forms)
      (nnoo-register-function ',func)))
 
+(defun noo--defalias (fun val)
+  (prog1 (defalias fun val) (nnoo-register-function fun)))
+
 (defun nnoo-register-function (func)
   (let ((funcs (nthcdr 3 (assoc (nnoo-backend func)
                                nnoo-definition-alist))))
@@ -90,9 +93,9 @@
       (dolist (fun (or (cdr imp) (nnoo-functions (car imp))))
        (let ((function (nnoo-symbol backend (nnoo-rest-symbol fun))))
          (unless (fboundp function)
-           ;; FIXME: Use `defalias' and closures to avoid `eval'.
-           (eval `(deffoo ,function (&rest args)
-                    (,call-function ',backend ',fun args)))))))))
+           (noo--defalias function
+                          (lambda (&rest args)
+                            (funcall call-function backend fun args)))))))))
 
 (defun nnoo-parent-function (backend function args)
   (let ((pbackend (nnoo-backend function))
@@ -301,11 +304,9 @@ All functions will return nil and report an error."
                request-list request-post request-list-newsgroups))
     (let ((fun (nnoo-symbol backend op)))
       (unless (fboundp fun)
-       ;; FIXME: Use `defalias' and closures to avoid `eval'.
-       (eval `(deffoo ,fun
-                  (&rest _args)
-                (nnheader-report ',backend ,(format "%s-%s not implemented"
-                                                    backend op))))))))
+       (let ((msg (format "%s-%s not implemented" backend op)))
+         (noo--defalias fun
+                        (lambda (&rest _args) (nnheader-report backend msg))))))))
 
 (defun nnoo-set (server &rest args)
   (let ((parents (nnoo-parents (car server)))