emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/debbugs f347ec7 066/311: (debbugs-gnu-summary-mode): Ma


From: Stefan Monnier
Subject: [elpa] externals/debbugs f347ec7 066/311: (debbugs-gnu-summary-mode): Make sure `gnus-article-copy' is alive.
Date: Sun, 29 Nov 2020 18:41:42 -0500 (EST)

branch: externals/debbugs
commit f347ec7c9db85c2c70836c2bc350ee19ac35dfc0
Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
Commit: Lars Magne Ingebrigtsen <larsi@gnus.org>

    (debbugs-gnu-summary-mode): Make sure `gnus-article-copy' is alive.
---
 ChangeLog      |  1 +
 debbugs-gnu.el | 34 ++++++++++++++++++----------------
 2 files changed, 19 insertions(+), 16 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index e5d30bb..1a8cfe5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,7 @@
 
        * debbugs-gnu.el (debbugs-guess-current-id): New function.
        (debbugs-gnu-send-control-message): Use it.
+       (debbugs-gnu-summary-mode): Make sure `gnus-article-copy' is alive.
 
 2011-07-19  Michael Albinus  <michael.albinus@gmx.de>
 
diff --git a/debbugs-gnu.el b/debbugs-gnu.el
index 60c8939..c42e115 100644
--- a/debbugs-gnu.el
+++ b/debbugs-gnu.el
@@ -714,22 +714,24 @@ The following commands are available:
   (set (make-local-variable 'gnus-posting-styles)
        `((".*"
          (eval
-          (with-current-buffer gnus-article-copy
-            (set (make-local-variable 'message-prune-recipient-rules)
-                 '((".*@debbugs.*" "emacs-pretest-bug")
-                   (".*@debbugs.*" "bug-gnu-emacs")
-                   ("[0-9]+@debbugs.*" "submit@debbugs.gnu.org")
-                   ("[0-9]+@debbugs.*" "quiet@debbugs.gnu.org")))
-            (set (make-local-variable 'message-alter-recipients-function)
-                 (lambda (address)
-                   (if (string-match "\\([0-9]+\\)@donarmstrong" (car address))
-                       (let ((new (format "%s@debbugs.gnu.org"
-                                          (match-string 1 (car address)))))
-                         (cons new new))
-                     address)))
-            ;; `gnus-posting-styles' is eval'ed after
-            ;; `message-simplify-subject'.  So we cannot use m-s-s.
-            (setq subject ,debbugs-gnu-subject)))))))
+          (when (buffer-live-p gnus-article-copy)
+            (with-current-buffer gnus-article-copy
+              (set (make-local-variable 'message-prune-recipient-rules)
+                   '((".*@debbugs.*" "emacs-pretest-bug")
+                     (".*@debbugs.*" "bug-gnu-emacs")
+                     ("[0-9]+@debbugs.*" "submit@debbugs.gnu.org")
+                     ("[0-9]+@debbugs.*" "quiet@debbugs.gnu.org")))
+              (set (make-local-variable 'message-alter-recipients-function)
+                   (lambda (address)
+                     (if (string-match "\\([0-9]+\\)@donarmstrong"
+                                       (car address))
+                         (let ((new (format "%s@debbugs.gnu.org"
+                                            (match-string 1 (car address)))))
+                           (cons new new))
+                       address)))
+              ;; `gnus-posting-styles' is eval'ed after
+              ;; `message-simplify-subject'.  So we cannot use m-s-s.
+              (setq subject ,debbugs-gnu-subject))))))))
 
 (defun debbugs-guess-current-id ()
   "Guess the ID based on \"#23\"."



reply via email to

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