From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [PATCH] Allow insertion of links with multi-line search strings Date: Wed, 29 Mar 2017 15:38:00 +0200 Message-ID: <87vaqsp5jb.fsf@nicolasgoaziou.fr> References: <87h92gx9ak.fsf@fastmail.fm> <87vaquahk8.fsf@fastmail.fm> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47558) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ctDnm-0001Il-I9 for emacs-orgmode@gnu.org; Wed, 29 Mar 2017 09:38:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ctDnl-0002SI-FQ for emacs-orgmode@gnu.org; Wed, 29 Mar 2017 09:38:18 -0400 Received: from relay4-d.mail.gandi.net ([2001:4b98:c:538::196]:47746) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ctDnY-0002Qb-BU for emacs-orgmode@gnu.org; Wed, 29 Mar 2017 09:38:17 -0400 Received: from saiph.selenimh (unknown [IPv6:2a03:a0a0:0:4301::74b]) (Authenticated sender: mail@nicolasgoaziou.fr) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 11B851720DB for ; Wed, 29 Mar 2017 15:38:01 +0200 (CEST) Received: from ngz by saiph.selenimh with local (Exim 4.88) (envelope-from ) id 1ctDnU-0004Zu-Iu for emacs-orgmode@gnu.org; Wed, 29 Mar 2017 15:38:00 +0200 In-Reply-To: <87vaquahk8.fsf@fastmail.fm> (Matt Lundin's message of "Mon, 27 Mar 2017 10:02:47 -0500") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Org Mode Hello, Matt Lundin writes: > From 726eba76f31537747a26a7689ee632ec8e9bc01f Mon Sep 17 00:00:00 2001 > From: Matt Lundin > 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