[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to not change the working directory when opening a file
From: |
Francis Moreau |
Subject: |
Re: How to not change the working directory when opening a file |
Date: |
Wed, 16 Jan 2008 07:35:44 +0100 |
On Jan 16, 2008 3:56 AM, Kevin Rodgers <kevin.d.rodgers@gmail.com> wrote:
>
> Francis Moreau wrote:
> > Hello list,
> >
> > I'd like Emacs to not changing the working directory when opening
> > a file.
> >
> > For example when doing:
> >
> > $ pwd
> > /home/fmoreau/tmp
> > $ emacs /tmp/foo.txt
> >
> > I'd like the current working directory to be "/home/fmoreau/tmp"
> > when editing "/tmp/foo.txt" in emacs.
> >
> > This is useful when composing an email. I sometime need to
> > include the output of a shell command but this shell command
> > must be executed in the directory where emacs was launched.
> >
> > Does anybody can give me a hint to do that ?
>
> (add-hook 'find-file-hook
> (lambda ()
> (setq default-directory
> (buffer-local-value 'default-directory
> (get-buffer "*scratch*")))))
Looks even better to me !
Thanks
--
Francis
- Re: how to not change the working directory when opening a file, (continued)
- Re: how to not change the working directory when opening a file, Eric Hanchrow, 2008/01/14
- Re: how to not change the working directory when opening a file, Lennart Borgman (gmail), 2008/01/14
- Re: how to not change the working directory when opening a file, Francis Moreau, 2008/01/15
- Re: how to not change the working directory when opening a file, Eric Hanchrow, 2008/01/15
- Re: how to not change the working directory when opening a file, Francis Moreau, 2008/01/15
- Re: how to not change the working directory when opening a file, Sebastian Tennant, 2008/01/15
- Re: how to not change the working directory when opening a file, Francis Moreau, 2008/01/15
How to not change the working directory when opening a file, Francis Moreau, 2008/01/14
Re: how to not change the working directory when opening a file, Thien-Thi Nguyen, 2008/01/15