Ryan C. Thompson
Ryan C. Thompson

Reputation: 42040

Machine-specific emacs settings from a single config file?

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?

Upvotes: 5

Views: 313

Answers (1)

Daniel Pittman
Daniel Pittman

Reputation: 17202

The variables system-name and system-type will be helpful to you there; they let you write standard Lisp conditionals based on them. frame.el also has various bits of code that might be helpful - display-mm-width, for example, theoretically returns the physical size of the display.

See if and cond in the elisp reference if you need the specific Lisp constructs to work out how to express the decision.

Upvotes: 9

Related Questions