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

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

bug#13973: Subject: 24.3; thingatpt.el, end-of-sexp


From: Andreas Röhler
Subject: bug#13973: Subject: 24.3; thingatpt.el, end-of-sexp
Date: Sat, 16 Mar 2013 08:51:34 +0100
User-agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130307 Thunderbird/17.0.4

(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.





reply via email to

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