all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Boruch Baum <boruch_baum@gmx.com>
To: 42483@debbugs.gnu.org
Subject: bug#42483: 26.1: thing-at-point doesn't recognize org-link urls
Date: Wed, 22 Jul 2020 23:32:18 -0400	[thread overview]
Message-ID: <20200723033218.deuamgvc74zskyz4@E15-2016.optimum.net> (raw)

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





             reply	other threads:[~2020-07-23  3:32 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-23  3:32 Boruch Baum [this message]
2021-01-22 19:51 ` bug#42483: 26.1: thing-at-point doesn't recognize org-link urls 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

Reply instructions:

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200723033218.deuamgvc74zskyz4@E15-2016.optimum.net \
    --to=boruch_baum@gmx.com \
    --cc=42483@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* 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 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.