all repos — nixfiles @ 3a26b26766454af43ea39018a0ba1890bec99630

System and user configuration, managed by nix and home-manager

Emacs: Fix windows check file-to-string isn't actually a built-in function, even though it's named like one.

Alan Pearce
commit

3a26b26766454af43ea39018a0ba1890bec99630

parent

f2f351569ffac639d5773d52f7482e77528eeb2c

1 file changed, 5 insertions(+), 2 deletions(-)

jump to
M emacs/.emacs.d/init.orgemacs/.emacs.d/init.org
@@ -21,8 +21,11 @@
Are we running on Windows via the WSL? #+BEGIN_SRC emacs-lisp -(when (string-match "Microsoft$" (file-to-string "/proc/sys/kernel/osrelease")) - (setq system-type 'gnu/linux/windows)) +(with-temp-buffer + (insert-file-contents-literally "/proc/sys/kernel/osrelease") + (decode-coding-region (point-min) (point-max) 'utf-8 t) + (when (string-match "Microsoft$" (buffer-string)) + (setq system-type 'gnu/linux/windows))) #+END_SRC ** Compatibility