emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] [PATCH] Allow insertion of links with multi-line search strings


From: Nicolas Goaziou
Subject: Re: [O] [PATCH] Allow insertion of links with multi-line search strings
Date: Wed, 29 Mar 2017 15:38:00 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux)

Hello,

Matt Lundin <address@hidden> writes:

> From 726eba76f31537747a26a7689ee632ec8e9bc01f Mon Sep 17 00:00:00 2001
> From: Matt Lundin <address@hidden>
> Date: Mon, 27 Mar 2017 09:55:33 -0500
> Subject: [PATCH] Allow insertion of links with multi-line search strings
>
> * lisp/org.el: (org-insert-link): Fix regexps to match across
>   newlines.
> ---
>  lisp/org.el | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/lisp/org.el b/lisp/org.el
> index e40db18f6..dcfa4fd6f 100644
> --- a/lisp/org.el
> +++ b/lisp/org.el
> @@ -10330,7 +10330,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)))
> @@ -10340,7 +10340,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)

Applied. Thank you.

Regards,

-- 
Nicolas Goaziou



reply via email to

[Prev in Thread] Current Thread [Next in Thread]