More on Setting the Emacs Frame Height

I got some really great comments to my Setting An Emacs Per-System Height post. If you are interested in automatically sizing your Emacs frames you should definitely take a look at them. Not all the suggestions are OS X specific so there’s good information no matter what platform you are using.

Unlike many people, I like to keep all my Emacs configuration in a single (init.el) file. Even so, I really liked this suggestion from Mark Hepburn: keep your system-specific and platform-specific configurations in separate files. So I put the configuration specific to my laptop, manfred, in a separate file (manfred.el) and similarly for aineko. Then I inserted

(load (car (split-string (system-name) "\\.")) t) ; load adds suffix

into my init.el to automatically load the system-specific configurations.

Similarly, rather than having commands such as

(when (macp)
  (setq ping-program-options '("-c" "4")))

scattered throughout my init.el, I put all those configurations into darwin.el and added

(load (symbol-name system-type) t)

to my init.el file.

This has the advantage of being easier to manage. Rather than constantly updating init.el to account for new systems or platforms, I need only add a <system>.el file and perhaps a <platform>.el file to a new machine. So far, I’m considering this an experiment but it feels right to me.

This entry was posted in General and tagged . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>