summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2017-03-27 13:36:49 +0200
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2017-03-27 13:36:49 +0200
commit72c3c4225918d2004ad463510bc5dce493dde788 (patch)
tree0bb5515e293eaf119e7373c16aa162af1cf9a06b
parente9018fbd0eb8b4f4b89663d03e3b4dd2a6863a42 (diff)
parent4dde26f0863ca57fd3fdfb8dc57c631cb22e6cc1 (diff)
downloadorg-mode-72c3c4225918d2004ad463510bc5dce493dde788.tar.gz
Merge branch 'maint'
-rw-r--r--lisp/org.el3
-rw-r--r--testing/lisp/test-org.el12
2 files changed, 13 insertions, 2 deletions
diff --git a/lisp/org.el b/lisp/org.el
index 9ce6471..e40db18 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -10948,7 +10948,8 @@ of matched result, which is either `dedicated' or `fuzzy'."
(normalized (replace-regexp-in-string "\n[ \t]*" " " s))
(starred (eq (string-to-char normalized) ?*))
(words (split-string (if starred (substring s 1) s)))
- (s-multi-re (mapconcat #'regexp-quote words "[ \t]+\\(?:\n[ \t]*\\)?"))
+ (s-multi-re
+ (mapconcat #'regexp-quote words "\\([ \t]*\n[ \t]*\\|[ \t]+\\)"))
(s-single-re (mapconcat #'regexp-quote words "[ \t]+"))
type)
(cond
diff --git a/testing/lisp/test-org.el b/testing/lisp/test-org.el
index 1ff7c39..09b0373 100644
--- a/testing/lisp/test-org.el
+++ b/testing/lisp/test-org.el
@@ -2282,7 +2282,17 @@ Foo Bar
(should
(org-test-with-temp-text "* [1]\n[[*%5B1%5D<point>]]"
(org-open-at-point)
- (bobp))))
+ (bobp)))
+ ;; Match search strings containing newline characters.
+ (should
+ (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")))))
;;;; Link Escaping