]> git.eshelyaron.com Git - emacs.git/commit
Improve implementation of 'forward-thing' using custom providers
authorJim Porter <jporterbugs@gmail.com>
Mon, 20 May 2024 19:37:22 +0000 (12:37 -0700)
committerEshel Yaron <me@eshelyaron.com>
Thu, 23 May 2024 08:28:45 +0000 (10:28 +0200)
commite7d67179dc979d09aadf514969817ae719f9ea26
tree459b8d6d1bf65968b461804211835bcf0d139700
parent662f8c6d5c74834d0010d858c7afc50a351810dd
Improve implementation of 'forward-thing' using custom providers

Now, call all the custom providers for each step, using the provider
that moves point the smallest non-zero amount.  This allows multiple
providers for a given "thing" to work nicely together.

* lisp/thingatpt.el (forward-thing-provider-alist): Update docstring.
(forward-thing): New implementation to call each provider N times.
(forward-thing-for-text-property): Take BACKWARD instead of N.  Update
callers.

* test/lisp/thingatpt-tests.el (thing-at-point-providers)
(forward-thing-providers): Add more checks.
(consecutive-things-at-point): New test.

(cherry picked from commit f6c60f16a231802104f53f3953b7fdc363944316)
lisp/net/eww.el
lisp/progmodes/bug-reference.el
lisp/thingatpt.el
test/lisp/thingatpt-tests.el