emacs lisp, (--)
true, emacs .
.emacs
(if (display-graphic-p)
(load-GUI-theme)
(load-Terminal-theme))
, is-in-terminal
(defun is-in-terminal()
(not (display-graphic-p)))
,
(if (is-in-terminal)
(load-Terminal-theme)
(load-GUI-theme))
Terminal Only , , progn, , Emacs GUI
(defmacro when-term (&rest body)
"Works just like `progn' but will only evaluate expressions in VAR when Emacs is running in a terminal else just nil."
`(when (is-in-terminal) ,@body))
:
(when-term
(load-my-term-theme)
(set-some-keybindings)
(foo-bar))
, , .
, , :
https://github.com/jordonbiondo/Emacs/blob/master/Jorbi/jorbi-util.el