[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] [BUG] org-link-search fails if search string contains new lines
From: |
Matt Lundin |
Subject: |
Re: [O] [BUG] org-link-search fails if search string contains new lines |
Date: |
Sun, 26 Mar 2017 15:50:30 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) |
Matt Lundin <address@hidden> 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
- [O] [BUG] org-link-search fails if search string contains new lines, Matt Lundin, 2017/03/26
- Re: [O] [BUG] org-link-search fails if search string contains new lines,
Matt Lundin <=
- Re: [O] [BUG] org-link-search fails if search string contains new lines, Nicolas Goaziou, 2017/03/27
- Re: [O] [BUG] org-link-search fails if search string contains new lines, Skip Collins, 2017/03/28
- Re: [O] [BUG] org-link-search fails if search string contains new lines, Nicolas Goaziou, 2017/03/29
- Re: [O] [BUG] org-link-search fails if search string contains new lines, Skip Collins, 2017/03/29
- Re: [O] [BUG] org-link-search fails if search string contains new lines, Nicolas Goaziou, 2017/03/30