Allow insertion of links with multi-line search strings
* lisp/org.el: (org-insert-link): Fix regexps to match across newlines.
This commit is contained in:
parent
1f8cf90d2e
commit
d9038a01c1
|
@ -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 If yes, simplify the link by using only the search
|
||||||
;; option.
|
;; option.
|
||||||
(when (and buffer-file-name
|
(when (and buffer-file-name
|
||||||
(string-match "^file:\\(.+?\\)::\\(.+\\)" link))
|
(string-match "^file:\\(.+?\\)::\\(\\(.\\|\n\\)+\\)" link))
|
||||||
(let* ((path (match-string 1 link))
|
(let* ((path (match-string 1 link))
|
||||||
(case-fold-search nil)
|
(case-fold-search nil)
|
||||||
(search (match-string 2 link)))
|
(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)))))
|
(setq link search)))))
|
||||||
|
|
||||||
;; Check if we can/should use a relative path. If yes, simplify the link
|
;; 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))
|
(let* ((type (match-string 1 link))
|
||||||
(path (match-string 2 link))
|
(path (match-string 2 link))
|
||||||
(origpath path)
|
(origpath path)
|
||||||
|
|
Loading…
Reference in New Issue