From fae5ced1acaff0dcf8a2206272d7762612ea7289 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Sun, 2 Nov 2025 09:41:05 +0200 Subject: [PATCH] * lisp/simple.el (previous-line-or-history-element): Fix off-by-one error. (bug#79746) --- lisp/simple.el | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lisp/simple.el b/lisp/simple.el index 8a88084986e..8d7237e58c6 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -3191,12 +3191,12 @@ previous element of the minibuffer history in the minibuffer." ;; Avoid moving point to the prompt (when (< (point) (minibuffer-prompt-end)) ;; If there is minibuffer contents on the same line - (if (<= (minibuffer-prompt-end) - (save-excursion - (if (or truncate-lines (not line-move-visual)) - (end-of-line) - (end-of-visual-line)) - (point))) + (if (< (minibuffer-prompt-end) + (save-excursion + (if (or truncate-lines (not line-move-visual)) + (end-of-line) + (end-of-visual-line)) + (point))) ;; Move to the beginning of minibuffer contents (goto-char (minibuffer-prompt-end)) ;; Otherwise, go to the previous history element