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. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at <https://orgmode.org/>. Support Org development at <https://liberapay.com/org-mode>, or support my work at <https://liberapay.com/yantar92>