From 22f732c2553cc8ab42e8465018042bf0f49b6f4f Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Thu, 26 Mar 2015 21:05:27 +0100 Subject: [PATCH] Fuzzy links to headlines ignore COMMENT keywords MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * lisp/org.el (org-link-search): Ignore COMMENT keyword. * testing/lisp/test-org.el (test-org/fuzzy-links): Add test. Reported-by: Martin Carlé --- lisp/org.el | 1 + testing/lisp/test-org.el | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/lisp/org.el b/lisp/org.el index c48976f61..42579d800 100755 --- a/lisp/org.el +++ b/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)) diff --git a/testing/lisp/test-org.el b/testing/lisp/test-org.el index c624b7319..3bb550df3 100644 --- a/testing/lisp/test-org.el +++ b/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]]"