From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.help Subject: RE: Changing the default directory in which emacs save the files Date: Wed, 16 Jul 2008 15:10:24 -0700 Message-ID: <000701c8e790$bf292230$c2b22382@us.oracle.com> References: <74c0c290807160928r38aa9bd9y501756b021ee09c5@mail.gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1216246402 32488 80.91.229.12 (16 Jul 2008 22:13:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 16 Jul 2008 22:13:22 +0000 (UTC) To: "'Carlos Gomes'" , Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jul 17 00:14:09 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KJFG7-0003fp-B5 for geh-help-gnu-emacs@m.gmane.org; Thu, 17 Jul 2008 00:14:03 +0200 Original-Received: from localhost ([127.0.0.1]:55312 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KJFFE-0007wh-Gi for geh-help-gnu-emacs@m.gmane.org; Wed, 16 Jul 2008 18:13:08 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KJFEt-0007vn-RF for help-gnu-emacs@gnu.org; Wed, 16 Jul 2008 18:12:47 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KJFEq-0007tH-Os for help-gnu-emacs@gnu.org; Wed, 16 Jul 2008 18:12:46 -0400 Original-Received: from [199.232.76.173] (port=34516 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KJFEq-0007t5-JJ for help-gnu-emacs@gnu.org; Wed, 16 Jul 2008 18:12:44 -0400 Original-Received: from rgminet01.oracle.com ([148.87.113.118]:64882) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KJFCq-000054-EW for help-gnu-emacs@gnu.org; Wed, 16 Jul 2008 18:10:40 -0400 Original-Received: from rgmgw2.us.oracle.com (rgmgw2.us.oracle.com [138.1.186.111]) by rgminet01.oracle.com (Switch-3.2.4/Switch-3.1.6) with ESMTP id m6GMAPc6003455; Wed, 16 Jul 2008 16:10:25 -0600 Original-Received: from acsmt351.oracle.com (acsmt351.oracle.com [141.146.40.151]) by rgmgw2.us.oracle.com (Switch-3.2.4/Switch-3.2.4) with ESMTP id m6F1lqgE006223; Wed, 16 Jul 2008 16:10:24 -0600 Original-Received: from inet-141-146-46-1.oracle.com by acsmt350.oracle.com with ESMTP id 3709447521216246220; Wed, 16 Jul 2008 15:10:20 -0700 Original-Received: from dradamslap1 (/130.35.178.194) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 16 Jul 2008 15:10:20 -0700 X-Mailer: Microsoft Office Outlook 11 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198 In-Reply-To: <74c0c290807160928r38aa9bd9y501756b021ee09c5@mail.gmail.com> Thread-Index: AcjnjVVyirC5vwxkRT6aWgVA1aeEagAAMdQg X-Brightmail-Tracker: AAAAAQAAAAI= X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-Whitelist: TRUE X-detected-kernel: by monty-python.gnu.org: Linux 2.4-2.6 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:55658 Archived-At: > I have GNU Emacs installed in my computer on both windows > and linux operative systems, and I have been looking for > a way that allows me to change the directory in which emacs > saves the files that I am working with. That is, is there a > way to "tell" emacs to save a file in a directory other > than, for instance, C:\Programs\emacs\bin (the default) in > windows, by using the command C-x C-s (save-buffer)? At any time (in any buffer), there is a default directory, whose full name is the value of variable `default-directory'. Many operations that use file names interpret a file whose name you enter, by default, as belonging to the current default directory. So when you use `C-x C-s', for instance, if the current buffer is not already associated with a file, then you are prompted for a file in the default directory, which appears in the minibuffer: "File to save in: c:/toto/titi/". You can change the default directory at any time, using command `cd' - e.g., `M-x cd RET', then enter the directory at the prompt "Change default directory: ". When you start Emacs, `default-directory' is, by default, the directory where the Emacs executable is located - e.g. c:\emacs\bin\. On Windows, you can set the Emacs start-up directory to be something different, as follows: 1. Create a shortcut to the Emacs exectutable file runemacs.exe. 2. Right click the shortcut, and choose Properties. 3. Put the directory you want in the field "Start in:" - e.g., c:\my\directory. 4. (Optional) If you want Emacs to open in Dired on that directory, then also append it, within double quotes, to the "Target:" value - e.g., c:\emacs\bin\runemacs.exe "c:\my\directory". Then, to open Emacs, just double-click the shortcut. Alternatively, and for Linux also, you can set environment variable `PWD' to the directory you want Emacs to start in (that is, the default value of `default-directory').