|
From: | Jim Porter |
Subject: | Re: RE: [External] : Re: Adding custom providers for thingatpt.el (was: [PATCH] Add support for 'thing-at-point' to get URL at point) |
Date: | Mon, 6 May 2024 18:08:06 -0700 |
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 _superior_ behavior. Unfortunately however, Emacs has chosen the behavior you describe here:It's now consistent with how 'thing-at-point' works by default.(If you have two consecutive URLs and point is between them...it'll prefer the second one.)Which is better! It's what "at point" means.
[snip]
See bug #9300, " `bounds-of-thing-at-point' does not return nil when just after THING".
I agree overall that your proposed behavior is more correct, and it's probably how I'd have implemented 'thing-at-point' if I were doing it from scratch. However, I think an even worse outcome than "thing-at-point looks at point or before-point" is "sometimes thing-at-point just looks at point, and other times it looks at point or before-point" (which is what it does today).
I'd even be open to something like a 'thing-at-point-is-strict' defvar that people could let-bind as wanted, but I'm not going to *argue* for that myself.
Ultimately though, this patch is really just about providing the necessary defcustoms for org-mode to be able to use 'thing-at-point' (and for Ihor to feel ok about it ;)). Changing 'thing-at-point's behavior should probably be handled separately, especially since there'd be an uphill battle to revisit the decision in bug#9300.
[Prev in Thread] | Current Thread | [Next in Thread] |