Subject: bug#31772: 26.1; (thing-at-point 'list) regression

From: Leo Liu <[email-masked]>
Date: Tue, 12 Jun 2018 01:04:48 +0800

On 2018-06-11 17:58 +0300, Eli Zaretskii wrote:
> In "emacs -Q", go to the 'h' in "that" on the first line, and then:
>
>   M-: (thing-at-point 'list) RET
>    => #("hat" 0 3 (fontified nil face font-lock-comment-face))
>
> That's not even a word, let alone a list.  Is that useful?  I think
> nil is more useful, since nothing should be a list inside a comment.

I have noticed this while coding easy-kill since it built on
thingatpt.el. It was of minor annoyance so I ignored it.

It seems to make a lot of sense to fallback on `sexp' as a degenerated
case. Do you agree the previous behaviour of (thing-at-point 'list) is
mostly sane?

Additional points.

show-paren-mode works inside comments and strings. One of the craziest
things it does is if you have open paren in one string and a close paren
in another, it works too.

characters in and out of comments usually have the same syntax. so
finding a list in comments or strings is not wrong. It's smart and it's
useful. It serves us very well.

Leo