[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/gnorb f3b9fad 161/449: Split out msg-id to group/link f
From: |
Stefan Monnier |
Subject: |
[elpa] externals/gnorb f3b9fad 161/449: Split out msg-id to group/link functionality |
Date: |
Fri, 27 Nov 2020 23:15:30 -0500 (EST) |
branch: externals/gnorb
commit f3b9fad0086846ce5dd4bc86c1896208eb3e6f70
Author: Eric Abrahamsen <eric@ericabrahamsen.net>
Commit: Eric Abrahamsen <eric@ericabrahamsen.net>
Split out msg-id to group/link functionality
* lisp/gnorb-utils.el (gnorb-msg-id-to-group) New function, just return
the group.
(gnorb-msg-id-to-link) Refactor to use the above function.
---
lisp/gnorb-utils.el | 20 +++++++++++++++++---
1 file changed, 17 insertions(+), 3 deletions(-)
diff --git a/lisp/gnorb-utils.el b/lisp/gnorb-utils.el
index 177adb1..e4558d7 100644
--- a/lisp/gnorb-utils.el
+++ b/lisp/gnorb-utils.el
@@ -186,6 +186,11 @@ the prefix arg."
`(:gnus ,gnus :mail ,mail :bbdb ,bbdb))))
(defun gnorb-msg-id-to-link (msg-id)
+ (let ((server-group (gnorb-msg-id-to-group msg-id)))
+ (when server-group
+ (org-link-escape (concat server-group "#" msg-id)))))
+
+(defun gnorb-msg-id-to-group (msg-id)
"Given only a message id, try a few different things to
reconstruct a complete org link, including server and group. So
far we're only checking the registry, and also notmuch if notmuch
@@ -195,10 +200,20 @@ is in use. Other search engines? Other clever methods?"
;; when the message is sent. But if we're not (ie nnimap), then it's
;; pretty rare that the the user is going to go to the sent message
;; folder and open the messages so that they're entered into the
- ;; registry. Any other options?
+ ;; registry. That probably means hooking into some fairly low-level
+ ;; processing: allowing users to specify which mailboxes hold their
+ ;; sent mail, and then watching to see any time messages are put
+ ;; into those boxes, and adding them to the registry. One bonus
+ ;; should be, if incoming sent messages are then split, the registry
+ ;; will notice them and add their group key.
(let (server-group)
(catch 'found
(when gnus-registry-enabled
+ ;; The following is a cheap knock-off of
+ ;; `gnus-try-warping-via-registry'. I can't use that, though,
+ ;; because it isn't low-level enough -- it starts with a
+ ;; message under point and ends by opening the message in the
+ ;; group.
(setq server-group
(gnus-registry-get-id-key msg-id 'group))
;; If the id is registered at all, group will be a list. If it
@@ -211,8 +226,7 @@ is in use. Other search engines? Other clever methods?"
(throw 'found server-group)))))
(when (featurep 'notmuch)
t)) ;; Is this even feasible? I suspect not.
- (when server-group
- (org-link-escape (concat server-group "#" msg-id)))))
+ server-group))
(provide 'gnorb-utils)
;;; gnorb-utils.el ends here
- [elpa] externals/gnorb a9d7518 113/449: Make sure we're visiting an id when we cache it, (continued)
- [elpa] externals/gnorb a9d7518 113/449: Make sure we're visiting an id when we cache it, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb d7f6301 123/449: Possibly safer arguments to nnir group creation, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 74c5cef 134/449: Add (probably unnecessary) &optional to prefix args, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 689bdd3 148/449: Use = not eq for numbers, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 31304ac 151/449: Whoops, we were using that, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 7cf46c3 149/449: Don't use `read' when there's nothing to read, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb ab9b441 147/449: Clearing list of saved attachments, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 3b6007a 152/449: Autoload cookies all around, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb ecf161e 154/449: Use copy-sequence on message-mode-hook!, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb fc9b6cf 153/449: Use existing functions for mime handles, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb f3b9fad 161/449: Split out msg-id to group/link functionality,
Stefan Monnier <=
- [elpa] externals/gnorb a509ff6 164/449: Still trying to track outgoing messages, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb ade7ee8 163/449: Make hash entries for new sent-message TODOs, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 4d584f1 171/449: Require gnorb-bbdb when popping up bbdb buffer, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 260161b 159/449: Check registry-enabled only after registry is loaded, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb f1545cd 162/449: Don't add a 'group key to registry if no group, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb d04bf53 178/449: Rename/move the registry-entry function, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 452a3f0 177/449: Basic skeleton of registry usage, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb eaa4bf4 181/449: Begin shifting candidate finding to the registry, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 7f4dbed 180/449: Don't check for relevant headings if not tracking, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 093c4ed 185/449: Spurious 'g', Stefan Monnier, 2020/11/27