From b727d4f684a2611351189e134b64fcef3661d9f8 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 11 May 2021 09:44:04 -0500 Subject: Add `acdw/system' macro `acdw/system' eases configuration -- it returns the system when called with no arguments, acts as a test with one argument, or as a `pcase' with more than one argument. --- init.el | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'init.el') diff --git a/init.el b/init.el index 74993fe..af817ee 100644 --- a/init.el +++ b/init.el @@ -66,7 +66,7 @@ ;; Flash the mode line (defun flash-mode-line () "Flash the modeline as a bell." - (when (eq acdw/system :home) + (when (acdw/system :home) (beep)) (invert-face 'mode-line) (run-with-timer 0.1 nil #'invert-face 'mode-line)) @@ -103,7 +103,7 @@ 'browse-url-default-browser) browse-url-new-window-flag t browse-url-firefox-new-window-is-tab t) - (when (eq acdw/system :work) + (when (acdw/system :work) (add-to-list 'exec-path "C:/Program Files/Mozilla Firefox"))) (setup buffers @@ -162,14 +162,14 @@ (:global "C-x C-j" dired-jump) - (pcase acdw/system - (:work (:straight w32-browser) - (autoload 'dired-w32-browser "w32-browser") - (:bind "RET" dired-w32-browser)) - (:home (:straight dired-open) - (require 'dired-open) - (:bind "RET" dired-find-alternate-file) - (:option (prepend dired-open-functions) #'dired-open-xdg))) + (acdw/system + (:work (:straight w32-browser) + (autoload 'dired-w32-browser "w32-browser") + (:bind "RET" dired-w32-browser)) + (:home (:straight dired-open) + (require 'dired-open) + (:bind "RET" dired-find-alternate-file) + (:option (prepend dired-open-functions) #'dired-open-xdg))) (:when-loaded (:straight dired-subtree) @@ -251,11 +251,11 @@ (set-terminal-coding-system 'utf-8-unix) (set-keyboard-coding-system 'utf-8-unix) - (pcase acdw/system - (:work (set-clipboard-coding-system 'utf-16-le) - (set-selection-coding-system 'utf-16-le)) - (_ (set-selection-coding-system 'utf-8) - (set-clipboard-coding-system 'utf-8)))) + (acdw/system + (:work (set-clipboard-coding-system 'utf-16-le) + (set-selection-coding-system 'utf-16-le)) + (_ (set-selection-coding-system 'utf-8) + (set-clipboard-coding-system 'utf-8)))) (setup eshell (:option eshell-directory-name (acdw/dir "eshell/" t) @@ -469,7 +469,7 @@ (setup saveplace (:option save-place-file (acdw/dir "places.el") - save-place-forget-unreadable-files (eq acdw/system :home)) + save-place-forget-unreadable-files (acdw/system :home)) (save-place-mode +1)) @@ -1017,7 +1017,7 @@ if ripgrep is installed, otherwise `consult-grep'." (:option undo-fu-session-incompatible-files '("/COMMIT_EDITMSG\\'" "/git-rebase-todo\\'") undo-fu-session-directory (acdw/dir "undo/" t) - undo-fu-session-compression (eq acdw/system :home)) + undo-fu-session-compression (acdw/system :home)) (global-undo-fu-session-mode +1)) @@ -1091,7 +1091,7 @@ call `zzz-to-char'." ;;; System-dependent ;;;; Home -(when (eq acdw/system :home) +(when (acdw/system :home) (setup (:straight pkgbuild-mode)) -- cgit 1.4.1-21-gabe81