* Changing the default directory in which emacs save the files
@ 2008-07-16 16:28 Carlos Gomes
2008-07-16 21:58 ` Lennart Borgman (gmail)
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Carlos Gomes @ 2008-07-16 16:28 UTC (permalink / raw)
To: help-gnu-emacs
[-- Attachment #1: Type: text/plain, Size: 678 bytes --]
Dear Sir or Madam,
I am a big fan and a GNU Emacs user and although I have several books about
it, I have not found the answer for one specific question in any of them. 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)?
Thank you very much for your time.
I am looking forward to hearing from you.
Sincerely,
Carlos Gomes
[-- Attachment #2: Type: text/html, Size: 748 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Changing the default directory in which emacs save the files
2008-07-16 16:28 Changing the default directory in which emacs save the files Carlos Gomes
@ 2008-07-16 21:58 ` Lennart Borgman (gmail)
2008-07-16 22:10 ` Drew Adams
2008-07-16 22:12 ` Charles philip Chan
2 siblings, 0 replies; 4+ messages in thread
From: Lennart Borgman (gmail) @ 2008-07-16 21:58 UTC (permalink / raw)
To: Carlos Gomes; +Cc: help-gnu-emacs
Carlos Gomes wrote:
>
> Dear Sir or Madam,
>
> I am a big fan and a GNU Emacs user and although I have several books
> about it, I have not found the answer for one specific question in any
> of them. 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)?
C-x C-w
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: Changing the default directory in which emacs save the files
2008-07-16 16:28 Changing the default directory in which emacs save the files Carlos Gomes
2008-07-16 21:58 ` Lennart Borgman (gmail)
@ 2008-07-16 22:10 ` Drew Adams
2008-07-16 22:12 ` Charles philip Chan
2 siblings, 0 replies; 4+ messages in thread
From: Drew Adams @ 2008-07-16 22:10 UTC (permalink / raw)
To: 'Carlos Gomes', help-gnu-emacs
> 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').
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Changing the default directory in which emacs save the files
2008-07-16 16:28 Changing the default directory in which emacs save the files Carlos Gomes
2008-07-16 21:58 ` Lennart Borgman (gmail)
2008-07-16 22:10 ` Drew Adams
@ 2008-07-16 22:12 ` Charles philip Chan
2 siblings, 0 replies; 4+ messages in thread
From: Charles philip Chan @ 2008-07-16 22:12 UTC (permalink / raw)
To: help-gnu-emacs
[-- Attachment #1: Type: text/plain, Size: 462 bytes --]
"Carlos Gomes" <cgomes.cami@gmail.com> writes:
> 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)?
Wrong. The intial directory is actually ditermined by the "current
directory" that emacs is started from. In Windows you should be able to
change this by changing "Start in" in "Properties" of the emacs icon.
Charles
[-- Attachment #2: Type: application/pgp-signature, Size: 193 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-07-16 22:12 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-16 16:28 Changing the default directory in which emacs save the files Carlos Gomes
2008-07-16 21:58 ` Lennart Borgman (gmail)
2008-07-16 22:10 ` Drew Adams
2008-07-16 22:12 ` Charles philip Chan
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.