2

I'm beginning to think that dired (+ extensions) is the file browser I've always been looking for. Under Windows, however, dired does not allow to switch to other drives easily. While most things are happening within one drive anyway, sometimes I would like to able to switch to some USB-drive, for example. But, in order to get there, I have to know the drive letter and put it in manually with find-files.

Is there a better ways to see, and switch between, drives under windows?

1

If you use Dired+ then this is taken care of for you. As explained here:

Dired+ loads library w32-browser.el if Emacs is running on Microsoft Windows, using it to extend Dired in a few ways. (In addition to being bound to the keys indicated here, these operations are added to the Dired+ menus, including the mouse-3 context menu.)

...

  • ^ -- When at the root of a Windows drive (e.g. C:/) and you use ^ (dired-up-directory), you get a list of drives to choose from.

IOW, use ^ at the root folder of any drive to get to a list of all available drives.

  • Yes, this should be the way to go, but diredp-w32-drives keeps showing me the C-drive only. This is under Windows 10. Any idea what could be causing thins? – Timm Mar 26 '17 at 18:57
  • No idea. I don't have Windows 10. See what you can find out, debugging, and send me email about it (see the file header for email). Load the *.el file, then M-x debug-on-entry diredp-w32-drives. – Drew Mar 26 '17 at 21:56
  • debug-on-entry doesn't show anything suspicious. When I call dired-w32-drives, a buffer *Windows Drives* is shown with one entry [C: Local disk], even though I have my USB-stick attached (which is visible in Windows Explorer). I guess it should appear there as well as [D: CORSAIR] or similarly. – Timm Mar 30 '17 at 3:42
  • @Timm: Yep, it should. What does the shell command net use show you when you do that at a Windows command prompt? If it doesn't show you all of the drives then that's the problem. – Drew Mar 30 '17 at 14:42
  • When I execute net use (with both PowerShell and cmd), it sais that "there are no entries in the list". Yet I can switch to the drive with d:. – Timm Mar 31 '17 at 15:27
0

The best way to include other local drives (such as a flash drive) in diredp-w32-drives-mode is to add these drives to the variable diredp-w32-local-drives defined in dired+.el.

This is what mine looks like after editing:

;;;###autoload
(defcustom diredp-w32-local-drives
  '(("C:" "Local disk")
    ("G:" "Google Drive File Stream")
    ("D:" "Removable Drive 1")
    ("E:" "Removable Drive 2"))
  "*Local MS Windows drives that you want to use for `diredp-w32-drives'.
Each entry is a list (DRIVE DESCRIPTION), where DRIVE is the drive
name and DESCRIPTION describes DRIVE."
  :type '(alist
          :key-type   (string        :tag "Drive name")
          :value-type (group (string :tag "Drive description")))
  :group 'Dired-Plus)

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.