From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?ISO-8859-1?Q?Jan_B=F6cker?= Subject: Re: Problems with hyperlinked files Date: Wed, 24 Mar 2010 14:42:54 +0100 Message-ID: <4BAA16DE.5080004@jboecker.de> References: <4e3ad401003230213s45df1a65ha431542f16da9f94@mail.gmail.com> <4BA92412.1060709@jboecker.de> <4e3ad401003232045o2ab47b42pb9148ed16a76e46d@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NuQsD-0002MM-DW for emacs-orgmode@gnu.org; Wed, 24 Mar 2010 09:43:53 -0400 Received: from [140.186.70.92] (port=46422 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NuQsB-0002M9-P3 for emacs-orgmode@gnu.org; Wed, 24 Mar 2010 09:43:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NuQs7-0005dm-2i for emacs-orgmode@gnu.org; Wed, 24 Mar 2010 09:43:51 -0400 Received: from mail7.worldserver.net ([217.13.200.27]:51744) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NuQs6-0005co-Nt for emacs-orgmode@gnu.org; Wed, 24 Mar 2010 09:43:47 -0400 In-Reply-To: <4e3ad401003232045o2ab47b42pb9148ed16a76e46d@mail.gmail.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Leo Alekseyev Cc: emacs-orgmode@gnu.org On 24.03.2010 04:45, Leo Alekseyev wrote: > Actually, it's right there in section 4.3 of the manual, last > sentence: "if you need to remove ambiguities about the end of the > link, enclose them in angular brackets. " > Ah, I see -- this seems to be meant for the use case you mention below, pasting in a URL without a description. >> You do not have to protect spaces, because the URL is surrounded by the >> square brackets. I could only insert angle brackets into a link by >> editing it manually; when you edit a link with C-c C-l and enclose the >> URL in angle brackets, Org will automatically remove them. > > Thanks, both these methods work -- although I still think it would be > nice if org mode could properly handle angle brackets inside square > ones; the motivation here is that often I just paste in file paths > instead of using C-c C-l, and then I have to use angle brackets to > deal w/ spaces; if I later want to change it to an annotated link, it > would be nice not to have to strip the angle brackets before wrapping > it in square ones... Wouldn't you change it to an annotated link using C-c C-l anyway, which would strip the square brackets for you? (C-c C-l can also edit existing links, not only insert new ones.) I looked at the code of org-open-at-point, and believe I can at least explain the current behaviour (but I have no idea how a clean/elegant fix would look): - Org notices it is in a bracket link, say [[]][test]] - the link variable in org-open-at-point is set to "" - after expanding the ~ abbreviation, it is set to " ][^ ]*\\)" Notice the optional < at the beginning? This regexp matches, and captures "file" as the link type. Now Org takes the rest of the link, "/home/jan/a b.txt>", and tries to open a non-existing file. I assume angle brackets are not meant to be supported in bracket links, because they are not needed there and are stripped by C-c C-l, but only Carsten would know what the intended behaviour is here. - Jan