Subject: bug#71728: previous-line-or-history-element should put cursor at end, like comint-previous-input

From: Eli Zaretskii <[email-masked]>
Date: Sun, 23 Jun 2024 08:37:47 +0300

tags 71728 notabug wontfix
close 71728
thanks

> From: Dan Jacobson <[email-masked]>
> Date: Sun, 23 Jun 2024 07:16:49 +0800
> 
> Here none of the "C-e ;; move-end-of-line" should be necessary,
> as the position of the previous cursor should be remembered along
> with the previous command.
> Or the default position of the cursor should be the end of line,
> not beginning. Just like comint-previous-input.
> 
>  !	  ;; dired-do-shell-command
>  l	  ;; self-insert-command
>  s	  ;; self-insert-command
>  <return> ;; exit-minibuffer
>  !	  ;; dired-do-shell-command
>  <up>	  ;; previous-line-or-history-element
>  C-e	  ;; move-end-of-line
>  SPC	  ;; self-insert-command
>  -	  ;; self-insert-command
>  a	  ;; self-insert-command
>  <return> ;; exit-minibuffer
>  !	  ;; dired-do-shell-command
>  <up>	  ;; previous-line-or-history-element
>  C-e	  ;; move-end-of-line
>  l	  ;; self-insert-command
>  <return> ;; exit-minibuffer

There's a possible conflict between moving the cursor vertically and
showing the previous command here.  If you don't like the current
heuristics, use M-p instead of the <UP> arrow.

I'm closing this bug because Emacs behaves here exactly as intended,
and changing that will reopen a large can of worms we had when the
current behavior was implemented.