From: Matt Lundin <mdl@imapmail.org>
To: Org Mode <emacs-orgmode@gnu.org>
Subject: Re: [BUG] org-link-search fails if search string contains new lines
Date: Sun, 26 Mar 2017 15:50:30 -0500 [thread overview]
Message-ID: <87inmvwynd.fsf@fastmail.fm> (raw)
In-Reply-To: <87zig8vt48.fsf@fastmail.fm> (Matt Lundin's message of "Sun, 26 Mar 2017 12:35:19 -0500")
Matt Lundin <mdl@imapmail.org> writes:
>
> Create an active region covering the third sentence and select the
> org-capture "n" template, which creates the following link:
>
> * Test
> [[file:~/test.txt::Duis%20aute%20irure%20dolor%20in%0Areprehenderit%20in%20voluptate%20velit%20esse%20cillum%20dolore%20eu%20fugiat%20nulla%0Apariatur.]]
>
> Try to follow the link. It will open test.txt, but it will also give the
> message and fail to locate the correct position in the file:
>
> "No match for fuzzy expression: Duis aute irure dolor in
> reprehenderit in voluptate velit esse cillum dolore eu fugiat
> nulla pariatur."
>
The problem, I think, is the regexp construction in org-link-search.
This was introduced back in August of 2015 with commit
cfe5bc97f8b18ccbf49d0764746c7563ce8d29da.
The problematic line in org.el is 10951:
(s-multi-re (mapconcat #'regexp-quote words "[ \t]+\\(?:\n[ \t]*\\)?"))
The constructed regexp fails because it assumes a newline will be
preceded by whitespace. But often newlines are not preceded by
whitespace.
Is there a reason the following won't work?
(s-multi-re (mapconcat #'regexp-quote words "[ \t\r\n]+"))
This was the method org-link-search used prior to the commit above. Are
we trying to avoid matching across blank lines?
Best,
Matt
next prev parent reply other threads:[~2017-03-26 20:50 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-26 17:35 [BUG] org-link-search fails if search string contains new lines Matt Lundin
2017-03-26 20:50 ` Matt Lundin [this message]
2017-03-27 11:37 ` Nicolas Goaziou
2017-03-27 15:15 ` Matt Lundin
2017-03-29 12:19 ` Nicolas Goaziou
2017-03-28 21:34 ` Skip Collins
2017-03-29 12:19 ` Nicolas Goaziou
2017-03-29 15:17 ` Skip Collins
2017-03-30 10:50 ` Nicolas Goaziou
2017-04-07 15:47 ` Skip Collins
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=87inmvwynd.fsf@fastmail.fm \
--to=mdl@imapmail.org \
--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).