From: Rodrigo Morales <firstname.lastname@example.org>
Subject: [Q] How to programmatically get the description of a link?
Date: Fri, 13 Aug 2021 18:10:47 -0500 [thread overview]
Message-ID: <email@example.com> (raw)
* The question
Let's say I have the following link
This is a sentence [[foo][bar]]. This is another sentence.
How to programmatically get the description of the link (i.e. =bar=)?
* Additional information
I've tried using =org-element-context=. The following sexp was
executed when the cursor was on the link which was presented above.
ELISP> (with-current-buffer "main.org" (org-element-context))
(:type "fuzzy" :path "foo" :format bracket :raw-link "foo" :application nil :search-option nil :begin 1 :end 15 :contents-begin 8 :contents-end 13 :post-blank 0 :parent
(:begin 1 :end 16 :contents-begin 1 :contents-end 16 :post-blank 0 :post-affiliated 1 :parent nil))))
and =org-element-at-point=. The following sexp was executed when the
cursor was on the link which was presented above.
ELISP> (with-current-buffer "main.org" (org-element-at-point))
(:begin 1 :end 16 :contents-begin 1 :contents-end 16 :post-blank 0 :post-affiliated 1 :parent nil))
but neither of those get the description of the link as metadata.
next reply other threads:[~2021-08-13 23:12 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-13 23:10 Rodrigo Morales [this message]
2021-08-14 0:04 ` [Q] How to programmatically get the description of a link? John Kitchin
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).