bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#21391: 24.5; `thing-at-point' should return a string


From: Dmitry Gutov
Subject: bug#21391: 24.5; `thing-at-point' should return a string
Date: Thu, 10 Nov 2016 10:55:47 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:50.0) Gecko/20100101 Thunderbird/50.0

On 10.11.2016 02:40, Drew Adams wrote:

What do YOU think is the point of putting property `thing-at-point'
on a THING type?

Being lazy or unable to make up your mind. Or maybe some kind of micro-optimization.

You will see things like this in thingatpt.el:

(put 'url 'thing-at-point 'thing-at-point-url-at-point)

(put 'email 'thing-at-point
     (lambda ()
       (let ((boundary-pair (bounds-of-thing-at-point 'email)))
         (if boundary-pair
             (buffer-substring-no-properties
              (car boundary-pair) (cdr boundary-pair))))))

Try removing these two in your local Emacs, save and restart (maybe do a rebuild as well, to be sure).

(thing-at-point 'url) and (thing-at-point 'email) will continue to work fine.

(put 'number 'thing-at-point 'number-at-point)

And that's only a few predefined uses of it.  One of the main
points of the library is to provide tools that you can use to
define your functions that implement providing a THING at point.

Search my messages for the word "third-party".





reply via email to

[Prev in Thread] Current Thread [Next in Thread]