From: Juri Linkov Date: Mon, 25 Jan 2021 17:14:22 +0000 (+0200) Subject: Don't move point to the prompt in previous-line-or-history-element (bug#46033) X-Git-Tag: emacs-28.0.90~4119 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=49e01d85ed6a6e4c95d43b6eeb4f32c7daa319a7;p=emacs.git Don't move point to the prompt in previous-line-or-history-element (bug#46033) * lisp/simple.el (previous-line-or-history-element): Avoid moving point to the prompt. --- diff --git a/lisp/simple.el b/lisp/simple.el index 8d4e4a7a6bb..c878fdab921 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -2476,7 +2476,10 @@ previous element of the minibuffer history in the minibuffer." (current-column))))) (condition-case nil (with-no-warnings - (previous-line arg)) + (previous-line arg) + ;; Avoid moving point to the prompt + (when (< (point) (minibuffer-prompt-end)) + (signal 'beginning-of-buffer nil))) (beginning-of-buffer ;; Restore old position since `line-move-visual' moves point to ;; the beginning of the line when it fails to go to the previous line.