[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: default directory for windows

From: Drew Adams
Subject: RE: default directory for windows
Date: Wed, 13 Feb 2008 08:44:24 -0800

> One of the (many) problems I have using emacs under windows is that ti
> starts off with the pwd being in the directory where emacs is
> installed rather than my home.
> So my .emacs has (cd "~") to get around this
> But I imagine this is not the proper way to correcting the problem. Is
> there not some 'pre-variable' from which default-directory is set?

Since the subject line mentions Windows... this is what I do:

Create a shortcut to runemacs.exe, and use that to start Emacs. In the
shortcut definition (right-click > Properties), Shortcut tab, field "Start
in:", put the directory where you want Emacs to start. Using the shortcut
then starts Emacs in Dired mode in that directory (which is what I want).

Otherwise, yes, just use `cd' in your init file. Or you can do (setq
default-directory "C:/your/path/to/dir") in your init file. See also
variable `dired-directory-alist', which lets you set the `default-directory'
for different modes.

If you use emacsclient (e.g. if you use EmacsW32), you can also no doubt
specify the startup directory for that. And you can specify a startup
directory on the command line, using option `-f' and a function that cd's to
your directory - see `M-x man RET emacs'.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]