Subject: bug#52384: 26.3; dired buffer navigation tweak

From: Lars Ingebrigtsen <[email-masked]>
Date: Fri, 10 Dec 2021 13:00:12 +0100

Michael Perry <[email-masked]> writes:

> When visiting a directory in dired-mode, you get not only a list of contents, 
> but also a two-line header ('/path/to/directory' and 'total used ...') 

(The second line has been removed in Emacs 29, and the first line has
been made useful in Emacs 28 (you can now click on the segments).)

> and a trailing blank line. Those are a nuisance when navigating using 
> `M-<` and `M->'. 
>
> Can I suggest the following become standard? 
>
> (with-eval-after-load "dired" 
>   (define-key dired-mode-map (kbd "M-<") 
>     (lambda () (interactive) (beginning-of-buffer) (next-line 2))) 
>   (define-key dired-mode-map (kbd "M->") 
>     (lambda () (interactive) (end-of-buffer) (previous-line 1)))) 
>
> It's truly a small issue, but it's an irritation that multiplies over time. 

I don't think we should do something like this in Dired buffers (or
anywhere else, for that matter).  I want commands like `M-<' to be
predictable across modes, and I certainly don't want `M->' to take me to
the start of the last line.  (What if I want to copy the region to the
clipboard, for instance?)

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no