From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Brand Subject: new exporter: link abbrev Date: Mon, 3 Dec 2012 16:20:22 +0100 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([208.118.235.92]:33948) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TfXoq-0001GF-73 for emacs-orgmode@gnu.org; Mon, 03 Dec 2012 10:20:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TfXol-0003YS-TO for emacs-orgmode@gnu.org; Mon, 03 Dec 2012 10:20:28 -0500 Received: from mail-vc0-f169.google.com ([209.85.220.169]:43748) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TfXol-0003YL-MU for emacs-orgmode@gnu.org; Mon, 03 Dec 2012 10:20:23 -0500 Received: by mail-vc0-f169.google.com with SMTP id gb23so2301315vcb.0 for ; Mon, 03 Dec 2012 07:20:22 -0800 (PST) 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: Org Mode Hi all I think the new exporter should still expand link abbreviations also when in the heading and for all backends. Example with html link on today=92s release_7.9.2-646-g664217: - Org file: #+LINK: orgmode http://www.orgmode.org/ * Org Mode doc [[orgmode:#docs]] - export to html: - old exporter expands link:

1 Org Mode doc http://www.orgmode.org/#docs

- new exporter leaves link abbreviated:

1 Org Mode doc orgmode:#docs

- export to ascii: - old exporter expands link: 1 Org Mode doc [http://www.orgmode.org/#docs] - new exporter omits link: 1 Org Mode doc Michael From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jambunathan K Subject: Re: new exporter: link abbrev Date: Tue, 04 Dec 2012 17:10:35 +0530 Message-ID: <87r4n6m4ek.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([208.118.235.92]:55803) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tfqow-0007Ak-B4 for emacs-orgmode@gnu.org; Tue, 04 Dec 2012 06:37:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tfqou-0004jJ-SZ for emacs-orgmode@gnu.org; Tue, 04 Dec 2012 06:37:50 -0500 Received: from mail-da0-f41.google.com ([209.85.210.41]:33462) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tfqou-0004jD-M4 for emacs-orgmode@gnu.org; Tue, 04 Dec 2012 06:37:48 -0500 Received: by mail-da0-f41.google.com with SMTP id e20so1694470dak.0 for ; Tue, 04 Dec 2012 03:37:47 -0800 (PST) In-Reply-To: (Michael Brand's message of "Mon, 3 Dec 2012 16:20:22 +0100") 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: Michael Brand Cc: Org Mode I would like to hear Nicolas' views before someone gets too excited to put in a change. > Hi all > > I think the new exporter should still expand link abbreviations also > when in the heading and for all backends. Example with html link on > today=E2=80=99s release_7.9.2-646-g664217: > > - Org file: > > #+LINK: orgmode http://www.orgmode.org/ > * Org Mode doc [[orgmode:#docs]] > > > - export to html: > - old exporter expands link: >

1 Org Mode d= oc > http://www.orgmode.org/#docs=

> - new exporter leaves link abbreviated: >

1 Org Mode d= oc > orgmode:#docs

> > - export to ascii: > - old exporter expands link: > 1 Org Mode doc [http://www.orgmode.org/#docs] > - new exporter omits link: > 1 Org Mode doc > > Michael > > --=20 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bastien Subject: Re: new exporter: link abbrev Date: Tue, 04 Dec 2012 15:59:58 +0100 Message-ID: <87hao1oob5.fsf@bzg.ath.cx> References: <87r4n6m4ek.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([208.118.235.92]:49080) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tftyl-0002pY-W3 for emacs-orgmode@gnu.org; Tue, 04 Dec 2012 10:00:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tftyb-0007Rz-4G for emacs-orgmode@gnu.org; Tue, 04 Dec 2012 10:00:07 -0500 Received: from mail-wi0-f179.google.com ([209.85.212.179]:64890) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tftya-0007Rt-UY for emacs-orgmode@gnu.org; Tue, 04 Dec 2012 10:00:01 -0500 Received: by mail-wi0-f179.google.com with SMTP id o1so549243wic.12 for ; Tue, 04 Dec 2012 07:00:00 -0800 (PST) In-Reply-To: <87r4n6m4ek.fsf@gmail.com> (Jambunathan K.'s message of "Tue, 04 Dec 2012 17:10:35 +0530") 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: Jambunathan K Cc: Michael Brand , Org Mode Hi Michael, Jambunathan K writes: > I would like to hear Nicolas' views before someone gets too excited to > put in a change. I do agree with Jambunathan.=20=20 But let's keep this option in mind anyway. Best, =2D-=20 Bastien From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: new exporter: link abbrev Date: Wed, 05 Dec 2012 22:05:32 +0100 Message-ID: <87y5hctdk3.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([208.118.235.92]:32878) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TgMDy-0001yv-6l for emacs-orgmode@gnu.org; Wed, 05 Dec 2012 16:09:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TgMDw-0000Ue-N2 for emacs-orgmode@gnu.org; Wed, 05 Dec 2012 16:09:46 -0500 Received: from mail-wg0-f51.google.com ([74.125.82.51]:34802) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TgMDw-0000UW-Fu for emacs-orgmode@gnu.org; Wed, 05 Dec 2012 16:09:44 -0500 Received: by mail-wg0-f51.google.com with SMTP id gg4so2462331wgb.30 for ; Wed, 05 Dec 2012 13:09:43 -0800 (PST) In-Reply-To: (Michael Brand's message of "Mon, 3 Dec 2012 16:20:22 +0100") 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: Michael Brand Cc: Org Mode Hello, Michael Brand writes: > I think the new exporter should still expand link abbreviations also > when in the heading and for all backends. Example with html link on > today=E2=80=99s release_7.9.2-646-g664217: > > - Org file: > #+LINK: orgmode http://www.orgmode.org/ > * Org Mode doc [[orgmode:#docs]] > > - export to html: > - old exporter expands link: >

1 Org Mode d= oc > http://www.orgmode.org/#docs=

> - new exporter leaves link abbreviated: >

1 Org Mode d= oc > orgmode:#docs

> > - export to ascii: > - old exporter expands link: > 1 Org Mode doc [http://www.orgmode.org/#docs] > - new exporter omits link: > 1 Org Mode doc There are two things going on here.=20 The first one, which is minor, is that e-ascii back-end currently doesn't handle correctly translated links anywhere. This is easy to fix. The second one is a more difficult problem. Org Elements usually translates links on the fly when parsing them: `org-element-link-parser' calls `org-translate-link'. This function requires `org-link-abbrev-alist' and `org-link-abbrev-alist-local' variables to be set properly, the second one being a local variable. Unfortunately, parsing of secondary strings (in particular headline titles or inline footnote definitions) happens in a temporary buffer, where no local variable is set. There `org-link-abbrev-alist-local' is nil, no matter what your #+LINK: keyword says, and link translation can't happen. Also, local variables cannot be send to the temporary buffer, because secondary string parsing can sometimes happen when the original buffer isn't supposed to exist, that is during export (when the parse tree is the only trusted data). A possible solution would be to move link translation from org-element.el to org-export.el. But that would require to explicitly call a translator function on links, which would be an additional task for back-end developers. Also, `org-element-context' would not return anymore the real path of the abbreviated link, only its raw path. Regards, --=20 Nicolas Goaziou From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Brand Subject: Re: new exporter: link abbrev Date: Thu, 6 Dec 2012 16:13:26 +0100 Message-ID: References: <87y5hctdk3.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Return-path: Received: from eggs.gnu.org ([208.118.235.92]:34347) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tgd8t-0004yb-Qr for emacs-orgmode@gnu.org; Thu, 06 Dec 2012 10:13:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tgd8i-0005wX-W0 for emacs-orgmode@gnu.org; Thu, 06 Dec 2012 10:13:39 -0500 Received: from mail-qa0-f48.google.com ([209.85.216.48]:62961) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tgd8i-0005wR-RL for emacs-orgmode@gnu.org; Thu, 06 Dec 2012 10:13:28 -0500 Received: by mail-qa0-f48.google.com with SMTP id l8so791479qaq.0 for ; Thu, 06 Dec 2012 07:13:26 -0800 (PST) In-Reply-To: <87y5hctdk3.fsf@gmail.com> 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: Org Mode Hi Nicolas On Wed, Dec 5, 2012 at 10:05 PM, Nicolas Goaziou wrote: > The second one is a more difficult problem. Org Elements usually > translates links on the fly when parsing them: `org-element-link-parser' > calls `org-translate-link'. This function requires > `org-link-abbrev-alist' and `org-link-abbrev-alist-local' variables to > be set properly, the second one being a local variable. > > Unfortunately, parsing of secondary strings (in particular headline > titles or inline footnote definitions) happens in a temporary buffer, > where no local variable is set. There `org-link-abbrev-alist-local' is > nil, no matter what your #+LINK: keyword says, and link translation > can't happen. > > Also, local variables cannot be send to the temporary buffer, because > secondary string parsing can sometimes happen when the original buffer > isn't supposed to exist, that is during export (when the parse tree is > the only trusted data). Thank you for the explanations. > A possible solution would be to move link translation from > org-element.el to org-export.el. But that would require to explicitly > call a translator function on links, which would be an additional task > for back-end developers. Also, `org-element-context' would not return > anymore the real path of the abbreviated link, only its raw path. I would like to not burden back-end developers with this. In the meantime I found out that I can simply add org-export-normalize-links to org-export-before-processing-hook and it seems to do what I expect. But this is probably not to be included in Org core because the (hopefully at least only basic) pre-parsing of org-export-normalize-links undermines the later parsing of org-elements. In case org-export-normalize-links would survive the old exporter (I fear it will not) the workaround of hooking would do it for me. Michael From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: new exporter: link abbrev Date: Tue, 18 Dec 2012 22:21:53 +0100 Message-ID: <87hanjjbta.fsf@gmail.com> References: <87y5hctdk3.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:51935) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tl4fu-0008JS-1z for emacs-orgmode@gnu.org; Tue, 18 Dec 2012 16:26:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tl4fr-0006u9-5l for emacs-orgmode@gnu.org; Tue, 18 Dec 2012 16:26:05 -0500 Received: from mail-wg0-f48.google.com ([74.125.82.48]:35905) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tl4fq-0006ty-RR for emacs-orgmode@gnu.org; Tue, 18 Dec 2012 16:26:03 -0500 Received: by mail-wg0-f48.google.com with SMTP id dt10so552122wgb.3 for ; Tue, 18 Dec 2012 13:26:01 -0800 (PST) In-Reply-To: (Michael Brand's message of "Thu, 6 Dec 2012 16:13:26 +0100") 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: Michael Brand Cc: Org Mode Michael Brand writes: > In the meantime I found out that I can simply add > org-export-normalize-links to org-export-before-processing-hook and it > seems to do what I expect. But this is probably not to be included in > Org core because the (hopefully at least only basic) pre-parsing of > org-export-normalize-links undermines the later parsing of > org-elements. In case org-export-normalize-links would survive the old > exporter (I fear it will not) the workaround of hooking would do it > for me. The problem should now be fixed without using any trick (and no, `org-export-normalize-links' will not survive the old exporter). Regards, -- Nicolas Goaziou From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Brand Subject: Re: new exporter: link abbrev Date: Wed, 19 Dec 2012 12:10:37 +0100 Message-ID: References: <87y5hctdk3.fsf@gmail.com> <87hanjjbta.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Return-path: Received: from eggs.gnu.org ([208.118.235.92]:52436) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TlHXu-0002Ui-2x for emacs-orgmode@gnu.org; Wed, 19 Dec 2012 06:10:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TlHXq-0006Z6-A1 for emacs-orgmode@gnu.org; Wed, 19 Dec 2012 06:10:41 -0500 Received: from mail-qc0-f178.google.com ([209.85.216.178]:59566) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TlHXq-0006Yw-5n for emacs-orgmode@gnu.org; Wed, 19 Dec 2012 06:10:38 -0500 Received: by mail-qc0-f178.google.com with SMTP id j34so1001144qco.9 for ; Wed, 19 Dec 2012 03:10:37 -0800 (PST) In-Reply-To: <87hanjjbta.fsf@gmail.com> 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: Org Mode Hi Nicolas On Tue, Dec 18, 2012 at 10:21 PM, Nicolas Goaziou wrote: > The problem should now be fixed without using any trick It is, thank you. > (and no, > `org-export-normalize-links' will not survive the old exporter). Thanks to your change above I like this cleanup. Michael