> From: Ihor Radchenko <yanta...@posteo.net>
> Cc: jporterb...@gmail.com, stefankan...@gmail.com, emacs-de...@gnu.org,
>  emacs-orgmode@gnu.org
> Date: Tue, 06 Feb 2024 12:38:19 +0000
> 
> Eli Zaretskii <e...@gnu.org> 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 (get thing 'bounds-of-thing-at-point)))
> >
> > Doesn't this provide the extension capabilities you are looking for?
> > If not, why not?
> 
> Unlike `thing-at-point-provider-alist', which can be buffer-local,
> symbol property is always global and setting it would override other
> thing providers.
> 
> Note how `thing-at-point' uses
> 
> (cond
>           ((let ((alist thing-at-point-provider-alist)
>                  elt result)
>              (while (and alist (null result))
>                (setq elt (car alist)
>                      alist (cdr alist))
>                (and (eq (car elt) thing)
>                     (setq result (funcall (cdr elt)))))
>              result))
>           ((get thing 'thing-at-point)
>            (funcall (get thing 'thing-at-point)))
> 
> checking `thing-at-point-provider-alist' and only then falling back to
> `get'. What I am proposing is to add the equivalent alists for other
> operators used by thingatpt.el.

I guess it's fine, then.

But we probably should have such alists in all the other thingatpt
methods as well.

Reply via email to