From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alan Schmitt Subject: Re: fetching the description from a link string Date: Tue, 17 Nov 2015 15:58:38 +0100 Message-ID: References: <87h9kmb7lm.fsf@gmx.us> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:56354) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZyhiY-0001QI-L3 for emacs-orgmode@gnu.org; Tue, 17 Nov 2015 09:58:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZyhiS-00021w-UC for emacs-orgmode@gnu.org; Tue, 17 Nov 2015 09:58:46 -0500 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:42753) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZyhiS-00021s-Nu for emacs-orgmode@gnu.org; Tue, 17 Nov 2015 09:58:40 -0500 In-Reply-To: <87h9kmb7lm.fsf@gmx.us> (rasmus@gmx.us's message of "Mon, 16 Nov 2015 10:45:41 +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: Rasmus Cc: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2015-11-16 10:45, Rasmus writes: > Alan Schmitt writes: > >> Hello, >> >> I cannot seem to find in org.el a function that will return the >> description part of a link. I'm probably missing it =E2=80=A6 Could some= one tell >> me if such a function exists? > > org-element-context on a link will give you what you want. It lives in > org-element, though. > > Something like this when point is on a link, > > (let ((e (org-element-context))) > (buffer-substring-no-properties > (org-element-property :contents-begin e) > (org-element-property :contents-end e))) Thank you for the suggestion. I'm already doing something similar: #+begin_src emacs-lisp (let ((link (org-store-link nil)) (name (org-element-property :raw-value (org-element-at-point)))) ...) #+end_src For some reason I was under the impression that org-element might be overkill for this, but it works well. Thanks again, Alan =2D-=20 OpenPGP Key ID : 040D0A3B4ED2E5C7 Athmospheric CO=E2=82=82 (Updated November 9, 2015, Mauna Loa Obs.): 399.06= ppm --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBCgAGBQJWS0CeAAoJEAQNCjtO0uXH9z0H/igakNQQDr20QEr+X9LzFoGj kSarY9qYLDDI7lnGxUgjlHF6sl59iWTXO9pvp2JiEWmNKlGnFEKTsboiO3DK+8LE RtpNihuR0aYQbjM6kmU7gkdKQuoWhPVZZGwvvyoWXB9w4noyPWnE+9ZGaJJ1rT49 oitSLffGerqvyEVO7AG6Qa/am4J8Kqal56qFwWe7kRMryXsMZdI4Byt9PdbCP1VL l3PnNw+zUczR3kGqWuqcMd13o/3dBBTDDt6rWRTj401ARP06LQqrnq/XrTehhWqU wg1uPDU/D8FkOPnBobCveZZzn6Sh/PWJ7/70d9nR/jYaWauzQiUcsyn1yqqZbtQ= =F+3q -----END PGP SIGNATURE----- --=-=-=--