From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jacob Gerlach Subject: [RFC][PATCH] Store links to named elements Date: Wed, 18 Mar 2015 10:19:31 -0400 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=001a114662a49f7612051190c5f3 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:51143) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YYEot-000698-4V for emacs-orgmode@gnu.org; Wed, 18 Mar 2015 10:19:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YYEom-0007Gs-Rg for emacs-orgmode@gnu.org; Wed, 18 Mar 2015 10:19:39 -0400 Received: from mail-qc0-x234.google.com ([2607:f8b0:400d:c01::234]:35453) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YYEom-0007FC-MM for emacs-orgmode@gnu.org; Wed, 18 Mar 2015 10:19:32 -0400 Received: by qcbkw5 with SMTP id kw5so39065137qcb.2 for ; Wed, 18 Mar 2015 07:19:32 -0700 (PDT) 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 --001a114662a49f7612051190c5f3 Content-Type: text/plain; charset=UTF-8 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. Does a context string make sense for links to element names? Regards, Jake [1] http://permalink.gmane.org/gmane.emacs.orgmode/91935 --001a114662a49f7612051190c5f3 Content-Type: text/x-patch; charset=US-ASCII; name="0001-Add-support-to-link-to-named-elements.patch" Content-Disposition: attachment; filename="0001-Add-support-to-link-to-named-elements.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_i7etewdr0 RnJvbSBmMTE2NmQzMGNjYWJkYjIwOGIwMjYzZDg3ZmQ5MzY2ZmE5YTJmMzI1IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBKYWNvYiBHZXJsYWNoIDxqYWNvYmdlcmxhY2hAZ21haWwuY29t PgpEYXRlOiBXZWQsIDE4IE1hciAyMDE1IDA5OjU4OjAwIC0wNDAwClN1YmplY3Q6IFtQQVRDSF0g QWRkIHN1cHBvcnQgdG8gbGluayB0byBuYW1lZCBlbGVtZW50cwoKKiBsaXNwL29yZy5lbCAob3Jn LXN0b3JlLWxpbmspOiBTdG9yZSBsaW5rcyB0byBuYW1lZCBlbGVtZW50cy4KCkJlZm9yZSBmYWxs aW5nIGJhY2sgdG8gdGhlIGN1cnJlbnQgaGVhZGxpbmUsIGNoZWNrIGlmIHBvaW50IGlzIGF0IGEK bmFtZWQgZWxlbWVudCwgYW5kIGlmIHNvIHN0b3JlIHRoZSBlbGVtZW50IG5hbWUgYXMgdGhlIGxp bmsuCgpUSU5ZQ0hBTkdFCi0tLQogbGlzcC9vcmcuZWwgfCA1ICsrKysrCiAxIGZpbGUgY2hhbmdl ZCwgNSBpbnNlcnRpb25zKCspCgpkaWZmIC0tZ2l0IGEvbGlzcC9vcmcuZWwgYi9saXNwL29yZy5l bAppbmRleCBiMTk5OWRjLi4wYTM3YTJmIDEwMDc1NQotLS0gYS9saXNwL29yZy5lbAorKysgYi9s aXNwL29yZy5lbApAQCAtOTgzOCw2ICs5ODM4LDExIEBAIGFjdGl2ZSByZWdpb24uIgogCQkJIChj b25jYXQgImZpbGU6IgogCQkJCSAoYWJicmV2aWF0ZS1maWxlLW5hbWUKIAkJCQkgI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