Machine-defined emacs settings from a single configuration file?

I use the same Emacs configuration on multiple workstations synchronized via git. However, different workstations (and laptops) have different screen sizes and pixel densities, etc. Therefore, I need to have several settings specific to each machine. Is there a way to conditionally execute certain sections of my configuration only on certain machines, while keeping the configuration file the same for all of them?

+5
source share
1 answer

Variables system-name, and system-typewill be useful; they allow you to write standard Lisp conditional expressions based on them. frame.elalso has various bits of code that may be useful - display-mm-widthfor example, theoretically returns the physical size of the display.

See ifalso condin the elisp link if you need specific Lisp constructors to determine how to express this solution.

+9
source

All Articles