From 33ff4fed03d8cd869d35edd94f92b3fbb0a7c3aa Mon Sep 17 00:00:00 2001
From: Stephen Berman <stephen.berman@gmx.net>
Date: Sat, 16 Sep 2023 14:00:24 +0200
Subject: [PATCH] Make move-end-of-line in minibuffer consistent (bug#65980)

* lisp/simple.el (move-end-of-line): Always move to eol when
invoking `C-e' from within the minibuffer's prompt string.
---
 lisp/simple.el | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lisp/simple.el b/lisp/simple.el
index abd587245fe..a128ff41051 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -8228,7 +8228,11 @@ rests."
       (let ((newpos
 	     (save-excursion
 	       (let ((goal-column 0)
-		     (line-move-visual nil))
+		     (line-move-visual nil)
+                     ;; Always move to eol when invoking `C-e' from
+                     ;; within the minibuffer's prompt string (see
+                     ;; bug#65980).
+                     (inhibit-field-text-motion (minibufferp)))
 		 (and (line-move arg t)
 		      ;; With bidi reordering, we may not be at bol,
 		      ;; so make sure we are.
-- 
2.39.5