emacs-diffs
[Top][All Lists]
Advanced

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

master 0b3b295776: Make down-list signal an error if called inside a str


From: Lars Ingebrigtsen
Subject: master 0b3b295776: Make down-list signal an error if called inside a string
Date: Fri, 6 May 2022 15:14:00 -0400 (EDT)

branch: master
commit 0b3b295776ce723885c9997ab26d57314db2a5df
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Make down-list signal an error if called inside a string
    
    * lisp/emacs-lisp/lisp.el (down-list): Signal an error inside a
    string (bug#5588).
---
 lisp/emacs-lisp/lisp.el | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lisp/emacs-lisp/lisp.el b/lisp/emacs-lisp/lisp.el
index 4aeca9c6b0..ffca0dcf4f 100644
--- a/lisp/emacs-lisp/lisp.el
+++ b/lisp/emacs-lisp/lisp.el
@@ -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)



reply via email to

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