Re: save-message from a reply-hook

2007-08-08 Thread Michelle Konzack
Hello Martin,

What about:

reply-hook '~t [EMAIL PROTECTED]' \
   'my_hdr Fcc: =.Peoples.Michelle_K/'

Greetings
Michelle Konzack
Systemadministrator
Tamay Dogan Network
Debian GNU/Linux Consultant


-- 
Linux-User #280138 with the Linux Counter, http://counter.li.org/
# Debian GNU/Linux Consultant #
Michelle Konzack   Apt. 917  ICQ #328449886
   50, rue de Soultz MSN LinuxMichi
0033/6/6192519367100 Strasbourg/France   IRC #Debian (irc.icq.com)


signature.pgp
Description: Digital signature


Difference between 'push' and 'exec', is there any?

2007-08-08 Thread Chris G
Is there any actual difference between the 'push' and 'exec' commands?

Also, if I source something like the following:-

set mbox_type=maildir
exec save-message
set mbox_type=mbox  

It doesn't do what I expect as the message *doesn't* get saved in
maildir format.  Presumably this is something to do with the order in
which mutt executes the things it finds in a file which is sourced.
Is there any information on this anywhere?

Would a sourced file containing a series of 'push' commands execute
them in the order expected (i.e. sort of backwards).  For example if I
source the following:-

push ":set mbox_type=mbox"
push save-message
push ":set mbox_type=maildir"

Will it switch to maildir, save a message and then switch back to
mbox?

-- 
Chris Green


Re: Difference between 'push' and 'exec', is there any?

2007-08-08 Thread Chris G
On Wed, Aug 08, 2007 at 06:38:33PM +0100, Chris G wrote:
> Is there any actual difference between the 'push' and 'exec' commands?
> 
> Also, if I source something like the following:-
> 
> set mbox_type=maildir
> exec save-message
> set mbox_type=mbox  
> 
> It doesn't do what I expect as the message *doesn't* get saved in
> maildir format.  Presumably this is something to do with the order in
> which mutt executes the things it finds in a file which is sourced.
> Is there any information on this anywhere?
> 
> Would a sourced file containing a series of 'push' commands execute
> them in the order expected (i.e. sort of backwards).  For example if I
> source the following:-
> 
> push ":set mbox_type=mbox"
> push save-message
> push ":set mbox_type=maildir"
> 
> Will it switch to maildir, save a message and then switch back to
> mbox?
> 
No it won't, pity!  It takes the ":set mbox_type=mbox" as the name of
the file to save to.  (Of course the above needs ^M in the set
commands but still).

-- 
Chris Green


Re: Difference between 'push' and 'exec', is there any?

2007-08-08 Thread Kyle Wheeler
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Wednesday, August  8 at 06:38 PM, quoth Chris G:
>Is there any actual difference between the 'push' and 'exec' commands?

Yes.

Push queues up characters to be read in *as if you'd typed them* 
(though, confusingly, it also accepts function calls). Exec can only 
execute function calls. To quote the manual 
(http://www.mutt.org/doc/devel/manual.html):

``exec function'' is equivalent to ``push ''.

So, I can 'push ' and I can 'exec save-message'. 
However, I can 'push =Drafts' but I can't exec 
that.

Both functions are generally meant to be done at *runtime* rather than 
in your muttrc.

>Also, if I source something like the following:-
>
>set mbox_type=maildir
>exec save-message
>set mbox_type=mbox  
>
>It doesn't do what I expect as the message *doesn't* get saved in
>maildir format.  Presumably this is something to do with the order in
>which mutt executes the things it finds in a file which is sourced.
>Is there any information on this anywhere?

Repeat after me: A muttrc file is *not* a script.

It may have some behaviors that seem similar to a script, but it is 
NOT A SCRIPT. A muttrc is interpreted, in its entirety, before 
consequences of those commands are felt (with the exception of 
changing config_charset). Anything that is "source"'d is treated as an 
"initialization file", so settings all take effect more or less 
concurrently. Calls to exec and push will only be resolved once mutt 
is back in it's usual runtime loop.

In addition, save-message requires user input, and so can only happen 
when mutt is back in it's usual runtime loop, not in the middle of 
reading a file or executing a macro.

>Would a sourced file containing a series of 'push' commands execute
>them in the order expected (i.e. sort of backwards).  For example if I
>source the following:-
>
>push ":set mbox_type=mbox"
>push save-message
>push ":set mbox_type=maildir"
>
>Will it switch to maildir, save a message and then switch back to
>mbox?

No. What will happens is that you'll switch to maildir, and then mutt 
will ask you where you would like to save the message, and then it 
will think you typed in ":set mbox_type=maildir" as the name of the 
mailbox to save it in.

push != exec. Push adds things to the input buffer. Mutt cannot read 
input from the keyboard when there's already input in there (i.e. the 
last push's text is in the input stream ahead of whatever you might 
type on the keyboard). There is currently no way to "wait for function 
X that requires user input to complete, then do Y" as you are 
attempting to do here, in part because mutt only has a single queue of 
"user input".

