Browse Source

Added macro for custom argument handling

master
Josh Wolfe 2 years ago
parent
commit
cbb516a7c2
1 changed files with 11 additions and 4 deletions
  1. 11
    4
      emacs/.emacs.d/README.org

+ 11
- 4
emacs/.emacs.d/README.org View File

@@ -138,10 +138,17 @@ This should be run regardless of whether I'm in terminal vs gui or dark vs light
#+BEGIN_SRC emacs-lisp :tangle yes
(setq custom-theme-directory "~/.emacs.d/themes")

(when (member "-light" command-line-args)
(setq wolfe/using-dark nil)
(setq wolfe/using-light t)
(setq command-line-args (delete "-light" command-line-args)))
(defmacro check-and-remove-command-line-arg (argument)
"Checks `command-line-args' for argument and removes it if found returning t or nil"
(if (member argument command-line-args)
(progn
(setq command-line-args (delete argument command-line-args))
t)
nil))

(let ((result (check-and-remove-command-line-arg "-light")))
(setq wolfe/using-light result)
(setq wolfe/using-dark (not result)))
#+END_SRC

** Dark

Loading…
Cancel
Save