From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: jao Newsgroups: gmane.emacs.bugs Subject: bug#42483: 26.1: thing-at-point doesn't recognize org-link urls Date: Sat, 23 Jan 2021 19:42:15 +0000 Message-ID: <87eeiba19k.fsf@gnus.jao.io> References: <20200723033218.deuamgvc74zskyz4@E15-2016.optimum.net> <87czxwycll.fsf@gnus.org> <87wnw4oeaf.fsf@gnus.jao.io> <87r1mbtqg6.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="968"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 42483@debbugs.gnu.org To: "Lars Ingebrigtsen" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jan 23 20:43:31 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l3Ook-000093-Vd for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 23 Jan 2021 20:43:30 +0100 Original-Received: from localhost ([::1]:45174 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l3Ook-0003bA-04 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 23 Jan 2021 14:43:30 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59648) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l3OoI-0003aM-DC for bug-gnu-emacs@gnu.org; Sat, 23 Jan 2021 14:43:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52034) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l3OoI-0006an-09 for bug-gnu-emacs@gnu.org; Sat, 23 Jan 2021 14:43:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1l3OoH-0007ho-Ut for bug-gnu-emacs@gnu.org; Sat, 23 Jan 2021 14:43:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: jao Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 23 Jan 2021 19:43:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42483 X-GNU-PR-Package: emacs Original-Received: via spool by 42483-submit@debbugs.gnu.org id=B42483.161143097629606 (code B ref 42483); Sat, 23 Jan 2021 19:43:01 +0000 Original-Received: (at 42483) by debbugs.gnu.org; 23 Jan 2021 19:42:56 +0000 Original-Received: from localhost ([127.0.0.1]:35347 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l3OoB-0007hS-Uo for submit@debbugs.gnu.org; Sat, 23 Jan 2021 14:42:56 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:38134) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l3OoA-0007hD-5E for 42483@debbugs.gnu.org; Sat, 23 Jan 2021 14:42:54 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:47692) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l3Oo4-0006TJ-UF; Sat, 23 Jan 2021 14:42:48 -0500 Original-Received: from [89.44.201.166] (port=18964 helo=osgiliath.local) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.82) (envelope-from ) id 1l3Oo3-0000CS-Db; Sat, 23 Jan 2021 14:42:47 -0500 Original-Received: by osgiliath.local (Postfix, from userid 1000) id BD4AE402B8; Sat, 23 Jan 2021 19:42:15 +0000 (GMT) In-Reply-To: <87r1mbtqg6.fsf@gnus.org> (Lars Ingebrigtsen's message of "Sat, 23 Jan 2021 20:15:37 +0100") X-Attribution: jao X-Clacks-Overhead: GNU Terry Pratchett X-URL: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:198463 Archived-At: 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)