]> git.eshelyaron.com Git - emacs.git/commitdiff
Make down-list signal an error if called inside a string
authorLars Ingebrigtsen <larsi@gnus.org>
Fri, 6 May 2022 19:13:32 +0000 (21:13 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Fri, 6 May 2022 19:13:54 +0000 (21:13 +0200)
* lisp/emacs-lisp/lisp.el (down-list): Signal an error inside a
string (bug#5588).

lisp/emacs-lisp/lisp.el

index 4aeca9c6b002f988bbc990304f2f14df56baa5e1..ffca0dcf4f53581d2ac2ded4ac7afb3a9a7e50c9 100644 (file)
@@ -171,6 +171,8 @@ This command assumes point is not in a string or comment.
 If INTERACTIVE is non-nil, as it is interactively,
 report errors as appropriate for this kind of usage."
   (interactive "^p\nd")
+  (when (ppss-comment-or-string-start (syntax-ppss))
+    (user-error "This command doesn't work in strings or comments"))
   (if interactive
       (condition-case _
           (down-list arg nil)