Re: Question on 'tmpdir' configuration variable

2008-01-14 Thread Francis Moreau
Hello Kyle,

On Jan 13, 2008 9:58 PM, Kyle Wheeler <[EMAIL PROTECTED]> wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> On Saturday, January 12 at 09:32 PM, quoth Francis Moreau:
> > Is it possible to specify a path for this variable which does not
> > exist and need to be created ?
>
> Nope.
>
> > For example I'd like to do:
> >
> > set tmpdir = "./.mutt-tmp"
>
> However, you CAN do this:
>
>  set tmpdir = `mkdir -p ./.mutt-tmp ; echo ./.mutt-tmp`
>

Cool, I didn't know about that.

However thinking more on my needs, I think my initial request is not
appropriate: what I really need the following:

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 which is not very interesting if I need to start some shell
commands. To workaround this I set tmpdir to '.' which works fine.

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 ?

Thanks
-- 
Francis


Re: How to move outgoing mails in different mailboxes

2008-01-14 Thread Francis Moreau
On Jan 11, 2008 7:42 PM, Kyle Wheeler <[EMAIL PROTECTED]> wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> On Friday, January 11 at 06:19 PM, quoth Francis Moreau:
> > So now I'd like to move my outgoing emails according to the mailbox
> > I'm composing this email:
>
> Let's start with the exception:
>
> >  - if I compose an email from a mailing list, I suppose there's no
> >  need to save anything since I'm going to received a copy of the
> >  email I wrote (I'm subscribed)
>
> send-hook ~l 'set record='
>

BTW, is this going to work for an *not* subscribed mailing list ?
Because in this case I want to get a copy...

-- 
Francis


Re: How to move outgoing mails in different mailboxes

2008-01-14 Thread Kyle Wheeler
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Monday, January 14 at 10:11 AM, quoth Francis Moreau:
>On Jan 11, 2008 7:42 PM, Kyle Wheeler <[EMAIL PROTECTED]> wrote:
>> -BEGIN PGP SIGNED MESSAGE-
>> Hash: SHA1
>>
>> On Friday, January 11 at 06:19 PM, quoth Francis Moreau:
>> > So now I'd like to move my outgoing emails according to the mailbox
>> > I'm composing this email:
>>
>> Let's start with the exception:
>>
>> >  - if I compose an email from a mailing list, I suppose there's no
>> >  need to save anything since I'm going to received a copy of the
>> >  email I wrote (I'm subscribed)
>>
>> send-hook ~l 'set record='
>>
>
>BTW, is this going to work for an *not* subscribed mailing list ?
>Because in this case I want to get a copy...

Well then you should have been more specific. ;) ~l matches mailing 
lists that you have identified in mutt's muttrc as lists (either via a 
'subscribe' command or a 'list' command). ~u matches only lists 
identified via 'subscribe', so you can use that instead. Personally, 
the distinction is pretty moot for me, since I'm not about to go 
specifying mailing lists in my muttrc that I'm not subscribed to.

~Kyle
- -- 
Every gun that is made, every warship launched, every rocket fired 
signifies, in the final sense, a theft from those who hunger and are 
not fed, those who are cold and are not clothed.
-- Dwight D. Eisenhower
-BEGIN PGP SIGNATURE-
Comment: Thank you for using encryption!

iD8DBQFHi2TDBkIOoMqOI14RAtSbAJ9F0iXAnGcM1I7pKqQOoCMlYRaaOQCg42yu
OkQbNy/A/tBjG4U21wI0QHw=
=vnEN
-END PGP SIGNATURE-


Re: Question on 'tmpdir' configuration variable

2008-01-14 Thread Kyle Wheeler
-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-


Re: Question on 'tmpdir' configuration variable

2008-01-14 Thread Francis Moreau
On Jan 14, 2008 2:31 PM, Kyle Wheeler <[EMAIL PROTECTED]> 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


Re: How to move outgoing mails in different mailboxes

2008-01-14 Thread Francis Moreau
On Jan 14, 2008 2:33 PM, Kyle Wheeler <[EMAIL PROTECTED]> wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> On Monday, January 14 at 10:11 AM, quoth Francis Moreau:
>
> >On Jan 11, 2008 7:42 PM, Kyle Wheeler <[EMAIL PROTECTED]> wrote:
> >> -BEGIN PGP SIGNED MESSAGE-
> >> Hash: SHA1
> >>
> >> On Friday, January 11 at 06:19 PM, quoth Francis Moreau:
> >> > So now I'd like to move my outgoing emails according to the mailbox
> >> > I'm composing this email:
> >>
> >> Let's start with the exception:
> >>
> >> >  - if I compose an email from a mailing list, I suppose there's no
> >> >  need to save anything since I'm going to received a copy of the
> >> >  email I wrote (I'm subscribed)
> >>
> >> send-hook ~l 'set record='
> >>
> >
> >BTW, is this going to work for an *not* subscribed mailing list ?
> >Because in this case I want to get a copy...
>
> Well then you should have been more specific. ;) ~l matches mailing
> lists that you have identified in mutt's muttrc as lists (either via a
> 'subscribe' command or a 'list' command). ~u matches only lists
> identified via 'subscribe', so you can use that instead.

I really should stop using the manual available on www.mutt.org. This
pattern is missing from it.

> Personally,
> the distinction is pretty moot for me, since I'm not about to go
> specifying mailing lists in my muttrc that I'm not subscribed to.
>

