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

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

[elpa] externals/gnorb 96afd01 084/449: Skip Note items when scanning st


From: Stefan Monnier
Subject: [elpa] externals/gnorb 96afd01 084/449: Skip Note items when scanning state changes
Date: Fri, 27 Nov 2020 23:15:13 -0500 (EST)

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

    Skip Note items when scanning state changes
    
    lisp/gnorb-org.el: gnorb-org-scan-state-notes will now skip any leading
                   - Note items in the logbook, and start checking with
                   the first - State item.
    
    This is a temporary measure. If gnorb-org-mail-scan-state-changes is set
    to 'all, this will only skip the leading - Note items, not those later
    in the drawer. But really, who would want to scan all the state-change
    notes? This needs to be much more flexible and customizable, so people
    can make gnorb-org-handle-mail do just what they want.
---
 lisp/gnorb-org.el | 22 +++++++++++++++++-----
 1 file changed, 17 insertions(+), 5 deletions(-)

diff --git a/lisp/gnorb-org.el b/lisp/gnorb-org.el
index f7970d7..73cc672 100644
--- a/lisp/gnorb-org.el
+++ b/lisp/gnorb-org.el
@@ -182,12 +182,24 @@ message link found will be replied to."
          (setq state-list (org-list-context))))
        (t nil))
       (when state-list
-       (let* ((origin (if org-log-states-order-reversed
-                          (car state-list)
-                        (second state-list)))
-              (item (org-in-item-p))
-              (struct (org-list-struct))
+       (let* ((struct (org-list-struct))
               (prevs (org-list-prevs-alist struct))
+              (origin (progn (goto-char
+                              (if org-log-states-order-reversed
+                                  (car state-list)
+                                (second state-list)))
+                             (while (not (looking-at
+                                          (concat
+                                           (nth 2 (car (org-list-struct)))
+                                           "State ")))
+                               (goto-char
+                                (funcall
+                                 (if org-log-states-order-reversed
+                                     'org-list-get-next-item
+                                   'org-list-get-prev-item)
+                                 (org-in-item-p) struct prevs)))
+                             (point)))
+              (item (org-in-item-p))
               (bound (if (eq gnorb-org-mail-scan-state-changes 'first)
                          (save-excursion
                            (goto-char



reply via email to

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