Browse Source

Merge branch 'maint'

Nicolas Goaziou 8 years ago
parent
commit
a126020e56
2 changed files with 12 additions and 3 deletions
  1. 1 2
      lisp/org.el
  2. 11 1
      testing/lisp/test-org.el

+ 1 - 2
lisp/org.el

@@ -10948,8 +10948,7 @@ of matched result, which is either `dedicated' or `fuzzy'."
 	 (normalized (replace-regexp-in-string "\n[ \t]*" " " s))
 	 (normalized (replace-regexp-in-string "\n[ \t]*" " " s))
 	 (starred (eq (string-to-char normalized) ?*))
 	 (starred (eq (string-to-char normalized) ?*))
 	 (words (split-string (if starred (substring s 1) s)))
 	 (words (split-string (if starred (substring s 1) s)))
-	 (s-multi-re
-	  (mapconcat #'regexp-quote words "\\([ \t]*\n[ \t]*\\|[ \t]+\\)"))
+	 (s-multi-re (mapconcat #'regexp-quote words "\\(?:[ \t\n]+\\)"))
 	 (s-single-re (mapconcat #'regexp-quote words "[ \t]+"))
 	 (s-single-re (mapconcat #'regexp-quote words "[ \t]+"))
 	 type)
 	 type)
     (cond
     (cond

+ 11 - 1
testing/lisp/test-org.el

@@ -2283,9 +2283,19 @@ Foo Bar
    (org-test-with-temp-text "* [1]\n[[*%5B1%5D<point>]]"
    (org-test-with-temp-text "* [1]\n[[*%5B1%5D<point>]]"
      (org-open-at-point)
      (org-open-at-point)
      (bobp)))
      (bobp)))
-  ;; Match search strings containing newline characters.
+  ;; Match search strings containing newline characters, including
+  ;; blank lines.
   (should
   (should
    (org-test-with-temp-text-in-file "Paragraph\n\nline1\nline2\n\n"
    (org-test-with-temp-text-in-file "Paragraph\n\nline1\nline2\n\n"
+     (let ((file (buffer-file-name)))
+       (goto-char (point-max))
+       (insert (format "[[file:%s::line1 line2]]" file))
+       (beginning-of-line)
+       (let ((org-link-search-must-match-exact-headline nil))
+	 (org-open-at-point))
+       (looking-at-p "line1"))))
+  (should
+   (org-test-with-temp-text-in-file "Paragraph\n\nline1\n\nline2\n\n"
      (let ((file (buffer-file-name)))
      (let ((file (buffer-file-name)))
        (goto-char (point-max))
        (goto-char (point-max))
        (insert (format "[[file:%s::line1 line2]]" file))
        (insert (format "[[file:%s::line1 line2]]" file))