Browse Source

Fuzzy links to headlines ignore COMMENT keywords

* lisp/org.el (org-link-search): Ignore COMMENT keyword.
* testing/lisp/test-org.el (test-org/fuzzy-links): Add test.

Reported-by: Martin Carlé <mc@aiguphonie.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/96413>
Nicolas Goaziou 10 years ago
parent
commit
22f732c255
2 changed files with 6 additions and 0 deletions
  1. 1 0
      lisp/org.el
  2. 5 0
      testing/lisp/test-org.el

+ 1 - 0
lisp/org.el

@@ -11079,6 +11079,7 @@ variable."
 	      org-outline-regexp-bol
 	      "\\(?:" org-todo-regexp "[ \t]+\\)?"
 	      "\\(?:\\[#.\\][ \t]+\\)?"
+	      "\\(?:" org-comment-string "[ \t]+\\)?"
 	      sep "*"
 	      (mapconcat #'identity
 			 (org-split-string (regexp-quote s))

+ 5 - 0
testing/lisp/test-org.el

@@ -1389,6 +1389,11 @@
        (let ((org-link-search-must-match-exact-headline nil)
 	     (org-todo-regexp "TODO"))
 	 (org-open-at-point)))))
+  ;; Heading match ignores COMMENT keyword.
+  (should
+   (org-test-with-temp-text "[[*Test]]\n* COMMENT Test"
+     (org-open-at-point)
+     (looking-at "\\* COMMENT Test")))
   ;; Correctly un-hexify fuzzy links.
   (should
    (org-test-with-temp-text "* With space\n[[*With%20space][With space]]"