From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christian Moe Subject: Re: [dev] Implement "ref" link types Date: Sun, 19 Feb 2012 20:28:23 +0100 Message-ID: <4F414D57.5090205@christianmoe.com> References: <87vcn2vgq7.fsf@gmail.com> Reply-To: mail@christianmoe.com Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([140.186.70.92]:46582) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RzCSs-00058q-Tj for emacs-orgmode@gnu.org; Sun, 19 Feb 2012 14:30:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RzCSr-0002aB-MZ for emacs-orgmode@gnu.org; Sun, 19 Feb 2012 14:30:30 -0500 Received: from mail-forward1.uio.no ([129.240.10.70]:44515) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RzCSr-0002Ws-DD for emacs-orgmode@gnu.org; Sun, 19 Feb 2012 14:30:29 -0500 Received: from exim by mail-out1.uio.no with local-bsmtp (Exim 4.75) (envelope-from ) id 1RzCSU-0008Th-Dl for emacs-orgmode@gnu.org; Sun, 19 Feb 2012 20:30:06 +0100 In-Reply-To: <87vcn2vgq7.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 List Hi, I think it's a great idea, as I've wanted to do it myself :-) , but I'm glad it's in competent hands instead. Me, I don't see any problem with a [[ref:something]] syntax. It's the obvious org-native, cross-backend replacement for \ref. The [[protocol:something]] syntax already widens the notion of link to shell: and elisp: links, so I wouldn't worry about breaking conventions. Using e.g. [[!something]] instead would introduce a brand new bit of syntax. Suggestion: On export, how about enabling automatic element descriptions for references following the type:name convention, so that e.g. just : in [[ref:tab:numbers]] we can see... would expand to in Table 2 we can see... If implemented, this should be user-customizable e.g. through an alist like (("fig" . "Figure") ("tab" . "Table") ("map" . "Map")) Yours, Christian On 2/19/12 7:08 PM, Nicolas Goaziou wrote: > Hello, > > I'd like to introduce a new type of internal links, namely "ref" links. > > Since any element can now have a "#+name: something" affiliated keyword, > it would be practical to have a way to go straight to that name, from > anywhere in the buffer. The following patch implements > a [[ref:something]] syntax, or even [[ref:something][text]] to do so. > > The problem that I see here is that is breaks a bit syntax for internal > links ("protocol:path" is usually for external links). Another solution > would be to make them more hermetic: [[!something]]. > > On the export side, a "ref" link should be replaced by its description, > if it has any, or by the sequence number of the matching element among > elements of the same type. With the new exporter and the following > buffer: > > #+begin_src org > #+name: tab:letters > #+caption: Letters > | a | b | > | c | d | > > #+name: tab:numbers > #+caption: Numbers > | 1 | > | 2 | > > > In tableau [[ref:tab:numbers]] we can see... Yet, in > [[ref:tab:numbers][the same table]], ... > #+end_src > > the last sentence, in ascii, becomes: > > In tableau 2 we can see... Yet, in the same table, ... > > > Even if it's not a perfect replacement for "\ref{something}" commands, > it should be sufficient for all major back-ends to provide an > approximate functionality. And we gain interactivity in the Org buffer. > > What do you think? > > > Regards, >