resetting xemacs' idea of home directory

Julian Bradfield jcb+xeb at inf.ed.ac.uk
Sat Apr 26 09:26:46 EDT 2008


In article <Pine.LNX.4.61.0804262018010.2415 at radium.ssi.swin.edu.au> Tim Connors <tconnors at astro.swin.edu.au> 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/....

Not sure what this has to do with the beta list, but...

There's no easy way to do it, because XEmacs caches the home directory
when it starts up, and in any case you can't change its own
environment.
If you're happy with just having ~ expanded, you could intercept
expand-file-name, like so:

(defvar temp-home nil "temporary home directory - must include final /")
(fset 'real-expand-file-name (symbol-function 'expand-file-name))
(defun expand-file-name (name &optional defdir)
  (real-expand-file-name
    (if (and temp-home (string-match "^~/" name))
      (replace-match temp-home t t name)
     name) defdir))

-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.



More information about the XEmacs-Beta mailing list