Log in

No account? Create an account
Overloading the Machine -- Day [entries|friends|calendar]

[ website | wjsullivan.net ]
[ userinfo | livejournal userinfo ]
[ calendar | livejournal calendar ]

So that's how system-name works [06 Jan 2009|11:50pm]

I was doing some work tweaking emacs to be usable on my FreeRunner. I have one general .emacs file that I use on all machines, and that file looks for another machine-specific customization file:

(let ((site-file (concat "~/.emacs-" (system-name))))
  (if (file-exists-p site-file) (load-file site-file)))

That wasn't working right on the FreeRunner because (system-name) was returning "localhost", even though at the shell prompt, hostname and uname -n both returned the actual name (which is calvino).

Turns out (system-name) looks at /etc/hosts and takes the first name associated with Which was "localhost". Putting "calvino" before that on the line solved the problem (thanks, offby1).

It's weird using menus and a tool bar in emacs again, but it goes a long way toward making things workable. As does a pleasantly large and bold font.

8 comments|post comment

[ viewing | January 6th, 2009 ]
[ go | previous day|next day ]