From: Eshel Yaron Date: Fri, 28 Feb 2025 19:18:49 +0000 (+0100) Subject: Fix 'lisp-kill-line' X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=39c06213848caa9cce4f7c3c6e83953bab0088ed;p=emacs.git Fix 'lisp-kill-line' --- diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index a4e9a88aebf..8069f4ae77a 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el @@ -923,9 +923,18 @@ font-lock keywords will not be case sensitive." (kill-line arg) (skip-syntax-forward " -") (while (and (condition-case nil - (progn (forward-sexp) t) + (progn + (forward-sexp) + (skip-syntax-forward " -") + t) (scan-error nil)) - (< (point) eol))) + ;; We've skipped one sexp. + ;; Are we still on the same line? + (< (point) eol) + ;; Does the line end with a comment? + (or (not (equal (char-after) ?\;)) + ;; It does. Stop after the comment. + (prog1 nil (goto-char eol))))) (kill-region beg (point))))))) (defun lisp-tidy-sexp ()