From d481b9efdc65bb066e2c765ae76ab5aa93dc9541 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sun, 14 Dec 2025 10:18:34 +0200 Subject: [PATCH] Fix a bug in 'kill-visual-line' that caused it signal an error * lisp/simple.el (kill-visual-line): Don't assume 'posn-at-point' always returns a non-nil value. (Bug#80004) --- lisp/simple.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/simple.el b/lisp/simple.el index 118fcb77502..6222608bbd0 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -8609,7 +8609,8 @@ even beep.)" ;; like display or overlay strings, intangible text, etc.: ;; otherwise, we don't want to kill a character that's ;; unrelated to the place where the visual line wraps. - (and (= (cdr (nth 6 (posn-at-point))) orig-vlnum) + (and (numberp (nth 6 (posn-at-point))) + (= (cdr (nth 6 (posn-at-point))) orig-vlnum) ;; Make sure we delete the character where the line wraps ;; under visual-line-mode, be it whitespace or a ;; character whose category set permits wrapping at it.