The only way I can think of to do kinda what you want is to create a 
script that uses safecat and asks you for a filename (e.g. with an 
ncurses dialog box, such as dialog or lxdialog).

~Kyle
- -- 
To bathe a cat takes brute force, perseverance, courage of 
conviction---and a cat. The last ingredient is usually hardest to come 
by.
  -- Stephen Baker
-BEGIN PGP SIGNATURE-
Comment: Thank you for using encryption!

iD8DBQFGughnBkIOoMqOI14RApeoAKDqFb92ChtgZv5DLyVZQ75YfYsf7wCg/7Jm
NE1A1juLTnB372VeCo61K1E=
=yhxu
-END PGP SIGNATURE-


Re: Difference between 'push' and 'exec', is there any?

2007-08-08 Thread Christian Brabandt
Hi Chris!

On Wed, 08 Aug 2007, Chris G wrote:
> On Wed, Aug 08, 2007 at 06:38:33PM +0100, Chris G wrote:
> > Would a sourced file containing a series of 'push' commands execute
> > them in the order expected (i.e. sort of backwards).  For example if I
> > source the following:-
> > 
> > push ":set mbox_type=mbox"
> > push save-message
> > push ":set mbox_type=maildir"
> > 
> > Will it switch to maildir, save a message and then switch back to
> > mbox?
> > 
> No it won't, pity!  It takes the ":set mbox_type=mbox" as the name of
> the file to save to.  (Of course the above needs ^M in the set
> commands but still).

Well, you are almost there. It should work this way:

push "set mbox_type=mbox\
~/saved_messageset mbox_type=maildir"

Just source the file and you'll find the selected message in your ~. 
Instead of  a simple  should work, if you'd like to
accept the name proposed by mutt.

regards,
Christian
-- 
hundred-and-one symptoms of being an internet addict:
197. Your desk collapses under the weight of your computer peripherals.


Re: Difference between 'push' and 'exec', is there any?

2007-08-08 Thread Rado S
=- Chris G wrote on Wed  8.Aug'07 at 18:48:20 +0100 -=

> On Wed, Aug 08, 2007 at 06:38:33PM +0100, Chris G wrote:
> > Is there any actual difference between the 'push' and 'exec'
> > commands?

Yes, see wiki -> guide -> /Syntax
(or RTFM ;)

> > Would a sourced file containing a series of 'push' commands
> > execute them in the order expected (i.e. sort of backwards). For
> > example if I source the following:-

AFAIK mutt doesn't work like a stack (FILO), but serves as it comes
(FOFI).

> > push ":set mbox_type=mbox"
> > push save-message
> > push ":set mbox_type=maildir"
> > 
> > Will it switch to maildir, save a message and then switch back
> > to mbox?

You could have tested that _before_ posting. ;)

> No it won't, pity! It takes the ":set mbox_type=mbox" as the name
> of the file to save to. (Of course the above needs ^M in the set
> commands but still).

You're missing the small but relevant difference. ;)
Plus, "push" + "macro" don't stop for user input, they keep reading
or waiting for stuff "push/ macro"ed where it left off last time.

-- 
© Rado S. -- You must provide YOUR effort for your goal!
EVERY effort counts: at least to show your attitude.
You're responsible for ALL you do: you get what you give.


Re: save-message from a reply-hook

2007-08-08 Thread martin f krafft
also sprach Michelle Konzack <[EMAIL PROTECTED]> [2007.08.08.1923 +0200]:
> reply-hook '~t [EMAIL PROTECTED]' \
>'my_hdr Fcc: =.Peoples.Michelle_K/'

This saves the message I send to =.Peoples.Michelle_K/ whereas
I want to store the message to which I am replying. I'd use fcc-hook
for what your hook does.

-- 
martin;  (greetings from the heart of the sun.)
  \ echo mailto: !#^."<*>"|tr "<*> mailto:"; [EMAIL PROTECTED]
 
whatever you do will be insignificant,
but it is very important that you do it.
 -- mahatma gandhi
 
spamtraps: [EMAIL PROTECTED]


