unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#65980: 30.0.50; C-e behaves surprisingly in minibuffer
@ 2023-09-14 16:51 Stephen Berman
  2023-09-14 17:26 ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Stephen Berman @ 2023-09-14 16:51 UTC (permalink / raw)
  To: 65980

[-- Attachment #1: Type: text/plain, Size: 1915 bytes --]

0. emacs -Q
Sanity checks:
1. Type a command that prompts in the minibuffer and includes text that
   ends before window-width, resulting e.g. in this in the minibuffer:
   Find file: ~/src/emacs/emacs-master/INSTALL
2. Typing C-a moves point to the beginning of the file name and then
   typing C-e moves point to the end of the file name.
3. Typing M-< moves point to the beginning of the prompt and then typing
   C-e moves point to the end of the file name.
Change the input:
4. Now type a command that includes text that extends beyond
   window-width, resulting e.g. in this in the minibuffer:
   Find file: ~/src/emacs/emacs-master/java/org/gnu/emacs/EmacsLauncherPreferencesActivity.java
5. Typing C-a moves point to the beginning of the file name and then
   typing C-e moves point to the end of the file name (same as step 2).
Here's the surprising behavior:
6. Typing M-< moves point to the beginning of the prompt but now typing
   C-e fails to move point.  And if you move point to any position
   within the prompt, e.g. M-f to put point after "Find", then typing
   C-e moves point to the beginning of the prompt.

It certainly seems like a bug that C-e, i.e. move-end-of-line, fails to
move to the end of the line in step 6, and the inconsistency between the
results in step 3 and step 6 also seems like a bug.  The attached patch
ensures that C-e in step 6 moves to the end of the file name, as in step
2, and should only affect the use of C-e in the minibuffer.


In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
 3.24.38, cairo version 1.17.6) of 2023-09-13 built on strobelfs2
Repository revision: 9838f786ded35fe49bbe84dd78af84df1337adbf
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101008
System Description: Linux From Scratch r12.0-19

Configured using:
 'configure -C 'CFLAGS=-Og -g3' PKG_CONFIG_PATH=/opt/qt5/lib/pkgconfig'

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: line-move-1 patch --]
[-- Type: text/x-patch, Size: 570 bytes --]

diff --git a/lisp/simple.el b/lisp/simple.el
index 35dd0f59e29..564265d8c60 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -8053,8 +8053,9 @@ line-move-1
 		  ;; We avoid vertical-motion when possible
 		  ;; because that has to fontify.
 		  (forward-line 1))
-		 ;; Otherwise move a more sophisticated way.
-		 ((zerop (vertical-motion 1))
+		 ;; Otherwise move a more sophisticated way, unless
+		 ;; we're in the minibuffer.
+		 ((or (zerop (vertical-motion 1)) (minibufferp))
 		  (if (not noerror)
 		      (signal 'end-of-buffer nil)
 		    (setq done t))))

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-09-16 12:02 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-14 16:51 bug#65980: 30.0.50; C-e behaves surprisingly in minibuffer Stephen Berman
2023-09-14 17:26 ` Eli Zaretskii
2023-09-14 20:37   ` Stephen Berman
2023-09-15  5:40     ` Eli Zaretskii
2023-09-15 12:35       ` Stephen Berman
2023-09-16  7:56         ` Eli Zaretskii
2023-09-16 12:02           ` Stephen Berman

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).