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

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

[elpa] externals/org 9bd8a99a6e: org-agenda-get-sexps: Avoid excessive c


From: ELPA Syncer
Subject: [elpa] externals/org 9bd8a99a6e: org-agenda-get-sexps: Avoid excessive calls to `org-agenda-skip'
Date: Fri, 23 Sep 2022 11:57:51 -0400 (EDT)

branch: externals/org
commit 9bd8a99a6ecb5df3f7e880f46975f356282c7baa
Author: Ihor Radchenko <yantar92@gmail.com>
Commit: Ihor Radchenko <yantar92@gmail.com>

    org-agenda-get-sexps: Avoid excessive calls to `org-agenda-skip'
    
    * lisp/org-agenda.el (org-agenda-get-sexps): Only check if entry
    should be skipped on matching sexps, when `org-diary-sexp-entry'
    returns non-nil.
---
 lisp/org-agenda.el | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 4c3889d120..b608bdd290 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -5913,7 +5913,11 @@ displayed in agenda view."
     (goto-char (point-min))
     (while (re-search-forward regexp nil t)
       (catch :skip
-       (org-agenda-skip (org-element-at-point))
+        ;; We do not run `org-agenda-skip' righ away because every single sexp
+        ;; in the buffer is matched here, unlike day-specific search
+        ;; in ordinary timestamps.  Most of the sexps will not match
+        ;; the agenda day and it is quicker to run `org-agenda-skip' only for
+        ;; matching sexps later on.
        (setq beg (match-beginning 0))
        (goto-char (1- (match-end 0)))
        (setq b (point))
@@ -5929,6 +5933,8 @@ displayed in agenda view."
                           ""))
        (setq result (org-diary-sexp-entry sexp sexp-entry date))
        (when result
+          ;; Only check if entry should be skipped on matching sexps.
+         (org-agenda-skip (org-element-at-point))
          (setq marker (org-agenda-new-marker beg)
                level (make-string (org-reduced-level (org-outline-level)) ? )
                category (org-get-category beg)



reply via email to

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