From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: maierh@myself.com Newsgroups: gmane.emacs.help Subject: Re: setting the default directory on Windows startup Date: Sat, 21 Sep 2002 15:12:51 +0200 Organization: T-Online Sender: help-gnu-emacs-admin@gnu.org Message-ID: References: Reply-To: Harald Maier NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1032614787 2172 127.0.0.1 (21 Sep 2002 13:26:27 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sat, 21 Sep 2002 13:26:27 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 17skHB-0000Yt-00 for ; Sat, 21 Sep 2002 15:26:25 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 17skH3-00042w-00; Sat, 21 Sep 2002 09:26:17 -0400 Original-Path: shelby.stanford.edu!nntp.stanford.edu!newsfeed.stanford.edu!bloom-beacon.mit.edu!nycmny1-snh1.gtei.net!news.gtei.net!newsfeed.mathworks.com!kibo.news.demon.net!demon!newsfeed00.sul.t-online.de!newsmm00.sul.t-online.com!t-online.de!news.t-online.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 33 Original-X-Trace: news.t-online.com 1032613971 03 2044 XFywb4fSsA431 020921 13:12:51 Original-X-Complaints-To: abuse@t-online.com X-Sender: 320041125923-0001@t-dialin.net User-Agent: Gnus/5.090007 (Oort Gnus v0.07) Emacs/21.2.90 (i386-mingw-nt5.0.2195) Cancel-Lock: sha1:N5l+rvwr3Os5+cBaqCuErSMNA4c= Original-Xref: nntp.stanford.edu gnu.emacs.help:105131 Original-To: help-gnu-emacs@gnu.org Errors-To: help-gnu-emacs-admin@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.help:1685 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:1685 "Alan Barton" 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 "~/") `----