Skip to content

Instantly share code, notes, and snippets.

@fipar
Created September 11, 2023 18:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fipar/ee28c09afd1a1e7bc3db0dfc94979b5c to your computer and use it in GitHub Desktop.
Save fipar/ee28c09afd1a1e7bc3db0dfc94979b5c to your computer and use it in GitHub Desktop.
selectively execute elisp code depending on which machine I'm on
;; allow customizations per machine
(setq hostname (car (split-string system-name "\\.")))
(defmacro execute-on-machine (machine-name &rest body)
"Execute BODY only if the machine name matches MACHINE-NAME."
`(let ((current-machine hostname))
(when (string-equal current-machine ,machine-name)
,@body)))
(setq work-machine "mellotron")
(setq personal-machine "moog")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment