Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Machine-specific emacs settings from a single config file?

Tags:

emacs

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?

like image 746
Ryan C. Thompson Avatar asked Mar 01 '12 23:03

Ryan C. Thompson


1 Answers

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.

like image 110
Daniel Pittman Avatar answered Oct 12 '22 22:10

Daniel Pittman