diff options
author | Lars Ingebrigtsen <larsi@gnus.org> | 2022-05-06 21:13:32 +0200 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2022-05-06 21:13:54 +0200 |
commit | 0b3b295776ce723885c9997ab26d57314db2a5df (patch) | |
tree | 48caf8fe2c14eda1bc4b2777ed10ae2be7b13c16 /lisp/emacs-lisp/lisp.el | |
parent | cbd59395bdccd924ebe39430f32d2d72546a841a (diff) | |
download | emacs-0b3b295776ce723885c9997ab26d57314db2a5df.tar.gz |
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).
Diffstat (limited to 'lisp/emacs-lisp/lisp.el')
-rw-r--r-- | lisp/emacs-lisp/lisp.el | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lisp/emacs-lisp/lisp.el b/lisp/emacs-lisp/lisp.el index 4aeca9c6b00..ffca0dcf4f5 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) |