GNU bug report logs - #24627
24.5; (thing-at-point 'list) may return a non-empty string without a list

Previous Next

Package: emacs;

Reported by: Tino Calancha <tino.calancha <at> gmail.com>

Date: Thu, 6 Oct 2016 09:45:02 UTC

Severity: normal

Tags: confirmed

Merged with 13955

Found in versions 24.5, 25.0.94

Fixed in version 26.1

Done: Tino Calancha <tino.calancha <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #56 received at 24627 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Röhler <andreas.roehler <at> easy-emacs.de>
To: Tino Calancha <tino.calancha <at> gmail.com>
Cc: 24627 <at> debbugs.gnu.org
Subject: Re: bug#24627: 24.5; (thing-at-point 'list) may return a non-empty
 string without a list
Date: Sat, 15 Oct 2016 12:26:11 +0200

On 15.10.2016 11:44, Tino Calancha wrote:
> Andreas Röhler <andreas.roehler <at> easy-emacs.de> writes:
>
>> On 13.10.2016 10:50, Tino Calancha wrote:
>>> Andreas Röhler <andreas.roehler <at> easy-emacs.de> writes:
>>>
>>>> beg still needs a check like
>>>>
>>>> (not (nth 8 (parse-partial-sexp (point-min) (point))))
>>>>
>>>> otherwise it could match inside a string or comment
>>> I have the feeling that this should return the local list
>>> at point, even if inside a string or comment.
>> Yes, but that would be reported by pps. However, when point is at
>> opening delimiter, this is not recognised by pps. Then we must be sure
>> not being inside a string or comment, where an opening delimiter is
>> meaningless, i.e. just a literal.
>>
>> IMO all needed is  something like
>>
>> (beg (or (nth 1 (parse-partial-sexp...))
>>
>>           (and (eq 4 (car (syntax-after (point))))
>>                (not (nth 8 (parse-partial-sexp...))
>>                (point)))))
>>       
>>
>> Should both fail, there is not list at point.
> Thank you.  I think i got what you mean.
> I need to invert the order of the above `or':
> (nth 1 (parse-partial-sexp...))
> need to appear the second.  Otherwise,
> (with-temp-buffer
>    (insert "(foo (a b) bar)")
>    (goto-char 6)
>    (list-at-point))
>
> will return:
> (foo (a b) bar)
> instead of:
> (a b)

Ah, good catch. Thanks back.





This bug report was last modified 6 years and 337 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.