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: Eric Hanchrow
Subject: Re: how to not change the working directory when opening a file
Date: Mon, 14 Jan 2008 15:17:11 -0800
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux)

>>>>> "Francis" == Francis Moreau <address@hidden> 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 ?

I can't think of an easy way.  If it were me, I'd just prepend a "cd"
command to the shell command, like this:

        C-u M-! cd ~/yow ; ls RET

-- 
I shrivel inside each time [Star Wars] is mentioned.
        -- Sir Alec Guinness





reply via email to

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