Subject: bug#74083: 30.0.91; GNU Elpa "debbugs" package ignores gnus-posting-styles

From: Michael Albinus <[email-masked]>
Date: Tue, 29 Oct 2024 13:45:06 +0100

Mekeor Melire <[email-masked]> writes:

Hi Mekeor,

> The "debbugs" package in GNU Elpa archive buffer-locally overrides the
> gnus-posting-styles variable in debbugs-gnu-summary-mode.
>
> Personally, I use gnus-posting-styles to configure conditions for when
> which email-address should be used.  E.g. I want debbugs.el to always
> use the email-address from which I'm now sending this email.  But
> debbugs.el won't obey my configuration in gnus-posting-styles.

Well, this was made by intention in order to keep the posting-styles
defined in debbugs-gnu-summary-mode. Could you, pls try the appended
patch? It introduces a new user option
debbugs-gnu-summary-keep-posting-styles. When set to t, your personal
posting-styles shall be kept.

Best regards, Michael.

diff --git a/debbugs-gnu.el b/debbugs-gnu.el
index b5f07ad3cd..85c891a483 100644
--- a/debbugs-gnu.el
+++ b/debbugs-gnu.el
@@ -1897,6 +1897,11 @@ MERGED is the list of bugs merged with this one."
   :version "29.1"
   :type 'regexp)

+(defcustom debbugs-gnu-summary-keep-posting-styles nil
+  "Whether to keep the user's `gnus-posting-styles'."
+  :version "30.1"
+  :type 'boolean)
+
 (defvar debbugs-gnu-summary-mode-map
   (let ((map (make-sparse-keymap)))
     (define-key map "C" #'debbugs-gnu-send-control-message)
@@ -1910,7 +1915,11 @@ MERGED is the list of bugs merged with this one."
 \\{debbugs-gnu-summary-mode-map}"
   :lighter " Debbugs" :keymap debbugs-gnu-summary-mode-map
   (set (make-local-variable 'gnus-posting-styles)
-       `((".*"
+       `(;; We apply them first, because we want to keep our own
+         ;; posting-styles prior the others.
+         ,@(and debbugs-gnu-summary-keep-posting-styles
+                (default-value 'gnus-posting-styles))
+         (".*"
 	  (eval
 	   (when (buffer-live-p gnus-article-copy)
 	     (with-current-buffer gnus-article-copy