From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tobias Getzner Subject: Re: Multi-line links Date: Sun, 06 Jul 2014 18:25:40 +0200 Message-ID: <1404663940.11764.1.camel@wirrsal> References: <1404297563.12348.4.camel@glenalbyn> <1404308028.12348.7.camel@glenalbyn> <87egxz3q8m.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58310) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X3pGH-0001r4-JS for emacs-orgmode@gnu.org; Sun, 06 Jul 2014 12:26:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X3pGC-00047P-Cn for emacs-orgmode@gnu.org; Sun, 06 Jul 2014 12:25:57 -0400 Received: from mout.gmx.net ([212.227.15.19]:55126) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X3pGC-000470-22 for emacs-orgmode@gnu.org; Sun, 06 Jul 2014 12:25:52 -0400 In-Reply-To: <87egxz3q8m.fsf@nicolasgoaziou.fr> 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Nicolas Goaziou Cc: emacs-orgmode@gnu.org Hello Nicolas, On Sun, 2014-07-06 at 09:23 +0200, Nicolas Goaziou wrote: > Tobias Getzner writes: > > On Wed, 2014-07-02 at 12:39 +0200, Tobias Getzner wrote: > > One additional issue I=E2=80=99ve hit upon is that the link :path retur= ned by > > org-mode is also truncated after a newline, while the :raw-link is > > correctly returned in full. >=20 > Could you provide an example? My original example also applies to this issue. [[citet:green1994hybridreasoningmodel, green1994generatingindirectanswers, green1992conversationalimplicaturesindirect]] Clicking on the first line in the above link, the returned :path will be just be =C2=ABgreen1994hybridreasoningmodel,=C2=BB, i.=E2=80=AFe., the := path is truncated after the newline. The raw-path will be correct, however, i.=E2=80=AFe., =C2=ABcitet:green1994hybrid=E2=80=A6,\ngreen1994generating= =E2=80=A6,\ngreen1992=E2=80=A6=C2=BB. Apart from the truncation issue, the link itself can be triggered only via the first two lines, while the last line yields =C2=ABno link found=C2= =BB, despite the fact that the last line is syntax-highlighted and clickable. > Note that Org links do not allow newline characters in the "link" part. > Is it really an issue or a limitation? According to the syntax spec, newlines should be allowed both in the link path and in the description, but I realize the syntax spec is kind of after-the-fact. On the other hand, the implementation seems to already support n-line links for the arbitrary value of 2 (with the caveat that the :path value currently breaks). The reason why I consider it a limitation is cases like the one I initially outlined. An extension like org-ref might want to internally parse the link path, and it makes sense to allow newlines as separators here, so that the links remain legible and so one can have hard line-breaks at 80 cols. In particular, BibTeX-based links can become very long. If one prefers hard line-breaks, these links will impair the readability of the document. On the other hand, it=E2=80=99s an inconsistency that these links will be correctly syntax-highlighted and clickable on every line, with the handler then breaking on lines > 2 and with a truncated :path.=20 Since link paths and descriptions cannot contain square brackets, would it be possible to rely just on these to terminate link parsing? In an earlier post of yours, you seem to have identified the relevant code responsible for this: http://lists.gnu.org/archive/html/emacs-orgmode/2011-03/msg00532.html If there is some strong reason for a hard-coded limit, would it be possible to expose the limit as a user-definable variable, and to fix the :path truncation issue? Best regards, Tobias