[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 01:30:20 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:50.0) Gecko/20100101 Thunderbird/50.0 |
On 09.11.2016 17:45, Eli Zaretskii wrote:
I don't think I understand what you are suggesting. Can you show a
proposed patch, so I could see the light?
See the attached patch.
Or to take a step further, we might want to deprecate the
`thing-at-point' property, and recommend to only use the
`bounds-of-thing-at-point' property. This way, we get the string-ness
guarantee automatically, and the bounds-of-thing-at-point function will
work for all things (it currently fails for `number').
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.
Put point on a number. Number is a sexp. Not all sexps are strings.
(thing-at-point 'number) => 123
(thing-at-point 'sexp) => "123"
That doesn't looks consistent to me. And there's no way to guess the
return value type in advance without knowing which exact function is the
thing's `thing-at-point' property.
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.
number's `thing-at-point' property is not like the others.
thingatpt-number.diff
Description: Text Data
- bug#21391: 24.5; `thing-at-point' should return a string, (continued)
- bug#21391: 24.5; `thing-at-point' should return a string, Eli Zaretskii, 2016/11/07
- bug#21391: 24.5; `thing-at-point' should return a string, Dmitry Gutov, 2016/11/07
- bug#21391: 24.5; `thing-at-point' should return a string, Eli Zaretskii, 2016/11/07
- bug#21391: 24.5; `thing-at-point' should return a string, Dmitry Gutov, 2016/11/07
- bug#21391: 24.5; `thing-at-point' should return a string, Tino Calancha, 2016/11/08
- bug#21391: 24.5; `thing-at-point' should return a string, Eli Zaretskii, 2016/11/08
- bug#21391: 24.5; `thing-at-point' should return a string, Drew Adams, 2016/11/08
- bug#21391: 24.5; `thing-at-point' should return a string, Dmitry Gutov, 2016/11/08
- bug#21391: 24.5; `thing-at-point' should return a string, Andreas Röhler, 2016/11/09
- bug#21391: 24.5; `thing-at-point' should return a string, Eli Zaretskii, 2016/11/09
- bug#21391: 24.5; `thing-at-point' should return a string,
Dmitry Gutov <=
- bug#21391: 24.5; `thing-at-point' should return a string, Eli Zaretskii, 2016/11/10
- bug#21391: 24.5; `thing-at-point' should return a string, Dmitry Gutov, 2016/11/10
- bug#21391: 24.5; `thing-at-point' should return a string, Eli Zaretskii, 2016/11/10
- bug#21391: 24.5; `thing-at-point' should return a string, Dmitry Gutov, 2016/11/10
- bug#21391: 24.5; `thing-at-point' should return a string, Eli Zaretskii, 2016/11/10
- bug#21391: 24.5; `thing-at-point' should return a string, Dmitry Gutov, 2016/11/10
- bug#21391: 24.5; `thing-at-point' should return a string, Eli Zaretskii, 2016/11/10
- bug#21391: 24.5; `thing-at-point' should return a string, Dmitry Gutov, 2016/11/10
- bug#21391: 24.5; `thing-at-point' should return a string, Tino Calancha, 2016/11/11
- bug#21391: 24.5; `thing-at-point' should return a string, Eli Zaretskii, 2016/11/11