Re: Adding custom providers for thingatpt.el (was: [PATCH] Add support for 'thing-at-point' to get URL at point)

2024-05-20 Thread Jim Porter
On 5/20/2024 3:41 AM, Ihor Radchenko wrote: Jim Porter writes: + (when (boundp 'forward-thing-provider-alist) +(setq-local forward-thing-provider-alist +(cons '(url . org-next-link) + forward-thing-provider-alist))) According to the docstring,

Re: Adding custom providers for thingatpt.el (was: [PATCH] Add support for 'thing-at-point' to get URL at point)

2024-05-20 Thread Ihor Radchenko
Jim Porter writes: >> Ihor, I'll update the Org-mode part of this next and post the new patch >> for that to the Org list once it's ready. > > ... and here's the Org-mode patch for this. Thanks! > + (when (boundp 'forward-thing-provider-alist) > +(setq-local forward-thing-provider-alist

Re: Adding custom providers for thingatpt.el (was: [PATCH] Add support for 'thing-at-point' to get URL at point)

2024-05-19 Thread Jim Porter
On 5/19/2024 6:34 PM, Jim Porter wrote: On 5/18/2024 1:26 AM, Eli Zaretskii wrote: I think you can install this now. Thanks. Merged as ae9045a8bd8. Ihor, I'll update the Org-mode part of this next and post the new patch for that to the Org list once it's ready. ... and here's the Org-mode

Re: Adding custom providers for thingatpt.el (was: [PATCH] Add support for 'thing-at-point' to get URL at point)

2024-05-19 Thread Jim Porter
On 5/18/2024 1:26 AM, Eli Zaretskii wrote: I think you can install this now. Thanks. Merged as ae9045a8bd8. Ihor, I'll update the Org-mode part of this next and post the new patch for that to the Org list once it's ready.

Re: Adding custom providers for thingatpt.el (was: [PATCH] Add support for 'thing-at-point' to get URL at point)

2024-05-18 Thread Eli Zaretskii
> Date: Tue, 30 Apr 2024 11:27:04 -0700 > Cc: e...@gnu.org, emacs-de...@gnu.org, emacs-orgmode@gnu.org > From: Jim Porter > > On 4/30/2024 4:39 AM, Ihor Radchenko wrote: > > What happens if you have multiple providers for an URL? > > You add the provider to the end, so it will have the lower

Re: Re: [External] : Re: Adding custom providers for thingatpt.el (was: [PATCH] Add support for 'thing-at-point' to get URL at point)

2024-05-08 Thread Pedro Andres Aranda Gutierrez
H, Drew Hmmm... thanks for the clarification. That's going to be extremely helpful once I'm back on track after the "grading season" ;-) All this started, at least for me, when I was trying to write a simple interactive function to copy the contents of the cell the point is in to the kill-ring

Re: [External] : Re: Adding custom providers for thingatpt.el (was: [PATCH] Add support for 'thing-at-point' to get URL at point)

2024-05-07 Thread Eli Zaretskii
> Date: Tue, 7 May 2024 09:10:59 -0700 > Cc: yanta...@posteo.net, emacs-de...@gnu.org, emacs-orgmode@gnu.org > From: Jim Porter > > On 5/7/2024 5:20 AM, Eli Zaretskii wrote: > > I disagree. These functions are nowadays the basis of many > > interactive features, and users are usually mightily

Re: [External] : Re: Adding custom providers for thingatpt.el (was: [PATCH] Add support for 'thing-at-point' to get URL at point)

2024-05-07 Thread Jim Porter
On 5/7/2024 5:20 AM, Eli Zaretskii wrote: I disagree. These functions are nowadays the basis of many interactive features, and users are usually mightily confused by the fine print of what "at point" means technically in Emacs. The current operation is much easier for users to grasp mentally

RE: [External] : Re: Adding custom providers for thingatpt.el (was: [PATCH] Add support for 'thing-at-point' to get URL at point)

2024-05-07 Thread Drew Adams
> > I hear you. The behavior should be changed so > > that, in general, bounds-of-thing-at-point etc. > > return nil when there is _no thing at point_, > > including when point is after, including just > > after, a thing but not on such a thing. > > > > There can be commands (and noncommand fns)

Re: [External] : Re: Adding custom providers for thingatpt.el (was: [PATCH] Add support for 'thing-at-point' to get URL at point)

