diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2021-01-30 18:56:37 -0500 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2021-01-30 18:56:37 -0500 |
commit | 12189ae415f88984dd26712bdf4e4f9a50e10c8f (patch) | |
tree | 2d9bb8acc5c400a015c32fb480d2149c621922e3 /lisp/gnus/gnus-art.el | |
parent | daa4e0120dc32a8c3eeafdf8914a0e29e5c149e9 (diff) | |
download | emacs-scratch/lexical-gnus-rc.tar.gz |
* lisp/gnus: Use closures now that we activated `lexical-binding`scratch/lexical-gnus-rc
* 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`.
Diffstat (limited to 'lisp/gnus/gnus-art.el')
-rw-r--r-- | lisp/gnus/gnus-art.el | 106 |
1 files changed, 54 insertions, 52 deletions
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index 25ebc305947..39b182f2cda 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el @@ -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." |