Well it's not uncommon to see some people asking to CC them when
replying to them because they are not subscribed to the mailing list
they're posting.

-- 
Francis


Re: save-hook does not save in the right location?

2008-01-14 Thread Rocco Rutte

Hi,

* Jörg Sommer wrote:

Corsair <[EMAIL PROTECTED]> wrote:



So there's no way to do it (without a external mail filter) when mails
from mailing lists and other mails are mixed in a folder?



From /usr/share/doc/mutt/manual.txt.gz:



12. Using Multiple spool mailboxes



  Usage: mbox-hook [!]pattern mailbox



  This command is used to move read messages from a specified mailbox to a
  different mailbox automatically when you quit or change folders. pattern
  is a regular expression specifying the mailbox to treat as a ``spool''
  mailbox and mailbox specifies where mail should be saved when read.


"Pattern" in the usage-line is misleading, because it's a regex for the 
foldername and not a message pattern (like ~l). Furthermore, mbox-hook 
doesn't apply if all your mail is one folder.


Rocco


Re: How to move outgoing mails in different mailboxes

2008-01-14 Thread Rocco Rutte

Hi,

* Kyle Wheeler wrote:

[ ~l vs. ~u ]

Personally, the distinction is pretty moot for me, since I'm not about 
to go specifying mailing lists in my muttrc that I'm not subscribed to.


Besides persoal preference there're use cases where this is useful (e.g.
you write a tool that some project with a mailing list uses: you might 
get cc'ed from time to time but aren't interested in subscribing to the 
list).


Rocco


Re: set up trash for deleted messages

2008-01-14 Thread John Velman
On Sun, Jan 13, 2008 at 02:15:45PM +1100, hce wrote:
> Hi,
> 
> I saw some discussions on how to set up a trash for deleted messages,
> but could not find details. Could anyone show me:
> 
> (a) a setup command to move all deleted messages to a trash file?
> 
> (b) A key bind to delete messages in trash permanently?
> 
> Thank you.
> 
> Jim

This works for me ( in .muttrc).

_

# poor mans trash
folder-hook .  'macro index d "=trash"'
folder-hook =trash 'macro index d '

-

I'm no expert, but apparently the first line puts everything in the "trash"
folder when you delete from to current folder (.).

The second line allows you to actually _delete_ stuff when you delete from
the trash folder.

(I forgot where I got this -- I certainly didn't invent it myself.)

Best,

John Velman


Re: set up trash for deleted messages

2008-01-14 Thread Francis Moreau
On Jan 14, 2008 5:59 PM, John Velman <[EMAIL PROTECTED]> wrote:
> This works for me ( in .muttrc).
>
> _
>
> # poor mans trash

Honestly I'm wondering what's wrong with Trash.

It seems that Trash is not really welcome in Mutt.

-- 
Francis


Re: set up trash for deleted messages

2008-01-14 Thread Kyle Wheeler
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Monday, January 14 at 05:59 PM, quoth Francis Moreau:
>On Jan 14, 2008 5:59 PM, John Velman <[EMAIL PROTECTED]> wrote:
>> This works for me ( in .muttrc).
>>
>> _
>>
>> # poor mans trash
>
>Honestly I'm wondering what's wrong with Trash.
>
>It seems that Trash is not really welcome in Mutt.

By what metric? The fact that support for it isn't built-in (added via 
two simple hooks or via the trash patch linked on the mutt webpage: 
http://cedricduval.free.fr/mutt/patches/#trash) or are you seeing some 
sort of wider hostility to the existence of folders with that name?

One way of understanding mutt's approach to email is as an email 
"viewer". Mutt, given a folder, does its level best to manage that 
folder of email. Mutt is not targetted to managing a large collection 
of many folders of email; it has no support for searching multiple 
mailboxes at the same time, displaying messages from multiple 
mailboxes, displaying messages from multiple accounts, automatically 
transferring messages from an "INBOX" to other folders when you open 
the INBOX, etc. When viewing the contents of a folder, mutt makes *no*  
assumptions about the existence of ANY other folder or account. In 
that sense, mutt approaches mail very differently from other email 
applications: mutt does it on a folder-by-folder basis, while other 
applications (e.g. Thunderbird) approach it on an account-by-account 
basis. When you think about email on an account-by-account basis, 
things like folders with special purposes makes more sense. Thus, in 
other applications, "delete means move to the account's Trash folder" 
makes sense, while in mutt "delete means mark the message as deleted" 
makes more sense (why would mutt assume that you have (or should have) 
a special folder for deleted messages? By moving the message to a 
Trash folder, you are losing the information about where it came 
from.).

However, you can easily make mutt behave more like an "email is an 
account" program by using hooks and other configuration features, and 
if that isn't enough, you can even patch mutt to add the functionality 
in a form you find personally palatable.

What the trash patch does can be replicated by modifying your 
configuration, so there is no strong movement among the development 
group to add it to the tree, because that is essentially bloat (why 
add a second way of doing the same thing?).

~Kyle
- -- 
Formal symbolic representation of qualitative entities is doomed to 
its rightful place of minor significance in a world where flowers and 
beautiful women abound.
 -- Albert Einstein
-BEGIN PGP SIGNATURE-
Comment: Thank you for using encryption!

iD8DBQFHi5vXBkIOoMqOI14RAvcmAJ9Ort3atVM8aqlDUb12k3a+3X+SOwCfadlU
OXPJFyeC9qQ8XEYgBNinmRA=
=6PNi
-END PGP SIGNATURE-