Posted on January 6th, 2011 in emacs | 2 Comments »
I love running Carbon Emacs locally as it gives me the ability to keep everything in one place. Thanks to gleaning much of my friend Pavel’s emacs settings, my emacs fullscreens (white on black) when loaded and gives me such things as the date, time, and battery life at the bottom. I have more colors than shell emacs, can open remote files using tramp, and most importantly can use my command key as meta. Life is good.
Sometimes though, its faster to just SSH right into a remote machine and work from there if I know I’ll be doing a lot of random file accessing / manipulating. The problem is: I’d love to keep all my .emacs preferences (colors, shortcuts, etc) wherever I go without having to maintain two versions.
Syncing is not really the issue here: rsync or dropbox will do the job, but some of my Carbon Emacs settings will throw errors when loading from shell emacs. I talked to the guys in #emacs on freenode on how to specify a different .emacs file for different version of emacs and it looks like you can’t really change where it gets loaded from. Ultimately, the best answer is to just use a when statement right in your preferences file.
display-graphic-p is the key here for detecting a window-system-based emacs:
;; load these only if using window-system emacs (when (display-graphic-p) ;; disables scrollbar (scroll-bar-mode -1) (menu-bar-mode -1) ;; disable the top toolbar (tool-bar-mode -1) (display-battery-mode 1))