2024-05-07 Thread Eli Zaretskii
> From: Drew Adams > CC: "e...@gnu.org" , > "emacs-de...@gnu.org" > , > "emacs-orgmode@gnu.org" > Date: Tue, 7 May 2024 01:52:13 + > > I hear you. The behavior should be changed so > that, in general, bounds-of-thing-at-point etc. > return nil when there is _no thing

RE: RE: [External] : Re: Adding custom providers for thingatpt.el (was: [PATCH] Add support for 'thing-at-point' to get URL at point)

2024-05-06 Thread Drew Adams
Thanks for your reply, Jim. > On 4/30/2024 2:10 PM, Drew Adams wrote: > >> I've also fixed a bug in EWW and bug-reference-mode > >> where it would return nil for (thing-at-point 'url) > >> if point was at the *end* of a URL. > > > > By "at the end" I assume you really mean just > > _after_ a URL,

Re: RE: [External] : Re: Adding custom providers for thingatpt.el (was: [PATCH] Add support for 'thing-at-point' to get URL at point)

2024-05-06 Thread Jim Porter
On 4/30/2024 2:10 PM, Drew Adams wrote: I've also fixed a bug in EWW and bug-reference-mode where it would return nil for (thing-at-point 'url) if point was at the *end* of a URL. By "at the end" I assume you really mean just _after_ a URL, i.e., no longer on/at the URL. FWIW, that's actually

RE: [External] : Re: Adding custom providers for thingatpt.el (was: [PATCH] Add support for 'thing-at-point' to get URL at point)

2024-04-30 Thread Drew Adams
> I've also fixed a bug in EWW and bug-reference-mode > where it would return nil for (thing-at-point 'url) > if point was at the *end* of a URL. By "at the end" I assume you really mean just _after_ a URL, i.e., no longer on/at the URL. FWIW, that's actually _superior_ behavior. Unfortunately

Re: Adding custom providers for thingatpt.el (was: [PATCH] Add support for 'thing-at-point' to get URL at point)

2024-04-30 Thread Jim Porter
On 4/30/2024 4:39 AM, Ihor Radchenko wrote: What happens if you have multiple providers for an URL? You add the provider to the end, so it will have the lower priority in this scenario. I guess that you want the opposite - EWW provider to take precedence. Same for other changes. That's

Re: Adding custom providers for thingatpt.el (was: [PATCH] Add support for 'thing-at-point' to get URL at point)

