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

[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: Lennart Borgman (gmail)
Subject: Re: how to not change the working directory when opening a file
Date: Tue, 15 Jan 2008 01:21:32 +0100
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.666

"Francis" == Francis Moreau <francis.moro@gmail.com> writes:

    Francis> Hello list, I'd like Emacs to not changing the working
    Francis> directory when opening a file.

    Francis> For example when doing:

    Francis> $ pwd /home/fmoreau/tmp $ emacs /tmp/foo.txt

    Francis> I'd like the current working directory to be
    Francis> "/home/fmoreau/tmp" when editing "/tmp/foo.txt" in emacs.

    Francis> This is useful when composing an email.  I sometime need
    Francis> to include the output of a shell command but this shell
    Francis> command must be executed in the directory where emacs was
    Francis> launched.

    Francis> Does anybody can give me a hint to do that ?

Can't you use the variable default-directory? Ie do

  M-: (setq default-directory "/my-full-dir-path/")

when you are in that files buffer.




reply via email to

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