From 4c9df9bfc63d2c3a9e20e20deaa854072e379f47 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Thu, 18 Aug 2022 17:06:42 +0200 Subject: [PATCH] fix: partially revert OS detection changes These changes snuck into ad6a3d0, but have not been implemented yet, so some OS-specific functionality was orphaned. Amend: ad6a3d0f33ee --- lisp/lib/system.el | 4 ++-- modules/editor/multiple-cursors/config.el | 4 ++-- modules/lang/cc/config.el | 10 +++++----- modules/lang/lua/config.el | 6 +++--- modules/lang/org/config.el | 6 +++--- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/lisp/lib/system.el b/lisp/lib/system.el index 63f2a3d0c..6aad3a5b1 100644 --- a/lisp/lib/system.el +++ b/lisp/lib/system.el @@ -6,8 +6,8 @@ ;; REVIEW Use `with-memoization' when 27.x support is dropped (or (get 'doom-system-distro 'cached-value) (put 'doom-system-distro 'cached-value - (cond ((featurep :os 'windows) 'windows) - ((featurep :os 'macos) 'macos) + (cond (IS-WINDOWS 'windows) + (IS-MAC 'macos) ((and (file-exists-p "/etc/os-release") (with-temp-buffer (insert-file-contents "/etc/os-release") diff --git a/modules/editor/multiple-cursors/config.el b/modules/editor/multiple-cursors/config.el index 92a975b27..70fcad15f 100644 --- a/modules/editor/multiple-cursors/config.el +++ b/modules/editor/multiple-cursors/config.el @@ -74,8 +74,8 @@ (apply fn args))) ;; REVIEW This is tremendously slow on macos and windows for some reason. - (setq evil-mc-enable-bar-cursor (not (or (featurep :os 'macos) - (featurep :os 'windows)))) + (setq evil-mc-enable-bar-cursor (not (or IS-MAC + IS-WINDOWS))) (after! smartparens ;; Make evil-mc cooperate with smartparens better diff --git a/modules/lang/cc/config.el b/modules/lang/cc/config.el index 1d5a28149..788903f0f 100644 --- a/modules/lang/cc/config.el +++ b/modules/lang/cc/config.el @@ -17,7 +17,7 @@ This is ignored by ccls.") `((c-mode . nil) (c++-mode . ,(list "-std=c++1z" ; use C++17 draft by default - (when (featurep :os 'macos) + (when IS-MAC ;; NOTE beware: you'll get abi-inconsistencies when passing ;; std-objects to libraries linked with libstdc++ (e.g. if you ;; use boost which wasn't compiled with libc++) @@ -270,7 +270,7 @@ If rtags or rdm aren't available, fail silently instead of throwing a breaking e ;; NOTE : This setting is untested yet (after! eglot - (when (featurep :os 'macos) + (when IS-MAC (add-to-list 'eglot-workspace-configuration `((:ccls . ((:clang . ,(list :extraArgs ["-isystem/Library/Developer/CommandLineTools/usr/include/c++/v1" "-isystem/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include" @@ -297,12 +297,12 @@ If rtags or rdm aren't available, fail silently instead of throwing a breaking e (setq-hook! 'lsp-configure-hook ccls-sem-highlight-method (if lsp-enable-semantic-highlighting ccls-sem-highlight-method)) - (when (or (featurep :os 'macos) - (featurep :os 'linux)) + (when (or IS-MAC + IS-LINUX) (setq ccls-initialization-options `(:index (:trackDependency 1 :threads ,(max 1 (/ (doom-system-cpus) 2)))))) - (when (featurep :os 'macos) + (when IS-MAC (setq ccls-initialization-options (append ccls-initialization-options `(:clang ,(list :extraArgs ["-isystem/Library/Developer/CommandLineTools/usr/include/c++/v1" diff --git a/modules/lang/lua/config.el b/modules/lang/lua/config.el index 45519c045..14d62daad 100644 --- a/modules/lang/lua/config.el +++ b/modules/lang/lua/config.el @@ -34,9 +34,9 @@ lua-language-server.") ;; is a function is to dynamically change when/if `+lua-lsp-dir' does (list (or (executable-find "lua-language-server") (doom-path +lua-lsp-dir - (cond ((featurep :os 'macos) "bin/macOS") - ((featurep :os 'linux) "bin/Linux") - ((featurep :os 'windows) "bin/Windows")) + (cond (IS-MAC "bin/macOS") + (IS-LINUX "bin/Linux") + (IS-WINDOWS "bin/Windows")) "lua-language-server")) "-E" "-e" "LANG=en" (doom-path +lua-lsp-dir "main.lua"))) diff --git a/modules/lang/org/config.el b/modules/lang/org/config.el index 49c264286..965c71800 100644 --- a/modules/lang/org/config.el +++ b/modules/lang/org/config.el @@ -514,7 +514,7 @@ relative to `org-directory', unless it is an absolute path." :face (lambda (path) (if (or (file-remote-p path) ;; filter out network shares on windows (slow) - (and (featurep :os 'windows) + (and IS-WINDOWS (string-prefix-p "\\\\" path)) (file-exists-p path)) 'org-link @@ -848,7 +848,7 @@ between the two." [C-return] #'+org/insert-item-below [C-S-return] #'+org/insert-item-above [C-M-return] #'org-insert-subheading - (:when (featurep :os 'macos) + (:when IS-MAC [s-return] #'+org/insert-item-below [s-S-return] #'+org/insert-item-above [s-M-return] #'org-insert-subheading) @@ -1305,7 +1305,7 @@ between the two." "Advise `server-visit-files' to load `org-protocol' lazily." :around #'server-visit-files (if (not (cl-loop with protocol = - (if (featurep :os 'windows) + (if IS-WINDOWS ;; On Windows, the file arguments for `emacsclient' ;; get funnelled through `expand-file-path' by ;; `server-process-filter'. This substitutes