johnsu01 (johnsu01) wrote,
johnsu01
johnsu01

So that's how system-name works

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 127.0.0.1. 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.

Tags: #emacs, emacs, freerunner, lisp, openmoko
Subscribe
  • Post a new comment

    Error

    default userpic
    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 8 comments