emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 49e01d8: Don't move point to the prompt in previous-line-or-histo


From: Juri Linkov
Subject: master 49e01d8: Don't move point to the prompt in previous-line-or-history-element (bug#46033)
Date: Mon, 25 Jan 2021 12:14:39 -0500 (EST)

branch: master
commit 49e01d85ed6a6e4c95d43b6eeb4f32c7daa319a7
Author: Juri Linkov <juri@linkov.net>
Commit: Juri Linkov <juri@linkov.net>

    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.
---
 lisp/simple.el | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lisp/simple.el b/lisp/simple.el
index 8d4e4a7..c878fda 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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]