From 659f7bfc71d4d321728a5b8d68c5d2cd218d3dcb Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Tue, 5 Dec 2023 17:05:13 -0500 Subject: [PATCH] refactor!: deprecate IS-* OS constants BREAKING CHANGE: This deprecates the IS-(MAC|WINDOWS|LINUX|BSD) family of global constants in favor of a native `featurep` check: IS-MAC -> (featurep :system 'macos) IS-WINDOWS -> (featurep :system 'windows) IS-LINUX -> (featurep :system 'linux) IS-BSD -> (featurep :system 'bsd) The constants will stick around until the v3 release so folks can still use it -- and there are still some modules that use it, but I'll phase those uses out gradually. Fix: #7479 --- docs/examples.org | 6 +- lisp/cli/packages.el | 2 +- lisp/doom-keybinds.el | 4 +- lisp/doom-projects.el | 6 +- lisp/doom-start.el | 4 +- lisp/doom.el | 72 +++++++++++++++------- lisp/lib/system.el | 4 +- modules/app/everywhere/doctor.el | 4 +- modules/app/irc/config.el | 4 +- modules/checkers/grammar/config.el | 4 +- modules/completion/helm/config.el | 2 +- modules/completion/ivy/config.el | 6 +- modules/completion/vertico/config.el | 2 +- modules/config/default/+evil-bindings.el | 2 +- modules/config/default/autoload/default.el | 2 +- modules/config/default/config.el | 6 +- modules/editor/format/autoload/format.el | 2 +- modules/editor/multiple-cursors/config.el | 3 +- modules/editor/parinfer/config.el | 13 ++-- modules/emacs/dired/config.el | 8 +-- modules/emacs/dired/doctor.el | 2 +- modules/emacs/vc/config.el | 2 +- modules/email/mu4e/autoload/advice.el | 2 +- modules/email/mu4e/config.el | 4 +- modules/email/mu4e/doctor.el | 2 +- modules/lang/cc/config.el | 10 +-- modules/lang/latex/+viewers.el | 6 +- modules/lang/lua/autoload/lua.el | 2 +- modules/lang/lua/config.el | 6 +- modules/lang/markdown/config.el | 4 +- modules/lang/nim/config.el | 2 +- modules/lang/org/autoload/org-capture.el | 4 +- modules/lang/org/autoload/org-export.el | 9 +-- modules/lang/org/config.el | 6 +- modules/lang/org/contrib/dragndrop.el | 4 +- modules/lang/org/contrib/ipython.el | 2 +- modules/lang/org/doctor.el | 6 +- modules/lang/org/packages.el | 2 +- modules/lang/sh/config.el | 2 +- modules/os/macos/config.el | 2 +- modules/os/tty/config.el | 4 +- modules/term/eshell/config.el | 2 +- modules/term/eshell/packages.el | 2 +- modules/tools/debugger/config.el | 2 +- modules/tools/lookup/autoload/lookup.el | 2 +- modules/tools/lookup/config.el | 2 +- modules/tools/lookup/packages.el | 2 +- modules/ui/ligatures/config.el | 3 +- modules/ui/ligatures/doctor.el | 8 +-- modules/ui/modeline/+light.el | 2 +- modules/ui/modeline/config.el | 4 +- templates/init.example.el | 2 +- 52 files changed, 150 insertions(+), 120 deletions(-) diff --git a/docs/examples.org b/docs/examples.org index 9b1107f43..c88ba5fd5 100644 --- a/docs/examples.org +++ b/docs/examples.org @@ -379,7 +379,7 @@ Or to create aliases for functions that behave differently: "C-x C-r" 'a-global-keybind :g "C-x C-r" 'another-global-keybind ; same as above - (:when IS-MAC + (:when (featurep :system 'macos) :n "M-s" 'some-fn :i "M-o" (cmd! (message "Hi")))) @@ -604,7 +604,7 @@ These are side-by-side comparisons, showing how to bind keys with and without ;;helm :tools - (:if IS-MAC macos) + (:if (featurep :system 'macos) macos) docker lsp @@ -617,7 +617,7 @@ These are side-by-side comparisons, showing how to bind keys with and without ((string= system-name "writing-pc") (org +dragndrop) ruby)) - (:if IS-LINUX + (:if (featurep :system 'linux) (web +lsp) web) diff --git a/lisp/cli/packages.el b/lisp/cli/packages.el index 74daa9ea7..1cd6d4d45 100644 --- a/lisp/cli/packages.el +++ b/lisp/cli/packages.el @@ -297,7 +297,7 @@ declaration) or dependency thereof that hasn't already been." ;; variables entry is missing the suffix" errors when ;; installing them (see hlissner/doom-emacs#2637), so ;; have git handle conversion by force. - (when (and IS-WINDOWS (stringp local-repo)) + (when (and doom--system-windows-p (stringp local-repo)) (let ((default-directory (straight--repos-dir local-repo))) (when (file-in-directory-p default-directory straight-base-dir) (straight--process-run "git" "config" "core.autocrlf" "true"))))) diff --git a/lisp/doom-keybinds.el b/lisp/doom-keybinds.el index 0cc6e4841..f6ff2a99a 100644 --- a/lisp/doom-keybinds.el +++ b/lisp/doom-keybinds.el @@ -30,7 +30,7 @@ and Emacs states, and for non-evil users.") ;;; Global keybind settings (cond - (IS-MAC + (doom--system-macos-p ;; mac-* variables are used by the special emacs-mac build of Emacs by ;; Yamamoto Mitsuharu, while other builds use ns-*. (setq mac-command-modifier 'super @@ -40,7 +40,7 @@ and Emacs states, and for non-evil users.") ;; Free up the right option for character composition mac-right-option-modifier 'none ns-right-option-modifier 'none)) - (IS-WINDOWS + (doom--system-windows-p (setq w32-lwindow-modifier 'super w32-rwindow-modifier 'super))) diff --git a/lisp/doom-projects.el b/lisp/doom-projects.el index 98c4affb4..4d434e32d 100644 --- a/lisp/doom-projects.el +++ b/lisp/doom-projects.el @@ -147,7 +147,7 @@ c) are not valid projectile projects." (projectile-serialize-cache)))) ;; Some MSYS utilities auto expanded the `/' path separator, so we need to prevent it. - (when IS-WINDOWS + (when doom--system-windows-p (setenv "MSYS_NO_PATHCONV" "1") ; Fix path in Git Bash (setenv "MSYS2_ARG_CONV_EXCL" "--path-separator")) ; Fix path in MSYS2 @@ -192,11 +192,11 @@ And if it's a function, evaluate it." (concat (format "%s . -0 -H --color=never --type file --type symlink --follow --exclude .git %s" bin (if (version< version "8.3.0") "" "--strip-cwd-prefix")) - (if IS-WINDOWS " --path-separator=/")))) + (if doom--system-windows-p " --path-separator=/")))) ;; Otherwise, resort to ripgrep, which is also faster than find ((executable-find "rg" t) (concat "rg -0 --files --follow --color=never --hidden -g!.git" - (if IS-WINDOWS " --path-separator=/"))) + (if doom--system-windows-p " --path-separator=/"))) ("find . -type f -print0")))) (defadvice! doom--projectile-default-generic-command-a (fn &rest args) diff --git a/lisp/doom-start.el b/lisp/doom-start.el index a3777b47b..5a68dd036 100644 --- a/lisp/doom-start.el +++ b/lisp/doom-start.el @@ -120,7 +120,7 @@ ;; focus when it is started, among other things, so enable the menu-bar for ;; GUI frames, but keep it disabled in terminal frames because there it ;; activates an ugly, in-frame menu bar. -(eval-when! IS-MAC +(eval-when! doom--system-macos-p (add-hook! '(window-setup-hook after-make-frame-functions) (defun doom-restore-menu-bar-in-gui-frames-h (&optional frame) (when-let (frame (or frame (selected-frame))) @@ -137,7 +137,7 @@ (setq default-input-method nil) ;; ...And the clipboard on Windows could be in a wider encoding (UTF-16), so ;; leave Emacs to its own devices. -(eval-when! IS-WINDOWS +(eval-when! (not doom--system-windows-p) (setq selection-coding-system 'utf-8)) diff --git a/lisp/doom.el b/lisp/doom.el index 17fc2e32f..d6812e6f2 100644 --- a/lisp/doom.el +++ b/lisp/doom.el @@ -107,7 +107,30 @@ "recompile it.") emacs-version old-version))) -;;; Custom features +;;; Custom features & global constants +;; Doom has its own features that its modules, CLI, and user extensions can +;; announce, and don't belong in `features', so they are stored here, which can +;; include information about the external system environment. +(defconst doom-features + (pcase system-type + ('darwin '(macos bsd)) + ((or 'cygwin 'windows-nt 'ms-dos) '(windows)) + ((or 'gnu 'gnu/linux) '(linux)) + ((or 'gnu/kfreebsd 'berkeley-unix) '(linux bsd))) + "A list of symbols denoting available features in the active Doom profile.") + +;; Convenience aliases for internal use only (may be removed later). +(defconst doom-system (car doom-features)) +(defconst doom--system-windows-p (eq 'windows doom-system)) +(defconst doom--system-macos-p (eq 'macos doom-system)) +(defconst doom--system-linux-p (eq 'linux doom-system)) + +;; `system-type' is esoteric, so I create a pseudo feature as a stable and +;; consistent alternative, and all while using the same `featurep' interface +;; we're already familiar with. +(push :system features) +(put :system 'subfeatures doom-features) + ;; Emacs needs a more consistent way to detect build features, and the docs ;; claim `system-configuration-features' is not da way. Some features (that ;; don't represent packages) can be found in `features' (which `featurep' @@ -126,25 +149,30 @@ (if (not (native-comp-available-p)) (delq 'native-compile features))) -;;; Global constants ;; DEPRECATED remove in v3 -(defconst IS-MAC (eq system-type 'darwin)) -(defconst IS-LINUX (memq system-type '(gnu gnu/linux gnu/kfreebsd berkeley-unix))) -(defconst IS-WINDOWS (memq system-type '(cygwin windows-nt ms-dos))) -(defconst IS-BSD (memq system-type '(darwin berkeley-unix gnu/kfreebsd))) -(defconst EMACS28+ (> emacs-major-version 27)) -(defconst EMACS29+ (> emacs-major-version 28)) -(defconst MODULES (featurep 'dynamic-modules)) -(defconst NATIVECOMP (featurep 'native-compile)) +(with-no-warnings + (defconst IS-MAC doom--system-macos-p) + (defconst IS-LINUX doom--system-linux-p) + (defconst IS-WINDOWS doom--system-windows-p) + (defconst IS-BSD (memq 'bsd doom-features)) + (defconst EMACS28+ (> emacs-major-version 27)) + (defconst EMACS29+ (> emacs-major-version 28)) + (defconst MODULES (featurep 'dynamic-modules)) + (defconst NATIVECOMP (featurep 'native-compile)) + + (make-obsolete-variable 'IS-MAC "Use (featurep :system 'macos) instead" "3.0.0") + (make-obsolete-variable 'IS-LINUX "Use (featurep :system 'linux) instead" "3.0.0") + (make-obsolete-variable 'IS-WINDOWS "Use (featurep :system 'windows) instead" "3.0.0") + (make-obsolete-variable 'IS-BSD "Use (featurep :system 'bsd) instead" "3.0.0") + (make-obsolete-variable 'EMACS28+ "Use (>= emacs-major-version 28) instead" "3.0.0") + (make-obsolete-variable 'EMACS29+ "Use (>= emacs-major-version 29) instead" "3.0.0") + (make-obsolete-variable 'MODULES "Use (featurep 'dynamic-modules) instead" "3.0.0") + (make-obsolete-variable 'NATIVECOMP "Use (featurep 'native-compile) instead" "3.0.0")) -(make-obsolete-variable 'EMACS28+ "Use (>= emacs-major-version 28) instead" "3.0.0") -(make-obsolete-variable 'EMACS29+ "Use (>= emacs-major-version 29) instead" "3.0.0") -(make-obsolete-variable 'MODULES "Use (featurep 'dynamic-modules) instead" "3.0.0") -(make-obsolete-variable 'NATIVECOMP "Use (featurep 'native-compile) instead" "3.0.0") ;;; Fix $HOME on Windows ;; $HOME isn't normally defined on Windows, but many unix tools expect it. -(when IS-WINDOWS +(when doom--system-windows-p (when-let (realhome (and (null (getenv-internal "HOME")) (getenv "USERPROFILE"))) @@ -228,7 +256,7 @@ These files should not be shared across systems. By default, it is used by (define-obsolete-variable-alias 'doom-etc-dir 'doom-data-dir "3.0.0") (defvar doom-data-dir (if doom-profile - (if IS-WINDOWS + (if doom--system-windows-p (expand-file-name "doomemacs/data/" (getenv-internal "APPDATA")) (expand-file-name "doom/" (or (getenv-internal "XDG_DATA_HOME") "~/.local/share"))) ;; DEPRECATED: .local will be removed entirely in 3.0 @@ -247,7 +275,7 @@ For profile-local data files, use `doom-profile-data-dir' instead.") (defvar doom-cache-dir (if doom-profile - (if IS-WINDOWS + (if doom--system-windows-p (expand-file-name "doomemacs/cache/" (getenv-internal "APPDATA")) (expand-file-name "doom/" (or (getenv-internal "XDG_CACHE_HOME") "~/.cache"))) ;; DEPRECATED: .local will be removed entirely in 3.0 @@ -266,7 +294,7 @@ For profile-local cache files, use `doom-profile-cache-dir' instead.") (defvar doom-state-dir (if doom-profile - (if IS-WINDOWS + (if doom--system-windows-p (expand-file-name "doomemacs/state/" (getenv-internal "APPDATA")) (expand-file-name "doom/" (or (getenv-internal "XDG_STATE_HOME") "~/.local/state"))) ;; DEPRECATED: .local will be removed entirely in 3.0 @@ -470,8 +498,8 @@ users).") (add-transient-hook! 'tool-bar-mode (tool-bar-setup))) ;; PERF: Unset a non-trivial list of command line options that aren't - ;; relevant to our current OS, but `command-line-1' still processes. - (unless IS-MAC + ;; relevant to this session, but `command-line-1' still processes. + (unless doom--system-macos-p (setq command-line-ns-option-alist nil)) (unless (memq initial-window-system '(x pgtk)) (setq command-line-x-option-alist nil))))) @@ -649,7 +677,7 @@ of 'doom sync' or 'doom gc'." gnutls-algorithm-priority (when (boundp 'libgnutls-version) (concat "SECURE128:+SECURE192:-VERS-ALL" - (if (and (not IS-WINDOWS) + (if (and (not doom--system-windows-p) (>= libgnutls-version 30605)) ":+VERS-TLS1.3") ":+VERS-TLS1.2")) @@ -713,6 +741,8 @@ appropriately against `noninteractive' or the `cli' context." (defun doom--begin-init-h () "Begin the startup process." (when (doom-context-push 'init) + ;; HACK: Ensure OS checks are as fast as possible (given their ubiquity). + (setq features (cons :system (delq :system features))) ;; Remember these variables' initial values, so we can safely reset them at ;; a later time, or consult them without fear of contamination. (dolist (var '(exec-path load-path process-environment)) diff --git a/lisp/lib/system.el b/lisp/lib/system.el index 7a07d1975..0c8d7ea61 100644 --- a/lisp/lib/system.el +++ b/lisp/lib/system.el @@ -4,8 +4,8 @@ (defun doom-system-distro () "Return a symbol representing the installed distro." (with-memoization (get 'doom-system-distro 'cached-value) - (cond (IS-WINDOWS 'windows) - (IS-MAC 'macos) + (cond (doom--system-windows-p 'windows) + (doom--system-macos-p 'macos) ((ignore-errors (with-file-contents! "/etc/os-release" (when (re-search-forward "^ID=\"?\\([^\"\n]+\\)\"?" nil t) diff --git a/modules/app/everywhere/doctor.el b/modules/app/everywhere/doctor.el index 8e7223710..db697d65e 100644 --- a/modules/app/everywhere/doctor.el +++ b/modules/app/everywhere/doctor.el @@ -1,9 +1,9 @@ ;;; app/everywhere/doctor.el -*- lexical-binding: t; -*- -(when IS-WINDOWS +(when (featurep :system 'windows) (error! "emacs-everywhere package does not support windows.")) -(when IS-LINUX +(when (featurep :system 'linux) (let (unmet-deps) (dolist (dep '("xclip" "xdotool" "xprop" "xwininfo")) (unless (executable-find dep) diff --git a/modules/app/irc/config.el b/modules/app/irc/config.el index bf1d73cf1..35133b887 100644 --- a/modules/app/irc/config.el +++ b/modules/app/irc/config.el @@ -187,8 +187,8 @@ playback.") (setq circe-notifications-watch-strings +irc-notifications-watch-strings circe-notifications-emacs-focused nil circe-notifications-alert-style - (cond (IS-MAC 'osx-notifier) - (IS-LINUX 'libnotify) + (cond ((featurep :system 'macos) 'osx-notifier) + ((featurep :system 'linux) 'libnotify) (circe-notifications-alert-style)))) diff --git a/modules/checkers/grammar/config.el b/modules/checkers/grammar/config.el index 174298f5e..64f7ec911 100644 --- a/modules/checkers/grammar/config.el +++ b/modules/checkers/grammar/config.el @@ -13,7 +13,7 @@ (cond ((setq langtool-bin (or (executable-find "languagetool-commandline") (executable-find "languagetool")))) ; for nixpkgs.languagetool - (IS-MAC + ((featurep :system 'macos) (cond ;; is user using home brew? ((file-directory-p "/usr/local/Cellar/languagetool") @@ -25,7 +25,7 @@ ;; macports compatibility ((file-directory-p "/opt/local/share/java/LanguageTool") (setq langtool-java-classpath "/opt/local/share/java/LanguageTool/*")))) - (IS-LINUX + ((featurep :system 'linux) (setq langtool-java-classpath "/usr/share/languagetool:/usr/share/java/languagetool/*"))))) diff --git a/modules/completion/helm/config.el b/modules/completion/helm/config.el index 39dd73c91..7f983f872 100644 --- a/modules/completion/helm/config.el +++ b/modules/completion/helm/config.el @@ -148,7 +148,7 @@ Can be negative.") (defvar helm-generic-files-map (make-sparse-keymap)) (after! helm-locate - (when (and IS-MAC + (when (and (featurep :system 'macos) (null helm-locate-command) (executable-find "mdfind")) (setq helm-locate-command "mdfind -name %s")) diff --git a/modules/completion/ivy/config.el b/modules/completion/ivy/config.el index e1a758dc8..e537abf81 100644 --- a/modules/completion/ivy/config.el +++ b/modules/completion/ivy/config.el @@ -237,7 +237,7 @@ results buffer.") (add-to-list 'ivy-sort-functions-alist '(counsel-imenu)) ;; `counsel-locate' - (when IS-MAC + (when (featurep :system 'macos) ;; Use spotlight on mac by default since it doesn't need any additional setup (setq counsel-locate-cmd #'counsel-locate-cmd-mdfind)) @@ -276,13 +276,13 @@ results buffer.") (cl-loop for dir in projectile-globally-ignored-directories collect "--exclude" collect dir) - (if IS-WINDOWS '("--path-separator=/"))))) + (if (featurep :system 'windows) '("--path-separator=/"))))) ((executable-find "rg" t) (append (list "rg" "--hidden" "--files" "--follow" "--color=never" "--no-messages") (cl-loop for dir in projectile-globally-ignored-directories collect "--glob" collect (concat "!" dir)) - (if IS-WINDOWS '("--path-separator=/")))) + (if (featurep :system 'windows) '("--path-separator=/")))) ((cons find-program args))) (unless (listp args) (user-error "`counsel-file-jump-args' is a list now, please customize accordingly.")) diff --git a/modules/completion/vertico/config.el b/modules/completion/vertico/config.el index e92b9ec47..f92bd85a2 100644 --- a/modules/completion/vertico/config.el +++ b/modules/completion/vertico/config.el @@ -153,7 +153,7 @@ orderless." ;; https://github.com/sharkdp/fd/issues/839 "--full-path --absolute-path" "--hidden --exclude .git" - (when IS-WINDOWS "--path-separator=/")))) + (if (featurep :system 'windows) "--path-separator=/")))) (consult-customize consult-ripgrep consult-git-grep consult-grep diff --git a/modules/config/default/+evil-bindings.el b/modules/config/default/+evil-bindings.el index a62541d4c..c79c078f6 100644 --- a/modules/config/default/+evil-bindings.el +++ b/modules/config/default/+evil-bindings.el @@ -228,7 +228,7 @@ :g "M-8" #'+workspace/switch-to-7 :g "M-9" #'+workspace/switch-to-8 :g "M-0" #'+workspace/switch-to-final - (:when IS-MAC + (:when (featurep :system 'macos) :g "s-t" #'+workspace/new :g "s-T" #'+workspace/display :n "s-1" #'+workspace/switch-to-0 diff --git a/modules/config/default/autoload/default.el b/modules/config/default/autoload/default.el index d49ea8643..a1f645b81 100644 --- a/modules/config/default/autoload/default.el +++ b/modules/config/default/autoload/default.el @@ -24,7 +24,7 @@ If ARG (universal argument), runs `compile' from the current directory." generate `completing-read' candidates." (interactive) (call-interactively - (if (and (not IS-MAC) (executable-find "man")) + (if (and (not (featurep :system 'macos)) (executable-find "man")) (or (command-remapping #'man) #'man) #'woman))) diff --git a/modules/config/default/config.el b/modules/config/default/config.el index 14bed119c..e67adf1e3 100644 --- a/modules/config/default/config.el +++ b/modules/config/default/config.el @@ -81,7 +81,7 @@ ;;;###package tramp -(unless IS-WINDOWS +(unless (featurep :system 'windows) (setq tramp-default-method "ssh")) ; faster than the default scp @@ -300,7 +300,7 @@ Continues comments if executed from a commented line. Consults (define-key tabulated-list-mode-map "q" #'quit-window)) ;; OS specific fixes -(when IS-MAC +(when (featurep :system 'macos) ;; Fix MacOS shift+tab (define-key key-translation-map [S-iso-lefttab] [backtab]) ;; Fix conventional OS keys in Emacs @@ -487,7 +487,7 @@ Continues comments if executed from a commented line. Consults :gi "C-S-RET" #'+default/newline-above :gn [C-S-return] #'+default/newline-above - (:when IS-MAC + (:when (featurep :system 'macos) :gn "s-RET" #'+default/newline-below :gn [s-return] #'+default/newline-below :gn "S-s-RET" #'+default/newline-above diff --git a/modules/editor/format/autoload/format.el b/modules/editor/format/autoload/format.el index 90929cb22..63b932f4e 100644 --- a/modules/editor/format/autoload/format.el +++ b/modules/editor/format/autoload/format.el @@ -17,7 +17,7 @@ (indent 0)) (with-current-buffer formatted-buffer (erase-buffer) - (unless IS-WINDOWS + (unless (featurep :system 'windows) (setq-local coding-system-for-read 'utf-8) (setq-local coding-system-for-write 'utf-8)) ;; Ensure this temp buffer seems as much like the origin buffer as diff --git a/modules/editor/multiple-cursors/config.el b/modules/editor/multiple-cursors/config.el index 107844ed4..cbc4e0d0f 100644 --- a/modules/editor/multiple-cursors/config.el +++ b/modules/editor/multiple-cursors/config.el @@ -74,8 +74,7 @@ (apply fn args))) ;; REVIEW This is tremendously slow on macos and windows for some reason. - (setq evil-mc-enable-bar-cursor (not (or IS-MAC - IS-WINDOWS))) + (setq evil-mc-enable-bar-cursor (featurep :system 'linux)) (after! smartparens ;; Make evil-mc cooperate with smartparens better diff --git a/modules/editor/parinfer/config.el b/modules/editor/parinfer/config.el index a11155393..f76c71a28 100644 --- a/modules/editor/parinfer/config.el +++ b/modules/editor/parinfer/config.el @@ -11,12 +11,13 @@ hy-mode) . parinfer-rust-mode) :init (setq parinfer-rust-library - (concat doom-data-dir "parinfer-rust/" - (cond (IS-MAC "parinfer-rust-darwin.so") - (IS-LINUX "parinfer-rust-linux.so") - (IS-WINDOWS "parinfer-rust-windows.dll") - (IS-BSD "libparinfer_rust.so"))) - parinfer-rust-auto-download (not IS-BSD)) + (file-name-concat + doom-data-dir "parinfer-rust/" + (cond ((featurep :system 'macos) "parinfer-rust-darwin.so") + ((featurep :system 'linux) "parinfer-rust-linux.so") + ((featurep :system 'windows) "parinfer-rust-windows.dll") + ((featurep :system 'bsd) "libparinfer_rust.so"))) + parinfer-rust-auto-download (not (featurep :system 'bsd))) :config (map! :map parinfer-rust-mode-map :localleader diff --git a/modules/emacs/dired/config.el b/modules/emacs/dired/config.el index fe1404ee5..11eab8a36 100644 --- a/modules/emacs/dired/config.el +++ b/modules/emacs/dired/config.el @@ -29,7 +29,7 @@ (set-evil-initial-state! 'image-dired-display-image-mode 'emacs) (let ((args (list "-ahl" "-v" "--group-directories-first"))) - (when IS-BSD + (when (featurep :system 'bsd) ;; Use GNU ls as `gls' from `coreutils' if available. Add `(setq ;; dired-use-ls-dired nil)' to your config to suppress the Dired warning ;; when not using GNU ls. @@ -188,9 +188,9 @@ we have to clean it up ourselves." ;; deleted directory. Of course I do! (setq dired-clean-confirm-killing-deleted-buffers nil) ;; Let OS decide how to open certain files - (when-let (cmd (cond (IS-MAC "open") - (IS-LINUX "xdg-open") - (IS-WINDOWS "start"))) + (when-let (cmd (cond ((featurep :system 'macos) "open") + ((featurep :system 'linux) "xdg-open") + ((featurep :system 'windows) "start"))) (setq dired-guess-shell-alist-user `(("\\.\\(?:docx\\|pdf\\|djvu\\|eps\\)\\'" ,cmd) ("\\.\\(?:jpe?g\\|png\\|gif\\|xpm\\)\\'" ,cmd) diff --git a/modules/emacs/dired/doctor.el b/modules/emacs/dired/doctor.el index 2c2e77b29..bb157a484 100644 --- a/modules/emacs/dired/doctor.el +++ b/modules/emacs/dired/doctor.el @@ -1,4 +1,4 @@ ;;; emacs/dired/doctor.el -*- lexical-binding: t; -*- -(when (and IS-BSD (not (executable-find "gls"))) +(when (and (featurep :system 'bsd) (not (executable-find "gls"))) (warn! "Cannot find gls (GNU ls). This may cause issues with dired")) diff --git a/modules/emacs/vc/config.el b/modules/emacs/vc/config.el index 0fef2c56f..3ea79365c 100644 --- a/modules/emacs/vc/config.el +++ b/modules/emacs/vc/config.el @@ -5,7 +5,7 @@ ;; 2021, amirite? (setq-default vc-handled-backends '(SVN Git Hg)) -(when IS-WINDOWS +(when (featurep :system 'windows) (setenv "GIT_ASKPASS" "git-gui--askpass")) ;; In case the user is using `bug-reference-mode' diff --git a/modules/email/mu4e/autoload/advice.el b/modules/email/mu4e/autoload/advice.el index 29b24d502..d39eaa424 100644 --- a/modules/email/mu4e/autoload/advice.el +++ b/modules/email/mu4e/autoload/advice.el @@ -6,7 +6,7 @@ (defun +org-msg-img-scale-css (img-uri) "For a given IMG-URI, use imagemagick to find its width." (if +org-msg-currently-exporting - (when (and (not IS-WINDOWS)) ; relies on posix path + (when (and (not (featurep :system 'windows))) ; relies on posix path (let ((width-call (and (executable-find "identify") (doom-call-process "identify" "-format" "%w" (substring img-uri 7))))) ; 7=(length "file://") diff --git a/modules/email/mu4e/config.el b/modules/email/mu4e/config.el index 9f2791271..f4f6d9c5b 100644 --- a/modules/email/mu4e/config.el +++ b/modules/email/mu4e/config.el @@ -365,7 +365,7 @@ This should already be the case yet it does not always seem to be." (read-only-mode -1)) ;; process lock control - (when IS-WINDOWS + (when (featurep :system 'windows) (setq +mu4e-lock-file (expand-file-name "~/AppData/Local/Temp/mu4e_lock") +mu4e-lock-request-file (expand-file-name "~/AppData/Local/Temp/mu4e_lock_request"))) @@ -696,7 +696,7 @@ See `+mu4e-msg-gmail-p' and `mu4e-sent-messages-behavior'.") t))) mails))) - (when IS-LINUX + (when (featurep :system 'linux) (mu4e-alert-set-default-style 'libnotify) (defvar +mu4e-alert-bell-cmd '("paplay" . "/usr/share/sounds/freedesktop/stereo/message.oga") diff --git a/modules/email/mu4e/doctor.el b/modules/email/mu4e/doctor.el index bfe18dc4c..24f7c5381 100644 --- a/modules/email/mu4e/doctor.el +++ b/modules/email/mu4e/doctor.el @@ -9,7 +9,7 @@ You may not have a way of fetching mail.")) (when (and (modulep! +org) - (not IS-WINDOWS)) + (not (featurep :system 'windows))) (unless (executable-find "identify") (warn! "Couldn't find the identify command from imagemagick. \ LaTeX fragment re-scaling with org-msg will not work."))) diff --git a/modules/lang/cc/config.el b/modules/lang/cc/config.el index 75f74a55b..81514b2a9 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 IS-MAC + (when (featurep :system 'macos) ;; 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++) @@ -286,7 +286,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 IS-MAC + (when (featurep :system 'macos) (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" @@ -313,12 +313,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 IS-MAC - IS-LINUX) + (when (or (featurep :system 'macos) + (featurep :system 'linux)) (setq ccls-initialization-options `(:index (:trackDependency 1 :threads ,(max 1 (/ (doom-system-cpus) 2)))))) - (when IS-MAC + (when (featurep :system 'macos) (setq ccls-initialization-options (append ccls-initialization-options `(:clang ,(list :extraArgs ["-isystem/Library/Developer/CommandLineTools/usr/include/c++/v1" diff --git a/modules/lang/latex/+viewers.el b/modules/lang/latex/+viewers.el index e4c0787a3..f1d439c4b 100644 --- a/modules/lang/latex/+viewers.el +++ b/modules/lang/latex/+viewers.el @@ -9,7 +9,7 @@ (`skim (when-let (app-path - (and IS-MAC + (and (featurep :system 'macos) (file-exists-p! (or "/Applications/Skim.app" "~/Applications/Skim.app")))) (add-to-list 'TeX-view-program-selection '(output-pdf "Skim")) @@ -18,7 +18,7 @@ app-path))))) (`sumatrapdf - (when (and IS-WINDOWS + (when (and (featurep :system 'windows) (executable-find "SumatraPDF")) (add-to-list 'TeX-view-program-selection '(output-pdf "SumatraPDF")))) @@ -40,7 +40,7 @@ (`pdf-tools (when (modulep! :tools pdf) (add-to-list 'TeX-view-program-selection '(output-pdf "PDF Tools")) - (when IS-MAC + (when (featurep :system 'macos) ;; PDF Tools isn't in `TeX-view-program-list-builtin' on macs. (add-to-list 'TeX-view-program-list '("PDF Tools" TeX-pdf-tools-sync-view))) ;; Update PDF buffers after successful LaTeX runs. diff --git a/modules/lang/lua/autoload/lua.el b/modules/lang/lua/autoload/lua.el index 0e359d0d7..c519cbab5 100644 --- a/modules/lang/lua/autoload/lua.el +++ b/modules/lang/lua/autoload/lua.el @@ -5,7 +5,7 @@ (format "%s %s" (if (executable-find "love") "love" - (if IS-MAC "open -a love.app")) + (if (featurep :system 'macos) "open -a love.app")) (shell-quote-argument root)))) ;;;###autoload diff --git a/modules/lang/lua/config.el b/modules/lang/lua/config.el index f93a10611..7d04fd665 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 (IS-MAC "bin/macOS") - (IS-LINUX "bin/Linux") - (IS-WINDOWS "bin/Windows")) + (cond ((featurep :system 'macos) "bin/macOS") + ((featurep :system 'linux) "bin/Linux") + ((featurep :system 'windows) "bin/Windows")) "lua-language-server")) "-E" "-e" "LANG=en" (doom-path +lua-lsp-dir "main.lua"))) diff --git a/modules/lang/markdown/config.el b/modules/lang/markdown/config.el index 6182d8eb1..9461635c9 100644 --- a/modules/lang/markdown/config.el +++ b/modules/lang/markdown/config.el @@ -32,8 +32,8 @@ capture, the end position, and the output buffer.") ;; This is set to `nil' by default, which causes a wrong-type-arg error ;; when you use `markdown-open'. These are more sensible defaults. markdown-open-command - (cond (IS-MAC "open") - (IS-LINUX "xdg-open")) + (cond ((featurep :system 'macos) "open") + ((featurep :system 'linux) "xdg-open")) ;; A sensible and simple default preamble for markdown exports that ;; takes after the github asthetic (plus highlightjs syntax coloring). diff --git a/modules/lang/nim/config.el b/modules/lang/nim/config.el index d15c271c5..ddaf986f3 100644 --- a/modules/lang/nim/config.el +++ b/modules/lang/nim/config.el @@ -14,7 +14,7 @@ nimsuggest isn't installed." (set-formatter! 'nmfmt '("nimfmt" filepath) :modes '(nim-mode)) - (when IS-WINDOWS + (when (featurep :system 'windows) ;; TODO File PR/report upstream (https://github.com/nim-lang/nim-mode) (defadvice! +nim--suggest-get-temp-file-name-a (path) "Removes invalid characters from the temp file path, including the unicode diff --git a/modules/lang/org/autoload/org-capture.el b/modules/lang/org/autoload/org-capture.el index 1430d2336..c00bf2755 100644 --- a/modules/lang/org/autoload/org-capture.el +++ b/modules/lang/org/autoload/org-capture.el @@ -15,12 +15,12 @@ (width . 70) (height . 25) (transient . t) - ,@(when IS-LINUX + ,@(when (featurep :system 'linux) `((window-system . ,(if (boundp 'pgtk-initialized) 'pgtk 'x)) (display . ,(or (getenv "WAYLAND_DISPLAY") (getenv "DISPLAY") ":0")))) - ,(if IS-MAC '(menu-bar-lines . 1))) + ,(if (featurep :system 'macos) '(menu-bar-lines . 1))) "TODO") ;;;###autoload diff --git a/modules/lang/org/autoload/org-export.el b/modules/lang/org/autoload/org-export.el index 5641d8a80..471b59eb0 100644 --- a/modules/lang/org/autoload/org-export.el +++ b/modules/lang/org/autoload/org-export.el @@ -3,13 +3,14 @@ (defun +org--yank-html-buffer (buffer) (with-current-buffer buffer (require 'ox-clip) - (cond ((or IS-WINDOWS IS-MAC) + (cond ((or (featurep :system 'windows) + (featurep :system 'macos)) (shell-command-on-region (point-min) (point-max) - (cond (IS-WINDOWS ox-clip-w32-cmd) - (IS-MAC ox-clip-osx-cmd)))) - (IS-LINUX + (cond ((featurep :system 'windows) ox-clip-w32-cmd) + ((featurep :system 'macos) ox-clip-osx-cmd)))) + ((featurep :system 'linux) (let ((html (buffer-string))) (with-temp-file (make-temp-file "ox-clip-md" nil ".html") (insert html)) diff --git a/modules/lang/org/config.el b/modules/lang/org/config.el index 6d162f428..aae33583c 100644 --- a/modules/lang/org/config.el +++ b/modules/lang/org/config.el @@ -507,7 +507,7 @@ relative to `org-directory', unless it is an absolute path." "file" :face (lambda (path) (if (or (file-remote-p path) ;; filter out network shares on windows (slow) - (if IS-WINDOWS (string-prefix-p "\\\\" path)) + (if (featurep :system 'windows) (string-prefix-p "\\\\" path)) (file-exists-p path)) 'org-link '(warning org-link)))) @@ -931,7 +931,7 @@ between the two." [C-return] #'+org/insert-item-below [C-S-return] #'+org/insert-item-above [C-M-return] #'org-insert-subheading - (:when IS-MAC + (:when (featurep :system 'macos) [s-return] #'+org/insert-item-below [s-S-return] #'+org/insert-item-above [s-M-return] #'org-insert-subheading) @@ -1391,7 +1391,7 @@ between the two." "Advise `server-visit-files' to load `org-protocol' lazily." :around #'server-visit-files (if (not (cl-loop with protocol = - (if IS-WINDOWS + (if (featurep :system 'windows) ;; On Windows, the file arguments for `emacsclient' ;; get funnelled through `expand-file-path' by ;; `server-process-filter'. This substitutes diff --git a/modules/lang/org/contrib/dragndrop.el b/modules/lang/org/contrib/dragndrop.el index e233619b3..fb3dcae11 100644 --- a/modules/lang/org/contrib/dragndrop.el +++ b/modules/lang/org/contrib/dragndrop.el @@ -26,8 +26,8 @@ (setq org-download-method 'attach org-download-timestamp "_%Y%m%d_%H%M%S" org-download-screenshot-method - (cond (IS-MAC "screencapture -i %s") - (IS-LINUX + (cond ((featurep :system 'macos) "screencapture -i %s") + ((featurep :system 'linux) (cond ((executable-find "maim") "maim -s %s") ((executable-find "scrot") "scrot -s %s") ((executable-find "gnome-screenshot") "gnome-screenshot -a -f %s")))) diff --git a/modules/lang/org/contrib/ipython.el b/modules/lang/org/contrib/ipython.el index c8047cf37..9b2016bc0 100644 --- a/modules/lang/org/contrib/ipython.el +++ b/modules/lang/org/contrib/ipython.el @@ -33,7 +33,7 @@ (advice-add #'org-babel-ipython-initiate-session :override #'+org-ob-ipython-initiate-session-a) ;; retina resolution image hack - (when IS-MAC + (when (featurep :system 'macos) (advice-add #'ob-ipython--write-base64-string :around #'+org-ob-ipython-write-base64-string-a)) ;; ipython has its own async keyword, disable ipython in ob-async. diff --git a/modules/lang/org/doctor.el b/modules/lang/org/doctor.el index 38e659fe3..b32bfd294 100644 --- a/modules/lang/org/doctor.el +++ b/modules/lang/org/doctor.el @@ -16,10 +16,10 @@ Migrate your notes to org-roam-v2 and switch to the +roam2 flag (see the module (warn! "Couldn't find the dot executable (from graphviz). org-roam will not be able to generate graph visualizations."))) (when (modulep! +dragndrop) - (when IS-MAC + (when (featurep :system 'macos) (unless (executable-find "pngpaste") (warn! "Couldn't find the pngpaste executable. org-download-clipboard will not work."))) - (when IS-LINUX + (when (featurep :system 'linux) (unless (or (executable-find "maim") (executable-find "scrot") (executable-find "gnome-screenshot")) (warn! "Couldn't find the maim, scrot or gnome-screenshot executable. org-download-clipboard will not work.")) (if (string= "wayland" (getenv "XDG_SESSION_TYPE")) @@ -27,6 +27,6 @@ Migrate your notes to org-roam-v2 and switch to the +roam2 flag (see the module (warn! "Couldn't find the wl-paste executable (from wl-clipboard). org-download-clipboard will not work.")) (unless (executable-find "xclip") (warn! "Couldn't find the xclip executable. org-download-clipboard will not work.")))) - (when IS-WINDOWS + (when (featurep :system 'windows) (unless (executable-find "convert") (warn! "Couldn't find the convert program (from ImageMagick). org-download-clipboard will not work.")))) diff --git a/modules/lang/org/packages.el b/modules/lang/org/packages.el index ac75cc70d..e91a6defd 100644 --- a/modules/lang/org/packages.el +++ b/modules/lang/org/packages.el @@ -54,7 +54,7 @@ :type git :repo "https://repo.or.cz/org-contacts.git"))) -(when (and IS-MAC +(when (and (featurep :system 'macos) (modulep! :os macos)) (package! org-mac-link :pin "e30171a6e98db90787ab8a23b3a7dc4fd13b10f9")) diff --git a/modules/lang/sh/config.el b/modules/lang/sh/config.el index 5a5cd7ed5..8967e60e6 100755 --- a/modules/lang/sh/config.el +++ b/modules/lang/sh/config.el @@ -83,7 +83,7 @@ (set-company-backend! 'sh-mode '(company-shell company-files)) (setq company-shell-delete-duplicates t ;; whatis lookups are exceptionally slow on macOS (#5860) - company-shell-dont-fetch-meta IS-MAC)) + company-shell-dont-fetch-meta (featurep :system 'macos))) (use-package! powershell diff --git a/modules/os/macos/config.el b/modules/os/macos/config.el index 0644a1e0b..848aaf06c 100644 --- a/modules/os/macos/config.el +++ b/modules/os/macos/config.el @@ -48,6 +48,6 @@ (when (not (fboundp 'system-move-file-to-trash)) (defun system-move-file-to-trash (file) "Move FILE to trash." - (when (and (not IS-LINUX) + (when (and (not (featurep :system 'linux)) (not (file-remote-p default-directory))) (osx-trash-move-file-to-trash file))))) diff --git a/modules/os/tty/config.el b/modules/os/tty/config.el index 674c00fea..444b4ba0d 100644 --- a/modules/os/tty/config.el +++ b/modules/os/tty/config.el @@ -19,8 +19,8 @@ (add-hook 'tty-setup-hook #'xterm-mouse-mode) ;; Windows terminals don't support what I'm about to do, but best not to wrap -;; this in a IS-WINDOWS check, in case you're using WSL or Cygwin, which do and -;; *might* support it. +;; this in an OS check, in case you're using WSL or Cygwin, which *might* +;; support it. (add-hook! 'tty-setup-hook (defun doom-init-clipboard-in-tty-emacs-h () ;; Fix the clipboard in tty Emacs by... diff --git a/modules/term/eshell/config.el b/modules/term/eshell/config.el index af7633082..f8e69ed2b 100644 --- a/modules/term/eshell/config.el +++ b/modules/term/eshell/config.el @@ -242,7 +242,7 @@ Emacs versions < 29." (use-package! fish-completion - :unless IS-WINDOWS + :unless (featurep :system 'windows) :hook (eshell-mode . fish-completion-mode) :init (setq fish-completion-fallback-on-bash-p t fish-completion-inhibit-missing-fish-command-warning t)) diff --git a/modules/term/eshell/packages.el b/modules/term/eshell/packages.el index fc1385f0b..21cf6e767 100644 --- a/modules/term/eshell/packages.el +++ b/modules/term/eshell/packages.el @@ -8,6 +8,6 @@ (package! eshell-did-you-mean :pin "80cd8c4b186a2fb29621cf634bcf2bcd914f1e3d") (package! eshell-syntax-highlighting :pin "4ac27eec6595ba116a6151dfaf0b0e0440101e10") -(unless IS-WINDOWS +(unless (featurep :system 'windows) (package! fish-completion :pin "d34d0b96fde63feedf13c4288183d8d4d4d748cf") (package! bash-completion :pin "f1daac0386c24cbe8a244a62c7588cc6847b07ae")) diff --git a/modules/tools/debugger/config.el b/modules/tools/debugger/config.el index 55ebd72be..8e914bc60 100644 --- a/modules/tools/debugger/config.el +++ b/modules/tools/debugger/config.el @@ -27,7 +27,7 @@ ((:lang rust +lsp) :after rustic-mode :require (dap-lldb dap-cpptools)) ((:lang javascript +lsp) :after (js2-mode typescript-mode) - :require (dap-node dap-chrome dap-firefox ,@(if IS-WINDOWS '(dap-edge))))) + :require (dap-node dap-chrome dap-firefox ,@(if (featurep :system 'windows) '(dap-edge))))) "TODO") diff --git a/modules/tools/lookup/autoload/lookup.el b/modules/tools/lookup/autoload/lookup.el index b72a52f4e..befd335fd 100644 --- a/modules/tools/lookup/autoload/lookup.el +++ b/modules/tools/lookup/autoload/lookup.el @@ -413,7 +413,7 @@ Otherwise, falls back on `find-file-at-point'." (read-string "Look up in dictionary: ")) current-prefix-arg)) (message "Looking up dictionary definition for %S" identifier) - (cond ((and IS-MAC (require 'osx-dictionary nil t)) + (cond ((and (featurep :system 'macos) (require 'osx-dictionary nil t)) (osx-dictionary--view-result identifier)) ((and +lookup-dictionary-prefer-offline (require 'wordnut nil t)) diff --git a/modules/tools/lookup/config.el b/modules/tools/lookup/config.el index 4c8daeca0..3a778332a 100644 --- a/modules/tools/lookup/config.el +++ b/modules/tools/lookup/config.el @@ -216,7 +216,7 @@ Dictionary.app behind the scenes to get definitions.") (use-package! define-word :when (modulep! +dictionary) - :unless IS-MAC + :unless (featurep :system 'macos) :defer t :config (setq define-word-displayfn-alist diff --git a/modules/tools/lookup/packages.el b/modules/tools/lookup/packages.el index 545a20fb1..98cff03a9 100644 --- a/modules/tools/lookup/packages.el +++ b/modules/tools/lookup/packages.el @@ -25,7 +25,7 @@ (package! counsel-dash :pin "8decb980f111ebe7027361ee252279a9076da261"))) (when (modulep! +dictionary) - (if IS-MAC + (if (featurep :system 'macos) (package! osx-dictionary :pin "0715e5a3ac659df32a0f0fabfbbeef0228fbd9a9") (package! define-word :pin "31a8c67405afa99d0e25e7c86a4ee7ef84a808fe") ;; REVIEW: This fork fixes SavchenkoValeriy/emacs-powerthesaurus#40. diff --git a/modules/ui/ligatures/config.el b/modules/ui/ligatures/config.el index e11d19579..6312493ba 100644 --- a/modules/ui/ligatures/config.el +++ b/modules/ui/ligatures/config.el @@ -157,7 +157,8 @@ and cannot run in." ;; using the same composition-function-table method ;; https://bitbucket.org/mituharu/emacs-mac/src/26c8fd9920db9d34ae8f78bceaec714230824dac/lisp/term/mac-win.el?at=master#lines-345:805 ;; so use that instead if this module is enabled. - ((and IS-MAC (fboundp 'mac-auto-operator-composition-mode)) + ((if (featurep :system 'macos) + (fboundp 'mac-auto-operator-composition-mode)) (add-hook 'doom-init-ui-hook #'mac-auto-operator-composition-mode 'append)) ;; NOTE: the module does not support Emacs 27 and less, but if we still try to enable ligatures, diff --git a/modules/ui/ligatures/doctor.el b/modules/ui/ligatures/doctor.el index 9ae683ab4..1b1534f67 100644 --- a/modules/ui/ligatures/doctor.el +++ b/modules/ui/ligatures/doctor.el @@ -1,7 +1,8 @@ ;; This cond expression mimics the activation conditional of ligatures, ;; with a fallback that triggers a warning. (cond - ((and IS-MAC (fboundp 'mac-auto-operator-composition-mode)) + ((if (featurep :system 'macos) + (fboundp 'mac-auto-operator-composition-mode)) (ignore)) ((and (> emacs-major-version 27) @@ -10,7 +11,6 @@ (featurep 'composite)) ; Emacs loads `composite' at startup (ignore)) - (t - (if IS-MAC - (warn! "The (:ui ligatures) module does not support your version of Emacs. Install emacs-plus with at least Emacs 28, or emacs-mac.") + ((if (featurep :system 'macos) + (warn! "The (:ui ligatures) module does not support your version of Emacs. Install emacs-plus with at least Emacs 28, or emacs-mac.") (warn! "The (:ui ligatures) module does not support your version of Emacs. Make sure to have at least Emacs 28 with Harfbuzz configured (should be the default).")))) diff --git a/modules/ui/modeline/+light.el b/modules/ui/modeline/+light.el index 8f96d9bf0..26515b65f 100644 --- a/modules/ui/modeline/+light.el +++ b/modules/ui/modeline/+light.el @@ -489,7 +489,7 @@ lines are selected, or the NxM dimensions of a block selection.") `(:eval (let ((sys (coding-system-plist buffer-file-coding-system)) (eol (coding-system-eol-type-mnemonic buffer-file-coding-system))) - (concat (unless (equal eol ,(if IS-WINDOWS "CRLF" "LF")) + (concat (unless (equal eol ,(if (featurep :system 'windows) "CRLF" "LF")) (concat " " eol " ")) (if (memq (plist-get sys :category) '(coding-category-undecided coding-category-utf-8)) diff --git a/modules/ui/modeline/config.el b/modules/ui/modeline/config.el index b58bf3eff..8aef20d7e 100644 --- a/modules/ui/modeline/config.el +++ b/modules/ui/modeline/config.el @@ -24,9 +24,7 @@ ;; than the current OSes preference doom-modeline-buffer-encoding 'nondefault doom-modeline-default-eol-type - (cond (IS-MAC 2) - (IS-WINDOWS 1) - (0))) + (pcase doom-system ('macos 2) ('windows 1) (_ 0))) :config ;; Fix an issue where these two variables aren't defined in TTY Emacs on MacOS diff --git a/templates/init.example.el b/templates/init.example.el index a55152d26..169604c3b 100644 --- a/templates/init.example.el +++ b/templates/init.example.el @@ -110,7 +110,7 @@ ;;upload ; map local to remote projects via ssh/ftp :os - (:if IS-MAC macos) ; improve compatibility with macOS + (:if (featurep :system 'macos) macos) ; improve compatibility with macOS ;;tty ; improve the terminal Emacs experience :lang