add function to determine windows wsl and a function to open links in Windows web browser if wsl is used

This commit is contained in:
2021-02-18 14:36:47 +01:00
parent 0e987ba777
commit 64234286f0
2 changed files with 21 additions and 7 deletions

View File

@@ -41,6 +41,14 @@
(memq system-type '(windows-nt cygwin32 cygwin))
"Non-nil if and only if we're running on Windows.
Both Win32 and Cygwin count.")
;; https://stackoverflow.com/questions/60922620/shell-script-to-check-if-running-in-windows-when-using-wsl
(defvar running-on-windows-wsl
(string-equal
(replace-regexp-in-string
"[ \n]+$" ""
(shell-command-to-string
"uname -a | sed -n 's/.*\\( *Microsoft *\\).*/\\1/ip'"))
"Microsoft"))
(setq user-emacs-directory "~/.config/emacs/")
(defconst user-cache-directory
(file-name-as-directory (concat user-emacs-directory ".cache"))