Windows 10, Emacs 25.1., Dired+

I want to copy file from folder "test" to folder "response".

My steps:

  1. Open folder "test" see screen:


  1. split window by command (split-window-vertically &optional SIZE) see screen: Screen_2

Now I want enter in folder "response". As result I

  1. move cursor to bottom screen by (windmove-down &optional ARG)

  2. Press "Return"

  3. As result top window go to prev buffer (scratch)

see screen


Why? And how I can fix this?

Updated (from mistaken update of an answer by question OP - moved here):

I think I narrow the problem. My steps:

 emacs -Q

Load only dired+

 (require 'dired+)

The prblem is GONE. ОК.

In my init.el I has the next diredp setting:

 ;; Dired reuse directory buffer (only one buffer)
 (diredp-toggle-find-file-reuse-dir 1)

So I set it.

And ... the the problem reappeared. So I think the problem is in dired+ package and specifically in this setting

 (diredp-toggle-find-file-reuse-dir 1)

Is I'm right?

1 Answer 1


The behavior you describe has nothing to do with Dired+. You can see this if you start Emacs using emacs -Q and then load only library Dired+ and repeat your recipe.

The behavior you describe has to do with buffer switching or moving among windows. Try recursively bisecting your init file to discover which part of it is causing the problem.

Your post mentions Helm and Windmove. Try first without one of those libraries, to see if one of them (or both together) is causing the behavior you don't want. It's not clear whether you are also using other libraries that could affect this behavior.

In general when you encounter a problem, try to narrow down the set of libraries that might cause it. It doesn't help you or anyone else to pose a question about some behavior that might result from the use of any number of libraries interacting together. To test/debug something you need to narrow the problem (the search space), not just toss everything into one giant sack and try to test it all at once.

I know this sounds negative, but I mean it to positively help you. Maybe someone else will immediately see the answer and let you know that XYZ is causing this. Even if that's the case (and I hope it is), you would do well to try to narrow the focus of a question -- it generally makes for more useful questions and more useful answers.

UPDATE after question update, which mentions diredp-toggle-find-file-reuse-dir

Yes, you are right. I was wrong that what you describe has nothing to do with Dired+.

And that is the correct behavior for diredp-make-find-file-keys-reuse-dirs (used by the toggle command). You chose that behavior when you used that toggle command.

What happens when you hit RET to choose subdirectory response is that the current Dired buffer, test (for the parent directory) is killed, and the directory you asked to move to, response takes its place in the selected window. Since the Dired buffer for the parent directory has been killed, another buffer is shown in the other window.

Moral: If you want to keep Dired buffers when you create a Dired buffer then do not choose to reuse the current Dired buffer for a different directory.


I've enhanced the behavior of reusing Dired buffers (diredp-toggle-find-file-reuse-dir), so the behavior you disliked no longer occurs. Reuse (i.e., killing the Dired buffer you're leaving, when you visit a file or another directory) does not occur if the current Dired buffer is already showing in another window, or if the target for a find-file operation is a directory that is already in a Dired buffer.

You can get the latest dired+.el, which has this update, here.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.