all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#42483: 26.1: thing-at-point doesn't recognize org-link urls
@ 2020-07-23  3:32 Boruch Baum
  2021-01-22 19:51 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 11+ messages in thread
From: Boruch Baum @ 2020-07-23  3:32 UTC (permalink / raw)
  To: 42483

One of the features of function `thing-at-point' is recognition of urls,
so I expected it to be able to recognize org-link urls, but that isn't
the case. Here's an example that when yanked into an org-mode buffer
will display the underlined text 'SageMathCell', and when performing `C-c
C-o' (M-x org-open-at-point) will correctly open the url link. However,
`(thing-at-point 'url)' and `(thing-at-point-url-at-point)' evaluate to
NIL.

   [[https://sagecell.sagemath.org/][SageMathCell]]

I was expecting function `thing-at-point-url-at-point' to check if the
mode was org-mode, and if so, to try something like the following

(defun shamelessly-plagiarized-from-org-open-at-point ()
  (interactive)
      (let* ((context
	      (org-element-lineage
	        (org-element-context) '(link) t))
	     (value (org-element-property :value context))
	     (type (org-element-property :type context))
	     (path (org-link-unescape (org-element-property :path context))))
  (message (concat type ":" path))))

--
hkp://keys.gnupg.net
CA45 09B5 5351 7C11 A9D1  7286 0036 9E45 1595 8BC0





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

end of thread, other threads:[~2022-06-06 13:12 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-07-23  3:32 bug#42483: 26.1: thing-at-point doesn't recognize org-link urls Boruch Baum
2021-01-22 19:51 ` Lars Ingebrigtsen
2021-01-22 21:24   ` Jose A. Ortega Ruiz
2021-01-23 19:15     ` Lars Ingebrigtsen
2021-01-23 19:40       ` Lars Ingebrigtsen
2022-05-09 11:41         ` Lars Ingebrigtsen
2022-06-06 13:12           ` Lars Ingebrigtsen
2021-01-23 19:42       ` jao
2021-01-25 23:51         ` Lars Ingebrigtsen
2021-01-26  0:29           ` jao
2021-01-27  1:36             ` Lars Ingebrigtsen

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.