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

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

[elpa] externals/gnorb a680c42 058/449: Moving the mail header stuff to


From: Stefan Monnier
Subject: [elpa] externals/gnorb a680c42 058/449: Moving the mail header stuff to a different file
Date: Fri, 27 Nov 2020 23:15:08 -0500 (EST)

branch: externals/gnorb
commit a680c42902e0d0293c9be4aef820c17e2211c167
Author: Eric Abrahamsen <eric@ericabrahamsen.net>
Commit: Eric Abrahamsen <eric@ericabrahamsen.net>

    Moving the mail header stuff to a different file
    
    It's better off in gnorb-utils than gnorb-gnus. Renaming the var to
    gnorb-mail-header.
---
 lisp/gnorb-gnus.el  | 25 +------------------------
 lisp/gnorb-org.el   |  2 +-
 lisp/gnorb-utils.el | 24 ++++++++++++++++++++++++
 3 files changed, 26 insertions(+), 25 deletions(-)

diff --git a/lisp/gnorb-gnus.el b/lisp/gnorb-gnus.el
index f94a0ea..085c09e 100644
--- a/lisp/gnorb-gnus.el
+++ b/lisp/gnorb-gnus.el
@@ -176,35 +176,12 @@ save them into `gnorb-tmp-dir'."
 
 ;;; Storing, removing, and acting on Org headers in messages.
 
-(defcustom gnorb-gnus-org-header "X-Org-ID"
-  "Name of the mail header used to store the ID of a related Org
-  heading. Only used locally: always stripped when the mail is
-  sent."
-  :group 'gnorb-gnus
-  :type 'string)
-
-;;; this is just ghastly, but the value of this var is single regexp
-;;; group containing various header names, and we want our value
-;;; inside that group.
-(eval-after-load "message"
-  (let ((ign-headers-list
-        (org-split-string message-ignored-mail-headers
-                          "|"))
-       (our-val (concat gnorb-org-mail-header "\\")))
-    (unless (member our-val ign-headers-list)
-      (setq ign-headers-list
-           `(,@(butlast ign-headers-list 1) ,our-val
-             ,@(last ign-headers-list 1)))
-      (setq message-ignored-mail-headers
-           (mapconcat
-            'identity ign-headers-list "|")))))
-
 (defun gnorb-gnus-check-org-header ()
   "Return the value of the `gnorb-gnus-org-header' for the
 current message; multiple header values returned as a string."
   (save-restriction
     (message-narrow-to-headers)
-    (let ((org-ids (mail-fetch-field gnorb-gnus-org-header nil nil t)))
+    (let ((org-ids (mail-fetch-field gnorb-mail-header nil nil t)))
       (if org-ids
          (setq gnorb-message-org-ids org-ids)
        (setq gnorb-message-org-ids nil)))))
diff --git a/lisp/gnorb-org.el b/lisp/gnorb-org.el
index 4f41da6..2fe5f45 100644
--- a/lisp/gnorb-org.el
+++ b/lisp/gnorb-org.el
@@ -168,7 +168,7 @@ headings."
          (open-line 1)
          ;; this function hardly does anything
          (message-insert-header
-          (intern gnorb-gnus-org-header) i)))))
+          (intern gnorb-mail-header) i)))))
   ; put point somewhere reasonable
   (if (or mails messages)
       (message-goto-body)
diff --git a/lisp/gnorb-utils.el b/lisp/gnorb-utils.el
index 535082f..8ed9ad9 100644
--- a/lisp/gnorb-utils.el
+++ b/lisp/gnorb-utils.el
@@ -27,6 +27,7 @@
 (require 'cl)
 (require 'mailcap)
 (require 'gnus)
+;(require 'message)
 (require 'bbdb)
 (require 'org)
 (require 'org-bbdb)
@@ -63,5 +64,28 @@
   ;; appropriately.
 )
 
+(defcustom gnorb-mail-header "X-Org-ID"
+  "Name of the mail header used to store the ID of a related Org
+  heading. Only used locally: always stripped when the mail is
+  sent."
+  :group 'gnorb
+  :type 'string)
+
+;;; this is just ghastly, but the value of this var is single regexp
+;;; group containing various header names, and we want our value
+;;; inside that group.
+(eval-after-load 'message
+  `(let ((ign-headers-list
+         (split-string message-ignored-mail-headers
+                       "|"))
+        (our-val (concat gnorb-mail-header "\\")))
+     (unless (member our-val ign-headers-list)
+       (setq ign-headers-list
+            `(,@(butlast ign-headers-list 1) ,our-val
+              ,@(last ign-headers-list 1)))
+       (setq message-ignored-mail-headers
+            (mapconcat
+             'identity ign-headers-list "|")))))
+
 (provide 'gnorb-utils)
 ;;; gnorb-utils.el ends here



reply via email to

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