I am using the same Emacs config on multiple workstations, synchronized via git. However, different workstations (and laptops) have different screen sizes and pixel densities and such, so I need to have a few settings that are specific to each machine. Is there a way to conditionally execute certain sections of my config only on certain machines, while still keeping the config file identical across all of them?
I am using the same Emacs config on multiple workstations, synchronized via git. However,
Share
The variables
system-nameandsystem-typewill be helpful to you there; they let you write standard Lisp conditionals based on them.frame.elalso has various bits of code that might be helpful –display-mm-width, for example, theoretically returns the physical size of the display.See
ifandcondin the elisp reference if you need the specific Lisp constructs to work out how to express the decision.