From: "Francis Moreau" <francis.moro@gmail.com>
To: "Lennart Borgman (gmail)" <lennart.borgman@gmail.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: how to not change the working directory when opening a file
Date: Tue, 15 Jan 2008 10:27:14 +0100 [thread overview]
Message-ID: <38b2ab8a0801150127x27021810s542c6a921c495a7f@mail.gmail.com> (raw)
In-Reply-To: <478BFC8C.3020800@gmail.com>
Hello,
On Jan 15, 2008 1:21 AM, Lennart Borgman (gmail)
<lennart.borgman@gmail.com> wrote:
> >>>>>> "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.
>
Yes something like this may work.
But I need to set 'default-directory' to the directory where emacs was
launched. I don't want to set a fixed path.
Actually I'm using mutt as MUA and use emacs as editor inside mutt.
When I compose an email mutt basically does the following to start
emacs:
emacs -nw /tmp/mutt-file -f post-mode
So I'm using "post" mode to compose my email. I could create a post
mode hook to change 'default-directory' value but i don't know how to
specify "the directory where emacs was launched".
I could change mutt's email file path to the current directory but I
would prefer not to and let its temporary directory in /tmp which is
the default configuration.
Thanks
--
Francis
next prev parent reply other threads:[~2008-01-15 9:27 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-14 15:15 how to not change the working directory when opening a file Francis Moreau
2008-01-14 23:17 ` Eric Hanchrow
2008-01-15 0:21 ` Lennart Borgman (gmail)
2008-01-15 9:27 ` Francis Moreau [this message]
2008-01-15 15:13 ` Eric Hanchrow
2008-01-15 15:53 ` Francis Moreau
2008-01-15 16:25 ` Sebastian Tennant
2008-01-15 17:16 ` Francis Moreau
-- strict thread matches above, loose matches on Subject: below --
2008-01-14 21:13 How " Francis Moreau
2008-01-15 16:16 ` Sebastian Tennant
2008-01-16 2:56 ` Kevin Rodgers
2008-01-16 6:35 ` Francis Moreau
[not found] <mailman.6126.1200343901.18990.help-gnu-emacs@gnu.org>
2008-01-15 8:02 ` how " Thien-Thi Nguyen
2008-01-15 9:29 ` Francis Moreau
2008-01-15 15:11 ` Thierry Volpiatto
2008-01-15 15:25 ` Francis Moreau
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=38b2ab8a0801150127x27021810s542c6a921c495a7f@mail.gmail.com \
--to=francis.moro@gmail.com \
--cc=help-gnu-emacs@gnu.org \
--cc=lennart.borgman@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.