help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: setting the default directory on Windows startup


From: maierh
Subject: Re: setting the default directory on Windows startup
Date: Sat, 21 Sep 2002 15:12:51 +0200
User-agent: Gnus/5.090007 (Oort Gnus v0.07) Emacs/21.2.90 (i386-mingw-nt5.0.2195)

"Alan Barton" <abarton@coas.oregonstate.edu> writes:

> I'm a new user of emacs on Windows, although I have some experience on Linux
> OS versions.  When I open an emacs session and select 'File' -> 'Open file'
> , my directory tree starts looking in 'c:\emacs\bin\' when I would prefer
> that it start looking in my 'c:\home' directory.

I like this solution as the best because it gives the same behavior
as under Unix. Put the follwoing into your .emacs file.

Harald

,----
| (defun buffer-set-default-directory ( dir )
|   "Set the current directory to DIR for buffers that do not have a
| file name associated. The function is indented for the w32 port to set
| the login directory (~/) because on startup the default directory for
| *scratch* and *Messages* are the emacs bin directory or the long
| directory name that was set in the properties of a emacs icon."
|   (save-excursion
|     (let (
|         (list (buffer-list))
|         )
|       (while list
|       (set-buffer (car list))
|       (if (eq buffer-file-name nil)
|           (setq default-directory dir)
|         )
|       (setq list (cdr list))
|       ))))
| 
| (buffer-set-default-directory "~/")
`----


reply via email to

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