From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Lundin Subject: [BUG] org-link-search fails if search string contains new lines Date: Sun, 26 Mar 2017 12:35:19 -0500 Message-ID: <87zig8vt48.fsf@fastmail.fm> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:59193) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1csC4b-0004Au-4N for emacs-orgmode@gnu.org; Sun, 26 Mar 2017 13:35:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1csC4X-0004tq-6O for emacs-orgmode@gnu.org; Sun, 26 Mar 2017 13:35:25 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:33882) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1csC4W-0004tk-Py for emacs-orgmode@gnu.org; Sun, 26 Mar 2017 13:35:21 -0400 Received: from archpad (c-24-14-63-242.hsd1.il.comcast.net [24.14.63.242]) by mail.messagingengine.com (Postfix) with ESMTPA id 2CA8D7E53D for ; Sun, 26 Mar 2017 13:35:20 -0400 (EDT) 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 Following links fails to locate the appropriate location in text files if the search string in the link contains new lines. Steps to reproduce: /usr/bin/emacs -Q ~/config/minimal.el where minimal.el contains... --8<---------------cut here---------------start------------->8--- (add-to-list 'load-path "~/org-mode/lisp/") (add-to-list 'load-path "~/org-mode/contrib/lisp/") (setq org-agenda-files '("~/config/test.org")) (setq org-capture-templates '(("n" "Note" entry (file "~/config/test.org") "* Test\n %a\n"))) --8<---------------cut here---------------end--------------->8--- Open a file (~/text.txt) containing.... --8<---------------cut here---------------start------------->8--- Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. --8<---------------cut here---------------end--------------->8--- Create an active region covering the third sentence and select the org-capture "n" template, which creates the following link: --8<---------------cut here---------------start------------->8--- * Test [[file:~/test.txt::Duis%20aute%20irure%20dolor%20in%0Areprehenderit%20in%20voluptate%20velit%20esse%20cillum%20dolore%20eu%20fugiat%20nulla%0Apariatur.]] --8<---------------cut here---------------end--------------->8--- 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." For comparison, evaluate (setq org-context-in-file-links 1) and run capture again. The captured snippet looks like this: --8<---------------cut here---------------start------------->8--- * Test [[file:~/test.txt::Duis%20aute%20irure%20dolor%20in]] --8<---------------cut here---------------end--------------->8--- Follow the link. The fuzzy search succeeds and finds the correct position in the text. Matt