Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My ~/.emacs start-up file is stored in my AFS home directory. Often when I login to a linux machine I will forget to renew my AFS credentials before attempting to edit a local (non-AFS) file with Emacs.

When this happens Emacs will attempt to load ~./emacs but cannot because it is in AFS space where I do not have access. Eventually (after a minute or so) Emacs will give up trying to load ~./emacs and continue. But waiting for Emacs to timeout is annoying (typing Ctrl-Z does not seem to interrupt this timeout).

I want to shorten the amount of time that Emacs waits before giving up. I have tried the suggestion at this site which says to put the following code in the site-start.el file:

(with-timeout (4)
 (load remote-.emacs))

However, when I do that I get the error Error in init file: Symbol's value as variable is void: remote-\.emacs whenever starting Emacs.

How can I shorten this timeout?

share|improve this question
Something doesn't seem right ... didn't you say the .emacs file is on the AFS remote share, and now you're asking about syntax in the .emacs file? Even once you get the correct elisp syntax it still won't help - either the AFS share is mounted and don't need timers, or it's not and you'll never read the timer settings. – Daniel Mar 9 '15 at 19:32
There is a global .emacs file that is installed on each server and is read first. I plan on putting the timeout in there as well. – user35042 Mar 11 '15 at 22:08
up vote 2 down vote accepted

Your example fails because remote-.emacs isn't quoted. This will work:

(with-timeout (4)
  (load "remote-.emacs"))

However, from the emacs docs:

...timers can run within a Lisp program only when the program calls a primitive that can wait, with-timeout cannot stop executing body while it is in the midst of a computation...

I assume that emacs is blocked by your OS waiting for a timeout on the remote file over AFS. Thus I suspect that setting a timeout in emacs may have no effect.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.