summaryrefslogtreecommitdiff
path: root/gnu/packages/patches/emacs-gnus-alias-reference-signature.patch
blob: 70885434bd0ecb6479736611fe1fa2e68c9d6570 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
Upstream-status: https://github.com/hexmode/gnus-alias/pull/7

diff --git a/gnus-alias.el b/gnus-alias.el
index 944d6db..c27d3d1 100644
--- a/gnus-alias.el
+++ b/gnus-alias.el
@@ -1134,11 +1134,15 @@ above circumstances rather then generate an error."
       (gnus-alias-remove-sig)
 
       ;; add signature maybe
-      (when sig
-        (goto-char (point-max))
-        (unless (bolp) (insert "\n"))
-        (insert "-- \n")
-        (insert (gnus-alias-get-value sig))))
+      (let ((reference-sig (and reference
+                                (gnus-alias-get-sig
+                                 (assoc-string (gnus-alias-get-value reference)
+                                               gnus-alias-identity-alist t)))))
+        (when (or sig reference-sig)
+          (goto-char (point-max))
+          (unless (bolp) (insert "\n"))
+          (insert "-- \n")
+          (insert (gnus-alias-get-value (or sig reference-sig))))))
 
       ;; remember last Identity used
       (setq gnus-alias-current-identity identity)))