all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [Suggestion] add an API function for getting link description
@ 2020-05-20  9:44 stardiviner
  2020-05-20 13:56 ` Nicolas Goaziou
  0 siblings, 1 reply; 3+ messages in thread
From: stardiviner @ 2020-05-20  9:44 UTC (permalink / raw)
  To: Org Mode

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256


I found org link can't get link description easily.

I googled it how to get link description. Found this solution. But it's not intuitive.

#+begin_src emacs-lisp
(defun get-description-at-point ()
  (interactive)
  (let ((link (org-element-context)))
    (message "%s" (buffer-substring (org-element-property :contents-begin link)
                                    (org-element-property :contents-end link)))))
#+end_src

Why now support this?

#+begin_src emacs-lisp
(org-element-property :desc (org-element-context))
#+end_src

Maybe the key ~:desc~ could be more meaningful detailed.

WDYT? Nicolas

- -- 
[ stardiviner ]
       I try to make every word tell the meaning that I want to express.

       Blog: https://stardiviner.github.io/
       IRC(freenode): stardiviner, Matrix: stardiviner
       GPG: F09F650D7D674819892591401B5DF1C95AE89AC3
      
-----BEGIN PGP SIGNATURE-----

iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl7E++0UHG51bWJjaGls
ZEBnbWFpbC5jb20ACgkQG13xyVromsPYzAgAgpAgmgYJGvQME1T+cniWWAcfLDLh
tHNrV9vmfPdmtKtMQsLBACkmHysGBt4jsxZXPB96nhpK7vc0Vo7WPSUum7jW4M4q
GVC2bj9+gb/ZS4dYXnSHxzHTz62c5NRLHAj6jSuHow1cAtkuE/J5yT7M4ziECo4P
NnSuOZaBpHdAfWLFfkQYM4PG0Nrawfe+fy5BTqthXLchExtvMAD2tdgOrI4fxaIV
wfptEog/l6fzNfwpEW9XUUqaxqlFFPoN1GBVS3nPEuW/tInaOJgINL0giEN0ZSa6
P5czGgE9Zsdolw+v96rgqiInH3zRDFLDV8DiVrYxYig2wJ+xg0He2h6HNQ==
=44DQ
-----END PGP SIGNATURE-----


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-05-20 22:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-20  9:44 [Suggestion] add an API function for getting link description stardiviner
2020-05-20 13:56 ` Nicolas Goaziou
2020-05-20 22:49   ` stardiviner

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.