emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: Org Mode <emacs-orgmode@gnu.org>
Subject: Re: [PATCH] Allow insertion of links with multi-line search strings
Date: Wed, 29 Mar 2017 15:38:00 +0200	[thread overview]
Message-ID: <87vaqsp5jb.fsf@nicolasgoaziou.fr> (raw)
In-Reply-To: <87vaquahk8.fsf@fastmail.fm> (Matt Lundin's message of "Mon, 27 Mar 2017 10:02:47 -0500")

Hello,

Matt Lundin <mdl@imapmail.org> writes:

> From 726eba76f31537747a26a7689ee632ec8e9bc01f Mon Sep 17 00:00:00 2001
> From: Matt Lundin <mdl@imapmail.org>
> 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	other threads:[~2017-03-29 13:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-26 17:21 Inconsistent behavior in generating file link search strings Matt Lundin
2017-03-27 15:01 ` Matt Lundin
2017-03-27 15:02 ` [PATCH] Allow insertion of links with multi-line " Matt Lundin
2017-03-29 13:38   ` Nicolas Goaziou [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87vaqsp5jb.fsf@nicolasgoaziou.fr \
    --to=mail@nicolasgoaziou.fr \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).