Re: Question on 'tmpdir' configuration variable
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Monday, January 14 at 09:58 AM, quoth Francis Moreau:
>First I'm using emacs to compose my email but I suspect the same is
>true for others editors.
>
>When working in a project directory, I sometimes need to write an
>email including some outpouts coming from a shell command. So I launch
>mutt then start composing my email using emacs. But emacs was launches
>to edit '/tmp/Mutt-xxx', therefore the working directory of emacs is
>now /tmp
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.
>which is not very interesting if I need to start some shell
>commands. To workaround this I set tmpdir to '.' which works fine.
Suit yourself.
>But there is still a little issue: if I do an 'ls' command for
>example, I now see the Mutt-xxx file in my current directory which is
>a little bit annoying.
>
>So the question is now: can I specify the template of this temporary
>file used by mutt when composing an email ?
Nope.
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"
~Kyle
- --
Reality is that which, when you stop believing in it, doesn't go away.
-- Philip K. Dick
-----BEGIN PGP SIGNATURE-----
Comment: Thank you for using encryption!
iD8DBQFHi2QWBkIOoMqOI14RApfNAKCJqItY3gEJPGmG4A3LsnbAf/5ZJgCfRvtC
PxBUcUXjG0K+mEMcYNd5udc=
=aAVU
-----END PGP SIGNATURE-----