digital_signature_gpg.asc
Description: Digital signature (see http://martin-krafft.net/gpg/)


Re: Difference between 'push' and 'exec', is there any?

2007-08-08 Thread Chris G
On Wed, Aug 08, 2007 at 08:30:14PM +0200, Rado S wrote:
> =- Chris G wrote on Wed  8.Aug'07 at 18:48:20 +0100 -=
> 
> > On Wed, Aug 08, 2007 at 06:38:33PM +0100, Chris G wrote:
> > > Is there any actual difference between the 'push' and 'exec'
> > > commands?
> 
> Yes, see wiki -> guide -> /Syntax

Aha, thanks, useful that bit.

> (or RTFM ;)

I had already R'ed the M but it didn't really clarify things, the wiki
is more useful.

-- 
Chris Green


Re: Difference between 'push' and 'exec', is there any?

2007-08-08 Thread Chris G
On Wed, Aug 08, 2007 at 08:17:59PM +0200, Christian Brabandt wrote:
> Hi Chris!
> 
> On Wed, 08 Aug 2007, Chris G wrote:
> > On Wed, Aug 08, 2007 at 06:38:33PM +0100, Chris G wrote:
> > > Would a sourced file containing a series of 'push' commands execute
> > > them in the order expected (i.e. sort of backwards).  For example if I
> > > source the following:-
> > > 
> > > push ":set mbox_type=mbox"
> > > push save-message
> > > push ":set mbox_type=maildir"
> > > 
> > > Will it switch to maildir, save a message and then switch back to
> > > mbox?
> > > 
> > No it won't, pity!  It takes the ":set mbox_type=mbox" as the name of
> > the file to save to.  (Of course the above needs ^M in the set
> > commands but still).
> 
> Well, you are almost there. It should work this way:
> 
> push "set mbox_type=mbox\
> ~/saved_messageset mbox_type=maildir"
> 
Ah, I hadn't seen that there is an  function which
effectively takes one to the : prompt, thank you.  I'll experiment
some more.

-- 
Chris Green


Re: push/enter and my earlier questions

2007-08-08 Thread Chris G
I have finally got what I want:-

s - saves a message in mbox format
S - saves a message in maildir format

by having the following in my muttrc file:-

macro index S ":push ^Mset 
mbox_type=maildir^M" 
macro index s ":push ^Mset mbox_type=mbox^M"   


(OK, I need the same macro defined in a couple of other modes as well
but the above is the essence of what I need, hurrah!)

Thanks for all the help everyone.

-- 
Chris Green


GPG: ID has undefined validity?

2007-08-08 Thread Gary Funck

When I send PGP-encrypted e-mail using mutt to certain
certain recipients, it takes me a selection menu to choose
a particular key.  In some cases there is only a single
choice.  Once selected, mutt issues the following
diagnostic: "ID has undefined validity", and asks if
I want to continue (with "no" as the default).  After I
confirm, it sends the e-mail out without problems.

What do I need to do to get mutt to just use the keys
I have on hand and to not be so picky?  And what do I
need to tell GPG so that it will raise the trust level
on these keys?  Or how do I determine their "validity"?

Also, I notice that if I for example enter a recpient
name that is mispelled, that it will take me to the
key selection screen -- but I couldn't find a way
of telling it to stop looking, and to take me back
to the "compose" window.  The best that I came up
with is control-c, which aborts the mutt session
entirely, and deletes my new mail message.  Is there
a more elegant way to have handled this?

-- 
Gary Funck


Re: GPG: ID has undefined validity?

2007-08-08 Thread Cristóbal M. Palmer
On Wed, Aug 08, 2007 at 07:27:21PM -0700, Gary Funck wrote:
> 
> What do I need to do to get mutt to just use the keys
> I have on hand and to not be so picky?  And what do I
> need to tell GPG so that it will raise the trust level
> on these keys?  Or how do I determine their "validity"?

You want mutt to take gpg at its word; don't change mutt.

To set the trust of a key, visit the --edit-key section of your gpg
manpage and look at the "trust" section. For a longer explanation, see here:

http://www.gnupg.org/gph/en/manual.html#AEN335

But if you met the owner of the key in person and saw the person's
valid ID (say at a key signing party...

http://en.wikipedia.org/wiki/Key_signing_party

...or something), you should go ahead and sign that person's key:

$ gpg --sign-key 

> key selection screen -- but I couldn't find a way
> of telling it to stop looking, and to take me back
> to the "compose" window.

What happens when you hit g here?

Cheers,
-- 
Cristóbal Palmer
ibiblio.org systems administrator


Re: GPG: ID has undefined validity?

2007-08-08 Thread Gary Funck
On Thu, Aug 09, 2007 at 12:45:23AM -0400, Cristóbal M. Palmer wrote:
> 
> To set the trust of a key, visit the --edit-key section of your gpg
> manpage and look at the "trust" section. For a longer explanation, see here:
> 
> http://www.gnupg.org/gph/en/manual.html#AEN335
> 
> But if you met the owner of the key in person and saw the person's
> valid ID (say at a key signing party...

Thanks for the tips.  It seems that some of my confusion
was that while experimenting with sending PGP encrypted mail
that I had set "trust-model always" in my gpg.conf file.
Near as I can tell, this didn't work as I'd expected, though
I am not sure about the exact order that I tried various
permutations of setting trust and signing keys.

-- 
Gary Funck