docs: warn Windows users about symlinks

This isn't important *yet*, but it will be post-v3.0, so might as well
start warning people early.
This commit is contained in:
Henrik Lissner
2024-10-02 17:22:32 -04:00
parent 896204c8f7
commit df65137730

View File

@ -169,21 +169,52 @@ in."
(explain! "The second directory will be ignored, as it has lower precedence.")))) (explain! "The second directory will be ignored, as it has lower precedence."))))
(print! (start "Checking for common environmental issues...")) (print! (start "Checking for common environmental issues..."))
(when (string-match-p "/fish$" shell-file-name) (print-group!
(print! (warn "Detected Fish as your $SHELL")) (when (string-match-p "/fish$" shell-file-name)
(explain! "Fish (and possibly other non-POSIX shells) is known to inject garbage " (print! (warn "Detected Fish as your $SHELL"))
"output into some of the child processes that Emacs spawns. Many Emacs " (explain! "Fish (and possibly other non-POSIX shells) is known to inject garbage "
"packages/utilities will choke on this output, causing unpredictable issues. " "output into some of the child processes that Emacs spawns. Many Emacs "
"To get around this, either:\n\n" "packages/utilities will choke on this output, causing unpredictable issues. "
" - Add the following to $DOOMDIR/config.el:\n\n" "To get around this, either:\n\n"
" (setq shell-file-name (executable-find \"bash\"))\n\n" " - Add the following to $DOOMDIR/config.el:\n\n"
" - Or change your default shell to a POSIX shell (like bash or zsh) " " (setq shell-file-name (executable-find \"bash\"))\n\n"
" and explicitly configure your terminal apps to use the shell you " " - Or change your default shell to a POSIX shell (like bash or zsh) "
" want.\n\n" " and explicitly configure your terminal apps to use the shell you "
"If you opt for option 1 and use one of Emacs' terminal emulators, you " " want.\n\n"
"will also need to configure them to use Fish, e.g.\n\n" "If you opt for option 1 and use one of Emacs' terminal emulators, you "
" (setq-default vterm-shell (executable-find \"fish\"))\n\n" "will also need to configure them to use Fish, e.g.\n\n"
" (setq-default explicit-shell-file-name (executable-find \"fish\"))\n")) " (setq-default vterm-shell (executable-find \"fish\"))\n\n"
" (setq-default explicit-shell-file-name (executable-find \"fish\"))\n"))
(condition-case e
(when (featurep :system 'windows)
(let ((filea (expand-file-name "__testfile1" temporary-file-directory))
(fileb (expand-file-name "__testfile2" temporary-file-directory)))
(unwind-protect
(progn
(with-temp-file fileb)
(make-symbolic-link fileb filea)
(not (file-symlink-p filea)))
(delete-file filea)
(delete-file fileb))))
('file-error
(when (equal (cons (nth 1 e) (nth 2 e))
(cons "Making symbolic link" "Operation not permitted"))
(print! (warn "Symlinks are not enabled on this operating system"))
(explain! "In the near future, Doom will make extensive use of symlinks to save space "
"and simplify package and profile management. Without symlinks, much of it "
"won't be functional. To get around this, you have three options:"
"\n\n"
" - Enabling 'Developer Mode' in the Windows settings (search for 'Developer "
" Settings' in the start menu). This will warn you about its effect on system "
" security, but this can be ignored. If it bothers you, consider another option "
" below.\n"
" - Running your shell (cmd or powershell) in administrator mode anytime you "
" need to use the 'doom' script. Also, the `doom/reload' command won't work "
" unless Emacs itself is launched in administrator mode.\n"
" - Install Emacs in WSL 1/2; the native Linux environment it creates supports "
" symlinks out of the box and is the best option (as Emacs is generally more "
" stable, predictable, and faster there).\n\n")))))
(print! (start "Checking for stale elc files...")) (print! (start "Checking for stale elc files..."))
(elc-check-dir doom-core-dir) (elc-check-dir doom-core-dir)