bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#24627: 24.5; (thing-at-point 'list) may return a non-empty string wi


From: Andreas Röhler
Subject: 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
User-agent: Mozilla/5.0 (X11; Linux i686; rv:45.0) Gecko/20100101 Icedove/45.4.0



On 15.10.2016 11:44, Tino Calancha wrote:
Andreas Röhler <andreas.roehler@easy-emacs.de> writes:

On 13.10.2016 10:50, Tino Calancha wrote:
Andreas Röhler <andreas.roehler@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.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]