]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix 'lisp-kill-line'
authorEshel Yaron <me@eshelyaron.com>
Fri, 28 Feb 2025 19:18:49 +0000 (20:18 +0100)
committerEshel Yaron <me@eshelyaron.com>
Fri, 28 Feb 2025 19:18:49 +0000 (20:18 +0100)
lisp/emacs-lisp/lisp-mode.el

index a4e9a88aebf4e1a0be8ac0ff51bc2a45635fb746..8069f4ae77a112a7ea897c98bdb0bb6cf8e91ac5 100644 (file)
@@ -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 ()