<<< Date Index >>>     <<< Thread Index >>>

Re: Question on 'tmpdir' configuration variable



On Jan 14, 2008 2:31 PM, Kyle Wheeler <kyle-mutt@xxxxxxxxxxxxxx> wrote:
> Nope, that's not true of other editors. In vim, the working directory
> is unchanged from the directory I was in when I launched mutt.
>

You're right.

After some tries, I found out that the mode I'm using with emacs when
composing email (post-mode) is doing a "cd ~".

After disabling this "change to home dir before editing" stuff, it
appears that emacs changes the working dir to the one containing the
file you're opening. So for mutt default configuration, emacs does a
"cd /tmp" before editing the email body.

It's useful if you're going to open other files but IMHO not useful if
you want to start some shell commands which is a more likely use case
when editing an email.

So I need to figure out how to turn this off in emacs....

> However, you CAN use a wrapper script for your $editor; something like
> this:
>
>      #!/bin/sh
>      filename="`basename "$1"`"
>      tmpdir="`dirname "$1"`"
>      hiddenfile="$tmpdir/.$filename"
>      mv "$1" "$hiddenfile"
>      emacs "$hiddenfile"
>      mv "$hiddenfile" "$1"
>

:)

Well, I prefer looking for a emacs/mutt configuration trick before
doing such hackeries.

Thanks for your useful information !
-- 
Francis