When I drag and drop a directory to Dired in Emacs 26.3, it copies the directory (and its contents) to the directory that Emacs is showing. This is like the behavior in MS Windows explorer. I don't like that!, at least not for Emacs.

I prefer the old behavior where dired will rather just list that directory in Dired.

Can anyone please tell me what to hack to get back that old behavior? (Google did not provide me an answer, alas.)


Here's the answer: (setq dired-dnd-protocol-alist nil) after dired is loaded.

From dired.el:

(defcustom dired-dnd-protocol-alist
  '(("^file:///" . dired-dnd-handle-local-file)
    ("^file://"  . dired-dnd-handle-file)
    ("^file:"    . dired-dnd-handle-local-file))
  "The functions to call when a drop in `dired-mode' is made.
See `dnd-protocol-alist' for more information.  When nil, behave
as in other buffers.  Changing this option is effective only for
new Dired buffers."

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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