2024-04-30 Thread Ihor Radchenko
Jim Porter writes: > + (setq-local bounds-of-thing-at-point-provider-alist > + (append bounds-of-thing-at-point-provider-alist > + '((url . eww--bounds-of-url-at-point > + (setq-local forward-thing-provider-alist > + (append

Re: Adding custom providers for thingatpt.el (was: [PATCH] Add support for 'thing-at-point' to get URL at point)

2024-04-29 Thread Jim Porter
On 4/29/2024 11:14 AM, Ihor Radchenko wrote: Thanks! I have a small comment on the docstring of `forward-thing-provider-alist' - it refers to `thing-at-point-provider-alist', but the provides here are called with an argument N, unlike the providers in `thing-at-point-provider-alist'. Fixed.

Re: Adding custom providers for thingatpt.el (was: [PATCH] Add support for 'thing-at-point' to get URL at point)

2024-04-29 Thread Ihor Radchenko
Jim Porter writes: > Ihor, Eli: What do you think of the attached patch? I added variables to > let modes define custom providers for 'bounds-of-thing-at-point' and > 'forward-thing'. (Notably, I avoided adding vars for the > 'beginning-of-thing' and 'end-of-thing' functions, since those just

Re: Adding custom providers for thingatpt.el (was: [PATCH] Add support for 'thing-at-point' to get URL at point)

2024-04-28 Thread Jim Porter
On 4/12/2024 3:30 PM, Jim Porter wrote: On 4/12/2024 5:41 AM, Ihor Radchenko wrote: Jim Porter writes: That sounds reasonable enough to me; does anyone else have opinions on this? Otherwise, I'll get to work on a patch (though probably not for a couple weeks). It has been a while since the

Re: Adding custom providers for thingatpt.el (was: [PATCH] Add support for 'thing-at-point' to get URL at point)

2024-04-12 Thread Jim Porter
On 4/12/2024 5:41 AM, Ihor Radchenko wrote: Jim Porter writes: That sounds reasonable enough to me; does anyone else have opinions on this? Otherwise, I'll get to work on a patch (though probably not for a couple weeks). It has been a while since the last message in this thread. Jim, may I

Re: Adding custom providers for thingatpt.el (was: [PATCH] Add support for 'thing-at-point' to get URL at point)

2024-04-12 Thread Ihor Radchenko
Jim Porter writes: > On 2/5/2024 7:07 AM, Ihor Radchenko wrote: >> It would make sense to add a number of alists: >> - bounds-of-thing-at-point-provider-alist >> - same for 'forward-op, 'beginning-op, 'end-op. >> >> After Emacs have those, we can add Org mode support. > > That sounds reasonable

Re: Adding custom providers for thingatpt.el (was: [PATCH] Add support for 'thing-at-point' to get URL at point)

2024-02-06 Thread Eli Zaretskii
> From: Ihor Radchenko > Cc: jporterb...@gmail.com, stefankan...@gmail.com, emacs-de...@gnu.org, > emacs-orgmode@gnu.org > Date: Tue, 06 Feb 2024 12:38:19 + > > Eli Zaretskii writes: > > > I think we do want to allow extending of this, but doesn't > > thingatpt.el already provide such

Re: Adding custom providers for thingatpt.el (was: [PATCH] Add support for 'thing-at-point' to get URL at point)

2024-02-06 Thread Ihor Radchenko
Eli Zaretskii writes: > I think we do want to allow extending of this, but doesn't > thingatpt.el already provide such capabilities? For example, I see > this in bounds-of-thing-at-point: > ... > (cond > ((get thing 'bounds-of-thing-at-point) > (funcall

Re: Adding custom providers for thingatpt.el (was: [PATCH] Add support for 'thing-at-point' to get URL at point)

2024-02-06 Thread Eli Zaretskii
> From: Ihor Radchenko > Cc: emacs-de...@gnu.org, emacs-orgmode@gnu.org > Date: Mon, 05 Feb 2024 22:56:05 + > > Jim Porter writes: > > > On 2/5/2024 7:07 AM, Ihor Radchenko wrote: > >> It would make sense to add a number of alists: > >> - bounds-of-thing-at-point-provider-alist > >> - same

Re: Adding custom providers for thingatpt.el (was: [PATCH] Add support for 'thing-at-point' to get URL at point)

2024-02-05 Thread Ihor Radchenko
Jim Porter writes: > On 2/5/2024 7:07 AM, Ihor Radchenko wrote: >> It would make sense to add a number of alists: >> - bounds-of-thing-at-point-provider-alist >> - same for 'forward-op, 'beginning-op, 'end-op. >> >> After Emacs have those, we can add Org mode support. > > That sounds reasonable

Re: Adding custom providers for thingatpt.el (was: [PATCH] Add support for 'thing-at-point' to get URL at point)

2024-02-05 Thread Jim Porter
On 2/5/2024 7:07 AM, Ihor Radchenko wrote: It would make sense to add a number of alists: - bounds-of-thing-at-point-provider-alist - same for 'forward-op, 'beginning-op, 'end-op. After Emacs have those, we can add Org mode support. That sounds reasonable enough to me; does anyone else have

Re: Adding custom providers for thingatpt.el (was: [PATCH] Add support for 'thing-at-point' to get URL at point)

2024-02-05 Thread Ihor Radchenko
Jim Porter writes: >> Looking into the source code of `bounds-of-thing-at-point', I see that >> for standard "things" (like url), >> `thing-at-point-bounds-of-url-at-point' is used unconditionally. In the >> case of Org links, we may have something like [[https://orgmode.org]] >> that will not

Re: Adding custom providers for thingatpt.el (was: [PATCH] Add support for 'thing-at-point' to get URL at point)

2023-11-06 Thread Jim Porter
On 11/6/2023 12:11 PM, Ihor Radchenko wrote: [ Branching to emacs-devel for further input from Emacs devs ] Jim Porter writes: This is similar to Emacs bug#66752[1]. It would be nice if "(thing-at-point 'url)" would return the URL when point is over an Org link. With this, it's easier to

Adding custom providers for thingatpt.el (was: [PATCH] Add support for 'thing-at-point' to get URL at point)

2023-11-06 Thread Ihor Radchenko
[ Branching to emacs-devel for further input from Emacs devs ] Jim Porter writes: > This is similar to Emacs bug#66752[1]. It would be nice if > "(thing-at-point 'url)" would return the URL when point is over an Org > link. With this, it's easier to write a function that copies (or browses >