I am trying to use dired on Windows. But, when I attempt to follow a shortcut in dired, it seems to open the shortcut file itself in a buffer instead of following the shortcut to the target directory.

I attempted to follow the installation instructions in this file starting on line 51: https://github.com/hidsh/elisp/blob/master/w32-symlinks.el.

When I byte-compiled the w32-symlinks.el file, Emacs informed me that there were incorrectly escaped quotes in the function located on line 171. I removed those parts of the docstring and byte-compiled the file without error. I also used the following code as specified in the directions.

(add-hook 'dired-load-hook

(lambda () (require 'w32-symlinks)))

But, when I use dired to follow a Windows shortcut it still opens it as a file.

Is there another file explorer package that I can use? Is there another solution?

Thank you for your time.

Edit 1:

I did end up making some progress. I deleted my configuration, reinstalled emacs, and then followed the instructions again. Emacs now starts with configuration choices related to the w32-symlinks package. I have tried a few different combinations. But, now when I attempt to use dired to open a windows shortcut I get the error “Wrong type argument: stringp, t” in the mini-buffer.

  • arthurno1B
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 year ago

    What is value of your find-file-visit-truename? Somewhere in your init file:

    (setq find-file-visit-truename t)
    

    and see if it helps.

    I deleted my configuration, reinstalled emacs, and then followed the instructions again.

    It is not Windows 98 you are configuring there. No need to reinstall Emacs. If you have messed up badly just remove your init file and restart Emacs.

  • arthurno1B
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 year ago

    when I use dired to follow a Windows shortcut it still opens it as a file

    Have you enabled parsing of lnk files; as they say in the docs, you have:

     (customize-option 'w32-symlinks-handle-shortcuts)
    

    You can just

    (setopt w32-symlinks-handle-shortcuts t)
    

    However, when I tried it, they don’t seem to parse correctly the name; the last part of the name is surrounded by ‘#’ characters for some reason, so Emacs reports no such file found. I haven’t looked in depth at how they parse stuff and where.

    • iMagUdspEllrOPB
      link
      fedilink
      English
      arrow-up
      1
      ·
      1 year ago

      Wow. Thank you for your hard work. I will study that area. Thanks again.