Sfoglia il codice sorgente

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>
Nicolas Goaziou 9 anni fa
parent
commit
985420eceb
1 ha cambiato i file con 6 aggiunte e 3 eliminazioni
  1. 6 3
      lisp/org.el

+ 6 - 3
lisp/org.el

@@ -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 ()