all messages for Emacs-related lists mirrored at yhetil.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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.