This is going to be a real quick one, mainly a “thank you!” to Lars
Ingebrigtsen. Lars has recently added a new option on the Emacs master branch:
dired-kill-when-opening-new-dired-buffer
. I will let the documentation speak for
itself:
dired-kill-when-opening-new-dired-buffer is a variable defined in ‘dired.el'.
Its value is t
Original value was nilYou can customize this variable. This variable was introduced, or its default value was changed, in version 28.1 of Emacs. Probably introduced at or before Emacs version 28.1.
If non-nil, kill the current buffer when selecting a new directory.
Setting this new option to t
means that pressing RET
or ^
in a Dired buffer will reuse the existing buffer. This is something
I required a while ago
(#20598) and that up
until today I had been hacking up poorly in my .init.el
.
I know the Emacs developers have more urgent bugs to work on, but this is such a nice improvement I am pretty sure you can see me happily smiling right now.