resetting xemacs' idea of home directory

Stephen J. Turnbull stephen at xemacs.org
Sat Apr 26 15:03:49 EDT 2008


Tim Connors writes:

 > I want to reset a running xemacs' idea of where my $HOME directory is (I 
 > want to temporarily work in a different filesystem with my main xemacs 
 > process) so that when I open a file in ~/thesis/..., it goes to 
 > <directory>/thesis/....

Changing HOME is a bad idea; XEmacs is rife with code that assumes
that "~" is your home directory.  Maybe you don't use any of that, but
there's no easy way to know.

You could do something like

(defcustom my-root DIRECTORY)

(defun find-file-from-file (name &optional codesys wildcards)
  (interactive "sName of file relative to `my-root': ")
  (find-file (expand-file-name name my-root) codesys wildcards))

(but you'll lose file-name completion in this simple case, although
that could be added).




More information about the XEmacs-Beta mailing list