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

From: Eli Zaretskii <[email-masked]>
Date: Wed, 09 Nov 2016 17:45:08 +0200

> Cc: [email-masked], [email-masked]
> From: Dmitry Gutov <[email-masked]>
> Date: Wed, 9 Nov 2016 02:04:20 +0200
> 
> On 08.11.2016 17:05, Eli Zaretskii wrote:
> 
> > But then somehow the discussion shifted to be about whether to _force_
> > thing-at-point value to be a string, even if it isn't for some reason.
> 
> I'd suggest trying to fix that from the other end, as one alternative. 
> If we agree that the return value of thing-at-point should be a string, 
> (get 'number 'thing-at-point) can't return `number-at-point', it should 
> return a function that will return the said number as a string.
> 
> And of all things enumerated in thing-at-point's docstring, IIUC only 
> number has such problem. Which leaves third-party things, but, they will 
> either need to be fixed, or people will have to remain content not to 
> use thing-at-point with NO-PROPERTIES argument on them.

I don't think I understand what you are suggesting.  Can you show a
proposed patch, so I could see the light?

> > If
> > there is such code, why would we want to break it?  To what end?  And
> > if no code uses this loophole, why do we care that it exists?
> 
> To make thing-at-point behavior more consistent.

It is consistent now.  The only way to make it inconsistent is to have
a 'thing-at-point' property that violates that, but we never do that
in Emacs proper, so if someone else does that, it would be their bug.

> > IOW, thing-at-point no longer has any known bugs, and we are talking
> > about forcibly breaking a use case that does no harm to us, and can
> > only happen if someone abuses the 'thing-at-point' property, which
> > would make it that someone's bug/misfeature, for them to fix.
> 
> Yes. The fix is very easy, though, for projects that retain at least 
> somewhat active maintainer.

I might agree when I see a concrete proposal.

Thanks.