From: jao <jao@gnu.org>
To: "Lars Ingebrigtsen" <larsi@gnus.org>
Cc: 42483@debbugs.gnu.org
Subject: bug#42483: 26.1: thing-at-point doesn't recognize org-link urls
Date: Sat, 23 Jan 2021 19:42:15 +0000 [thread overview]
Message-ID: <87eeiba19k.fsf@gnus.jao.io> (raw)
In-Reply-To: <87r1mbtqg6.fsf@gnus.org> (Lars Ingebrigtsen's message of "Sat, 23 Jan 2021 20:15:37 +0100")
On Sat, Jan 23 2021, Lars Ingebrigtsen wrote:
>> A strategy i've seen elsewhere (in the embark package) for something
>> similar is to keep a list of "target finders" that are applied in turn,
>> until one succeeds returning, say, '(url . "http://foo/bar"). That's
>> essentially what you're suggesting above, except that one can write
>> global detectors (the list is not (necessarily) buffer local)
>
> Yup. Adding this sort of framework to thingatpt looks pretty trivial,
> and sounds generally useful, so I'll take a stab at it (using eww as the
> first test case).
Excelent, thanks a lot. I am not sure whether thing-at-point already
has that, but it'd then be useful to be able to retrieve, together with
the thing-at-point, its category (and even also have a thing/s/-at-point
returning all detected things).
With that metadata available, there's a just a very easy step to have
"actions at point": one could associate to each possible thing at point
type a keymap, and then have a command that retrieves the thing at point
and, for instance, activates that keymap. Or associate a function
taking the thing at point and doing whatever one wishes.
(For instance, i have a video-url-at-point detector which looks for urls
that are from a video streaming platform, and associate to it actions
that let me play it with vlc or mpv, besides opening them in emacs-w3m,
ewww or firefox, as with other url).
I'm again stealing from embark's ideas, but for a really concise yet
already very useful take on this kind of "do-at-point" functionality,
see https://github.com/jyp/dap (GPL3, just around 200 loc).
Cheers,
jao
--
Don't be yourself. Be someone a little nicer.
-Mignon McLaughlin, journalist and author (1913-1983)
next prev parent reply other threads:[~2021-01-23 19:42 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87eeiba19k.fsf@gnus.jao.io \
--to=jao@gnu.org \
--cc=42483@debbugs.gnu.org \
--cc=larsi@gnus.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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
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).