[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/gnorb 69980d3 143/449: Improvements to nnir-run-gnorb
From: |
Stefan Monnier |
Subject: |
[elpa] externals/gnorb 69980d3 143/449: Improvements to nnir-run-gnorb |
Date: |
Fri, 27 Nov 2020 23:15:26 -0500 (EST) |
branch: externals/gnorb
commit 69980d3890706cc52621d75a2ff6a5590a31971d
Author: Eric Abrahamsen <eric@ericabrahamsen.net>
Commit: Eric Abrahamsen <eric@ericabrahamsen.net>
Improvements to nnir-run-gnorb
lisp/nngnorb.el: (nnir-run-gnorb) Instead of accumulating strings, just
use append to buffer. Also fixes semi-bug of
accumulating multiple redundant copies of subtrees'
children text.
---
lisp/nngnorb.el | 49 ++++++++++++++++++++-----------------------------
1 file changed, 20 insertions(+), 29 deletions(-)
diff --git a/lisp/nngnorb.el b/lisp/nngnorb.el
index 01d19e7..4ea139a 100644
--- a/lisp/nngnorb.el
+++ b/lisp/nngnorb.el
@@ -69,16 +69,20 @@ Org agenda tags search. All headings matched by this string
will
be scanned for gnus messages, and those messages displayed."
(save-excursion
(let ((q (cdr (assq 'query query)))
- subtrees links subtree-text vectors)
+ (buf (get-buffer-create nnir-tmp-buffer))
+ links vectors)
+ (with-current-buffer buf
+ (erase-buffer))
(when (equal "5.13" gnus-version-number)
(setq q (car q)))
(cond ((string-match "id\\+\\([[:alnum:]-]+\\)$" q)
(with-demoted-errors "Error: %S"
(org-id-goto (match-string 1 q))
- (push (move-marker
- (make-marker)
- (org-element-property :begin (org-element-at-point)))
- subtrees)))
+ (append-to-buffer
+ buf
+ (point)
+ (org-element-property
+ :end (org-element-at-point)))))
((listp q)
;; be a little careful: this could be a list of links, or
;; it could be the full plist
@@ -87,32 +91,19 @@ be scanned for gnus messages, and those messages displayed."
q)))
(t (org-map-entries
(lambda ()
- (push
- (move-marker (make-marker)
- (org-element-property :begin
- (org-element-at-point)))
- subtrees))
+ (append-to-buffer
+ buf
+ (point)
+ (save-excursion
+ (outline-next-heading)
+ (point))))
q
'agenda)))
- (when subtrees
- (with-current-buffer (get-buffer-create nnir-tmp-buffer)
- (erase-buffer)
- (dolist (m subtrees)
- (save-excursion
- (org-pop-to-buffer-same-window (marker-buffer m))
- (goto-char m)
- (move-marker m nil)
- (setq subtree-text
- (buffer-substring-no-properties
- (point)
- (org-element-property
- :end
- (org-element-at-point)))))
- (insert subtree-text)
- (insert "\n"))
- (goto-char (point-min))
- (setq links (gnorb-scan-links (point-max) 'gnus))))
- (setq links (delete-dups (plist-get links :gnus)))
+ (with-current-buffer buf
+ (goto-char (point-min))
+ (setq links (plist-get (gnorb-scan-links (point-max) 'gnus)
+ :gnus)))
+ (setq links (delete-dups links))
(unless (gnus-alive-p)
(gnus))
(dolist (m links (when vectors
- [elpa] externals/gnorb 05e6a02 204/449: Docstring for gnorb-msg-id-to-link, (continued)
- [elpa] externals/gnorb 05e6a02 204/449: Docstring for gnorb-msg-id-to-link, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 4f302fa 205/449: New gnorb-collect-ids utility function, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 01e7b1e 206/449: New minor mode for nnir summary buffers, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 69ddfd3 212/449: Delete duplicate org-ids for outgoing messages, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 36303d9 213/449: Do a better job of dealing with reference headers, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 01645a4 215/449: Allowing fetching attachments from specific IDs, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 305a704 216/449: Don't append the message-exit-action, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb d0d196f 222/449: Check prefix arg correctly, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 9a76fad 226/449: Use org-element-interpret-data to get paragraph text, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 09346e0 141/449: BBDB message link list needs closing newline, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 69980d3 143/449: Improvements to nnir-run-gnorb,
Stefan Monnier <=
- [elpa] externals/gnorb ebce811 144/449: Also check for nnir when storing BBDB message links, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 5101731 150/449: Improvements to TODOs made from outgoing messages, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb b841d17 146/449: Wishlist changes, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 8958546 155/449: Backquote escape fail, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 38df7d0 166/449: Ignore a notes.org file, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 44f8d23 165/449: Begin shift to using the registry, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb c280ea4 160/449: Only add relevant sent messages in the registry, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 4fc1075 172/449: Rename gnorb-org-window-conf to gnorb-window-conf, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb bb44a8c 174/449: Don't force id creation!, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb b596ee7 157/449: Check for success when following gnus links, Stefan Monnier, 2020/11/27