summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Lundin <mdl@imapmail.org>2017-03-27 09:55:33 -0500
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2017-03-29 14:28:48 +0200
commitd9038a01c1bec6977b226ad3c45fd9e2fc43f9a3 (patch)
treeb075a51304bfdafaf6f66053074e1dba8320c8ca
parent1f8cf90d2e3005923948af9589efb3d0dfc2cf09 (diff)
downloadorg-mode-d9038a01c1bec6977b226ad3c45fd9e2fc43f9a3.tar.gz
Allow insertion of links with multi-line search strings
* lisp/org.el: (org-insert-link): Fix regexps to match across newlines.
-rw-r--r--lisp/org.el4
1 files changed, 2 insertions, 2 deletions
diff --git a/lisp/org.el b/lisp/org.el
index 5e0817c..7ad8094 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -10549,7 +10549,7 @@ Use TAB to complete link prefixes, then RET for type-specific completion support
;; option If yes, simplify the link by using only the search
;; option.
(when (and buffer-file-name
- (string-match "^file:\\(.+?\\)::\\(.+\\)" link))
+ (string-match "^file:\\(.+?\\)::\\(\\(.\\|\n\\)+\\)" link))
(let* ((path (match-string 1 link))
(case-fold-search nil)
(search (match-string 2 link)))
@@ -10559,7 +10559,7 @@ Use TAB to complete link prefixes, then RET for type-specific completion support
(setq link search)))))
;; Check if we can/should use a relative path. If yes, simplify the link
- (when (string-match "^\\(file:\\|docview:\\)\\(.*\\)" link)
+ (when (string-match "^\\(file:\\|docview:\\)\\(\\(.\\|\n\\)*\\)" link)
(let* ((type (match-string 1 link))
(path (match-string 2 link))
(origpath path)