this post was submitted on 27 Oct 2023
2 points (100.0% liked)

Emacs

314 readers
2 users here now

A community for the timeless and infinitely powerful editor. Want to see what Emacs is capable of?!

Get Emacs

Rules

  1. Posts should be emacs related
  2. Be kind please
  3. Yes, we already know: Google results for "emacs" and "vi" link to each other. We good.

Emacs Resources

Emacs Tutorials

Useful Emacs configuration files and distributions

Quick pain-saver tip

founded 1 year ago
MODERATORS
 

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.

top 3 comments
sorted by: hot top controversial new old
[–] arthurno1@alien.top 1 points 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.

[–] arthurno1@alien.top 1 points 1 year ago (1 children)

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.

[–] iMagUdspEllr@alien.top 1 points 1 year ago

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