Speed improvement for `org-goto'

* lisp/org.el (org-goto-local-search-headings): Do not rely on
  `org-context' just to check if point is on a headline but not on its
  tags.

Reported-by: Gregor Zattler <telegraph@gmx.net> <w>
<http://permalink.gmane.org/gmane.emacs.orgmode/99111>
This commit is contained in:
Nicolas Goaziou 2015-07-20 11:40:44 +02:00
parent 216a53d6cc
commit 985420eceb
1 changed files with 6 additions and 3 deletions

View File

@ -7535,9 +7535,12 @@ or nil."
(while (if isearch-forward
(search-forward string bound noerror)
(search-backward string bound noerror))
(when (let ((context (mapcar 'car (save-match-data (org-context)))))
(and (member :headline context)
(not (member :tags context))))
(when (save-match-data
(and (save-excursion
(beginning-of-line)
(looking-at org-complex-heading-regexp))
(or (not (match-beginning 5))
(< (point) (match-beginning 5)))))
(throw 'return (point))))))
(defun org-goto-local-auto-isearch ()