Fix: (--select) Don't iterate over every heading with preamble
Oops, using "when" instead of "while" did outline-next-heading even when re-search-forward found no more matches. That unnecessarily slowed down some searches, negating almost all of the gains.
This commit is contained in:
parent
81ef7adbca
commit
b5ccc3294e
1 changed files with 5 additions and 4 deletions
|
|
@ -404,7 +404,8 @@ If NARROW is non-nil, buffer will not be widened."
|
|||
(goto-char (point-min))
|
||||
(when (org-before-first-heading-p)
|
||||
(outline-next-heading))
|
||||
(cond (preamble-re (cl-loop when (and (when (re-search-forward preamble-re nil t)
|
||||
;; `cl-loop' makes this double-while much clearer than the expanded form.
|
||||
(cond (preamble-re (cl-loop while (and (when (re-search-forward preamble-re nil t)
|
||||
(outline-back-to-heading 'invisible-ok)
|
||||
t)
|
||||
(funcall predicate))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue