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)
This commit is contained in:
Eli Zaretskii 2025-12-14 10:18:34 +02:00
parent 1880cd0aa5
commit d481b9efdc

View file

@ -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.