I managed to make dired work in a single window, when I am navigating through the file system.
Improving ergonomics, I decided to create bookmarks for my most frequent dirs with short names like: 'lwt', 'eve', etc. But every time I open the bookmark, the new dired buffer is created, even if the old one exists.
How to make it open the bookmark in the existing dired buffer?
The original answer was actually a non-answer. I apologise for not having tested it properly. I will leave it here so other potential answerers aren't misled like I was.
I have meanwhile taken a good look at the source code of bookmark.el
and the dired+
modifications don't have any effect on it. By default the bookmark-jump
function uses the switch-to-buffer
function as its display function. bookmark-jump
however has an optional display-func
argument, so a possible solution (involving a bit of elisp hacking) would be to create a function that reuses the current dired buffer (based on the dired+
source code) and invoking bookmark-jump
with it, and if the concept works, then bind that to a keyboard short-cut.
The behaviour you are observing is just a side effect of the general "create a new buffer when navigating" behaviour of dired. This fact makes this question an almost duplicate of How do I stop emacs dired mode from opening so many buffers?.
Of the solutions proposed there and at the Dired Reuse Directory Buffer Emacs Wiki page, probably the simplest one is installing the Dired+ package and toggling directory buffer reuse with:
(toggle-diredp-find-file-reuse-dir 1)
in your .emacs
file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With