[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#13973: Subject: 24.3; thingatpt.el, end-of-sexp
From: |
Lars Ingebrigtsen |
Subject: |
bug#13973: Subject: 24.3; thingatpt.el, end-of-sexp |
Date: |
Mon, 23 Aug 2021 03:09:27 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
Andreas Röhler <andreas.roehler@easy-emacs.de> writes:
> (defun end-of-sexp ()
> "Move point to the end of the current sexp.
> \[This is an internal function.]"
> (let ((char-syntax (char-syntax (char-after))))
> (if (or (eq char-syntax ?\))
> (and (eq char-syntax ?\") (in-string-p)))
> (forward-char 1)
> (forward-sexp 1))))
>
> "or" asks if inside a string and calls (forward-char 1).
>
> This must fail with some probability with
> triple-quoted-strings as used in Python.
>
> Solution:
>
> When inside a string, jump to (nth 8 (syntax-ppss)) and
> call (forward-sexp 1) from there.
(I'm going through old bug reports that unfortunately weren't resolved
at the time.)
It's not quite clear to me what the actual problem here is. Do you have
a test case where thingatpt does the wrong thing in Python mode?
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
- bug#13973: Subject: 24.3; thingatpt.el, end-of-sexp,
Lars Ingebrigtsen <=
- bug#13973: Subject: 24.3; thingatpt.el, end-of-sexp, Andreas Röhler, 2021/08/23
- bug#13973: Subject: 24.3; thingatpt.el, end-of-sexp, Lars Ingebrigtsen, 2021/08/25
- bug#13973: Subject: 24.3; thingatpt.el, end-of-sexp, Andreas Röhler, 2021/08/26
- bug#13973: Subject: 24.3; thingatpt.el, end-of-sexp, Lars Ingebrigtsen, 2021/08/26
- bug#13973: Subject: 24.3; thingatpt.el, end-of-sexp, Andreas Röhler, 2021/08/27
- bug#13973: Subject: 24.3; thingatpt.el, end-of-sexp, Lars Ingebrigtsen, 2021/08/28