GNU bug report logs -
#21391
24.5; `thing-at-point' returns error when called with arguments 'number t
Previous Next
Reported by: Tino Calancha <f92capac <at> gmail.com>
Date: Tue, 1 Sep 2015 01:57:01 UTC
Severity: minor
Found in version 24.5
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
On 14.11.2016 16:19, Drew Adams wrote:
>> Look at the start of thing-at-point implementation:
>>
>> if (get thing 'thing-at-point)
>> (funcall (get thing 'thing-at-point))
>>
>> AFAIU an arbitrary function might be stored here, no real
>> relation to thing-at-point at all.
> ANY time you use a function as a parameter (passed as an
> argument, obtained as the value of a variable, or picked up
> in some other way, such as here) there is little or no control
> over the nature of that function in the function that makes
> use of it. It is up to the code that provides the function
> to provide an appropriate function (DTRT).
>
>> Next clause deals with buffer-substring - which is
>> thing-at-point about in my understanding.
> Your understanding is partial, then. Thing-at-point has
> been, from the outset, about actual Lisp THINGS, not just
> strings that name such things. Yes, string-naming-a-thing
> is a common use case - the most common, currently. But it
> is only part of the story.
>
> And yes, buffer text is usually examined to come up with
> the returned THING. But the buffer text need not be
> examined. What is most significant is point - the buffer
> position. And even that could be ignored by the function
> that comes up with an appropriate THING to return.
>
> thingatpt.el is much more general, and offers many more
> possibilities, than just grabbing some text at or near
> point.
Agreed so far, understand that.
My point is to suggest a restriction here, making the use easier.
If a symbol might return an arbitrary thing doing arbitrary actions, why
it should reside in this library?
Beside this - upholding that in the core, a string is the result in any
case first.
Follows functions which operate on this string, derive from its
representation a number, intern it or whatever.
For clarification IMO it would be better to separate these use-cases
from the core-thing.
These use-cases are plain operations on strings, nothing special to
thing-at-point.
This bug report was last modified 4 years and 329 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.