[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
- [elpa] externals/gnorb 82bb9db 023/449: README.org: Add keybindings to gnus mime commands., (continued)
- [elpa] externals/gnorb 82bb9db 023/449: README.org: Add keybindings to gnus mime commands., Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 534b2bf 024/449: gnorb-org.el: new option gnorb-org-mail-todos, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 9c5d04a 027/449: README.org: More explanation about the mail stuff., Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb e53d908 028/449: gnorb-gnus.el: bugfix in gnorb-gnus-collect-all-attachments, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 4f16002 029/449: gnorb-org.el: Fix attaching attachments to outgoing messages., Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb ed9825e 034/449: Use map-y-or-n-p for attachment actions, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb af8f375 038/449: Various README.org tweaks, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 27a91f6 039/449: Open link from string correctly, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 048bbd9 040/449: Many pointless defstructs, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb e183272 055/449: Think about merging mail commands, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb a680c42 058/449: Moving the mail header stuff to a different file,
Stefan Monnier <=
- [elpa] externals/gnorb 8519593 060/449: Rework Org BBDB popups, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 97c0d41 045/449: Place point somewhere useful after setting up message, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb c9e4dfb 056/449: Limit to TODOs only in BBDB tag searches, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 210851e 065/449: That's not broken anymore., Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 72a98bd 020/449: README.org: Document new capture attachment thingy., Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb e2617e0 030/449: gnorb-org.el: That's not how return-actions look, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb c5e3459 033/449: README.org: Fixed keybinding for mime map, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 0e75c71 035/449: Note future mail-search-from-agenda function, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 1024a81 037/449: New gnorb-org-capture-collect-link-p option, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb ee8b595 036/449: Merge gnorb-org-handle-mail functions, Stefan Monnier, 2020/11/27