unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#13973: Subject: 24.3; thingatpt.el, end-of-sexp
@ 2013-03-16  7:51 Andreas Röhler
  2013-03-16 10:33 ` Leo Liu
  2021-08-23  1:09 ` Lars Ingebrigtsen
  0 siblings, 2 replies; 11+ messages in thread
From: Andreas Röhler @ 2013-03-16  7:51 UTC (permalink / raw)
  To: 13973

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





^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2021-08-28 15:05 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-16  7:51 bug#13973: Subject: 24.3; thingatpt.el, end-of-sexp Andreas Röhler
2013-03-16 10:33 ` Leo Liu
2013-03-16 12:09   ` Andreas Röhler
2013-03-16 13:50   ` Stefan Monnier
2021-08-23  1:09 ` Lars Ingebrigtsen
2021-08-23 17:11   ` Andreas Röhler
2021-08-25 10:38     ` Lars Ingebrigtsen
2021-08-26  6:21       ` Andreas Röhler
2021-08-26 14:05         ` Lars Ingebrigtsen
2021-08-27 18:44           ` Andreas Röhler
2021-08-28 15:05             ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).