From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [RFC][PATCH] Store links to named elements Date: Thu, 26 Mar 2015 21:34:15 +0100 Message-ID: <87h9t7lcqg.fsf@nicolasgoaziou.fr> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:57850) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YbESe-0006PY-03 for emacs-orgmode@gnu.org; Thu, 26 Mar 2015 16:33:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YbESa-0002PF-RT for emacs-orgmode@gnu.org; Thu, 26 Mar 2015 16:33:03 -0400 Received: from relay5-d.mail.gandi.net ([2001:4b98:c:538::197]:50500) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YbESa-0002O3-Ma for emacs-orgmode@gnu.org; Thu, 26 Mar 2015 16:33:00 -0400 In-Reply-To: (Jacob Gerlach's message of "Wed, 18 Mar 2015 10:19:31 -0400") 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: Jacob Gerlach Cc: Org-mode Hello, Jacob Gerlach writes: > In [1], storing links to named elements was discussed. AFAICT, no > patches came from that discussion. The current behavior is that given: > > * Headline > > #+Name: foo > > org-store-link will store a link to `*Headline' rather than `foo'. > > Attached is a very rough first attempt at patching org-store-link to > recognize and link to the name. > > Is this approach worth fleshing out or are there problems associated > with this type of link? Using the above example, [[foo]] seems to be a > valid link, recognized by both export and org-open-at-point. > > If doable, a couple of specific questions: > This attached patch makes no attempt to store the file name as > currently done for headlines. Would it be better to check for a name > in the headline linking code (the final "t" in the org-mode-p `cond' > in org-store-link) or rather reproduce file name code separately. The problem is that links to #+NAME are internal, i.e., they doesn't behave well when targeting a different document. Therefore, I'm not sure there's a real benefit from automating it. Links to headlines are much more robust. > Does a context string make sense for links to element names? No, it doesn't. Regards, -- Nicolas Goaziou