Browse Source

Merge branch 'maint'

Nicolas Goaziou 8 years ago
parent
commit
517fed8d4d
2 changed files with 10 additions and 5 deletions
  1. 2 5
      lisp/org.el
  2. 8 0
      testing/lisp/test-org.el

+ 2 - 5
lisp/org.el

@@ -11141,13 +11141,10 @@ of matched result, which is either `dedicated' or `fuzzy'."
      ;; statistics cookies and tags.
      ((and (derived-mode-p 'org-mode)
 	   (let ((title-re
-		  (format "%s[ \t]*\\(?:%s[ \t]+\\)?.*%s"
+		  (format "%s.*\\(?:%s[ \t]\\)?.*%s"
 			  org-outline-regexp-bol
 			  org-comment-string
-			  (mapconcat
-			   (lambda (w) (format "\\<%s\\>" (regexp-quote w)))
-			   words
-			   ".+")))
+			  (mapconcat #'regexp-quote words ".+")))
 		 (cookie-re "\\[[0-9]*\\(?:%\\|/[0-9]*\\)\\]")
 		 (comment-re (format "\\`%s[ \t]+" org-comment-string)))
 	     (goto-char (point-min))

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

@@ -2120,9 +2120,17 @@ Foo Bar
    (org-test-with-temp-text "[[*Test]]\n* COMMENT Test"
      (org-open-at-point)
      (looking-at "\\* COMMENT Test")))
+  (should
+   (org-test-with-temp-text "[[*Test]]\n* TODO COMMENT Test"
+     (org-open-at-point)
+     (looking-at "\\* TODO COMMENT Test")))
   ;; Correctly un-hexify fuzzy links.
   (should
    (org-test-with-temp-text "* With space\n[[*With%20space][With space<point>]]"
+     (org-open-at-point)
+     (bobp)))
+  (should
+   (org-test-with-temp-text "* [1]\n[[*%5B1%5D<point>]]"
      (org-open-at-point)
      (bobp))))