Power send-hooking [Was: Re: send2-hook not working for me ]

2009-08-10 Thread Erik Christiansen
On Fri, Aug 07, 2009 at 02:17:20PM -0500, Kyle Wheeler wrote:
> On Saturday, August  8 at 01:55 AM, quoth Erik Christiansen:
> > Well, I've gone back for the third time, to check what happens on 
> > compose (m), and list reply (L). In my now disused cross-gcc 
> > mailbox, with no send-hook and no "Reply-To:" in the test email, 
> > both cases follow the default:
> >
> > send-hook .'my_hdr  Reply-To: m...@domain.on.net'
> 
> Do they have that Reply-To header for the FIRST message you send?

Yes. Starting mutt, changing to the avr-gcc folder, and typing 'm' 'n',
the Reply-To: header has my address. 

> Do you specify a Reply-To header (with my_hdr) anywhere outside of a
> hook?

No. The only "my_hdr  Reply-To:" lines are the 8 send-hooks; one
default, and 7 with '~C some_list_address'.

> I have no doubt that it works *repeatably*, if by "repeatably" you 
> mean "I composed several test messages in a row, and each successive 
> test had the right Reply-To header". My point is that if you compose a  
> message to avr-gcc-l...@nongnu.org, and then immediately afterwords 
> compose a message to someone else (me, say), that this second message 
> will have a Reply-To header intended for the avg-gcc list (unless I'm 
> misunderstanding what you're doing).

On following the first message (above) with a list reply, the header
switches to:

Reply-To: avr-gcc-l...@nongnu.org

After ":wq" and abort, and typing 'm' 'n', the Reply-To: header has my
address again. Thus it is repeatably switching the header as desired.

> > During list reply, is the send-hook just acting as a reply hook, 
> > triggering on the message to which I'm replying?
> 
> No, send-hook ALWAYS matches itself against the NEW message you are 
> composing, even if that new message is a reply to some other message.

Then it seems to be triggering on the "To: avr-gcc-l...@nongnu.org",
auto-inserted for the list reply. Ah, yes, when I compose a new message
to the list, inserting the address in vim, the Reply-To: header remains
at the default.

Since I always post to lists by hitting 'L' and deleting headers such as
"In-Reply_To:", the send-hook works well enough to get by.

>Example 2:
>  You have a message sent to the mutt mailing list by m...@mydomain.
>  This message is, of course, addressed to mutt-us...@mutt.org.
>  Because it is a mailing list message, when you reply to it, your
>  new message will ALSO be addressed to mutt-us...@mutt.org. Thus,
>  both the following hooks would trigger:
> 
>  reply-hook '~C mutt-users' '...'
>  send-hook  '~C mutt-users' '...'

IIUC, that is what is satisfactorily setting "Reply-To:", so long as I
use 'L' and not 'm' to reply to the list.

>  The reason is that both messages (the original and the reply) are
>  addressed to mutt-users. But of the following two hooks, only the
>  send-hook would trigger:
> 
>  reply-hook '~P' '...'
>  send-hook  '~P' '...'
> 
>  That is because the new message you are composing will be *FROM*
>  you (which is what ~P matches against), but the list message
>  you're responding to isn't FROM you, it's from m...@mydomain.
> 
> The reason the manual talks about reply-hooks and send-hooks in the 
> same breath is that they're *triggered* at approximately the same time 
> (i.e. AFTER you told mutt you want to compose a reply, but BEFORE your 
> $editor runs). When composing a new message that is not a reply, none 
> of the reply-hooks are triggered, no matter what their patterns are, 
> but send-hooks WILL be triggered (if their patterns match).
> 
> Does that help straighten it out?

Yes. Many thanks for the detailed account. I'll certainly keep it for
future reference.

> ALL of mutt's hooks have effects that lasts beyond their immediate 
> context. In fact, ALL hooks are considered to make "permanent" changes 
> (at least, permanent until another hook changes it again). One of the 
> biggest reasons for that is so that mutt's hooks can do *ANYTHING*. If 
> mutt was expected to limit the impact of hooks to just a limited 
> context, it would have to save the state of EVERYTHING and restore it 
> when exiting that context. (You'll note that such "context" is never 
> discussed or hinted at in mutt's manual.)

That doesn't seem to be the case if the context were the content of the
current email. Nothing need be saved, and nothing needs to be restored.
My hope while searching for a simple way to modify one header on the
current email can be likened to shell behaviour. An "ls /tmp" does not
mandate "cd /tmp". It is only because mutt can't modify the headers of
the current message, based on the current message, without clobbering
templates, that it becomes so complicated. I accept now that mutt can't
do that.

> By the way: why are you so determined to mangle the Reply-To header in 
> the first place? So many lists mangle the Reply-To header anyway... 
> mutt supports the Mail-Reply-To header, and automatica

why is there no auto $ (save changes to mailbox)?

2009-08-10 Thread Marc Vaillant
Hi all,

I've been a happy mutt user for over a decade.  Of course there are a
few minor features here and there that I wish mutt had.  The one that's
really getting to me lately is that as far as I know, there is no
automatic way to execute "$".  i.e. save changes to mailbox.  This is
particularly a problem for IMAP because losing your internet connection
(e.g. sleeping your laptop) usually means losing mailbox changes.  If
there is a mechanism for accomplishing this now please let me know.
Otherwise, it seems natural for it to be an action during mail check?
Shouldn't there be at least an auto save/recover mechanism? 

Thanks,
Marc 


Re: why is there no auto $ (save changes to mailbox)?

2009-08-10 Thread Michael Tatge
* On Mon, Aug 10, 2009 09:23AM -0400 Marc Vaillant
* (vaill...@fastmail.fm) muttered:
> there is no automatic way to execute "$".  i.e. save changes to
> mailbox. This is particularly a problem for IMAP because losing your
> internet connection (e.g. sleeping your laptop) usually means losing
> mailbox changes.

No, there isn't. And that's a good thing (TM). I don't want messages to
be auto deleted.
If you want such a feature you always make a macro that does that.
e.g. macro index 

HTH,

Michael
-- 
"All language designers are arrogant.  Goes with the territory..."
(By Larry Wall)

PGP-Key-ID: 0xDC1A44DD
Jabber: init...@amessage.de


Signature

2009-08-10 Thread Paul Grinberg

Hi,

Have the following problem.

Every time signature is appended after part below (at the end of the
e-mail)


On Mon, Aug 10, 2009 at 10:28:53AM -0400, wrote:
>bla bla bla

How to make it so signature will appear "before" the above part?

Best,
Paul


Re: Signature

2009-08-10 Thread Christian Brabandt
Hi Paul!

On Mo, 10 Aug 2009, Paul Grinberg wrote:

> Every time signature is appended after part below (at the end of the
> e-mail)
> 
> 
> On Mon, Aug 10, 2009 at 10:28:53AM -0400, wrote:
> >bla bla bla
> 
> How to make it so signature will appear "before" the above part?

You are looking for sig_on_top. From the manual:

 3.259. sig_on_top

  Type: boolean
  Default: no

  If set, the signature will be included before any quoted or forwarded
  text. It is strongly recommended that you do not set this variable unless
  you really know what you are doing, and are prepared to take some heat
  from netiquette guardians.



regards,
Christian
-- 
BLACK KNIGHT:  I move for no man.
ARTHUR:So be it!
[hah] [parry thrust]
[ARTHUR chops the BLACK KNIGHT's left arm off]
ARTHUR:Now stand aside, worthy adversary.
BLACK KNIGHT:  'Tis but a scratch.
  The Quest for the Holy Grail (Monty Python)


Re: Signature

2009-08-10 Thread Paul Grinberg
Worked! Thanks!


Best,
Paul


-Original Message-
From: owner-mutt-us...@mutt.org [mailto:owner-mutt-us...@mutt.org] On
Behalf Of Christian Brabandt
Sent: Monday, August 10, 2009 11:56 AM
To: mutt-users@mutt.org
Subject: Re: Signature

Hi Paul!

On Mo, 10 Aug 2009, Paul Grinberg wrote:

> Every time signature is appended after part below (at the end of the
> e-mail)
> 
> 
> On Mon, Aug 10, 2009 at 10:28:53AM -0400, wrote:
> >bla bla bla
> 
> How to make it so signature will appear "before" the above part?

You are looking for sig_on_top. From the manual:

 3.259. sig_on_top

  Type: boolean
  Default: no

  If set, the signature will be included before any quoted or forwarded
  text. It is strongly recommended that you do not set this variable
unless
  you really know what you are doing, and are prepared to take some heat
  from netiquette guardians.



regards,
Christian
-- 
BLACK KNIGHT:  I move for no man.
ARTHUR:So be it!
[hah] [parry thrust]
[ARTHUR chops the BLACK KNIGHT's left arm off]
ARTHUR:Now stand aside, worthy adversary.
BLACK KNIGHT:  'Tis but a scratch.
  The Quest for the Holy Grail (Monty
Python)


Re: why is there no auto $ (save changes to mailbox)?

2009-08-10 Thread Marc Vaillant
On Mon, Aug 10, 2009 at 04:44:57PM +0200, Michael Tatge wrote:
> * On Mon, Aug 10, 2009 09:23AM -0400 Marc Vaillant
> * (vaill...@fastmail.fm) muttered:
> > there is no automatic way to execute "$".  i.e. save changes to
> > mailbox. This is particularly a problem for IMAP because losing your
> > internet connection (e.g. sleeping your laptop) usually means losing
> > mailbox changes.
> 
> No, there isn't. And that's a good thing (TM). I don't want messages to
> be auto deleted.

which may suggest that that sync-mailbox isn't properly abstracted.
Perhaps you should be able to sync message flags separately from
confirming message deletion.

> If you want such a feature you always make a macro that does that.
> e.g. macro index 

Thanks, I will try that.

Marc


Re: why is there no auto $ (save changes to mailbox)?

2009-08-10 Thread Marc Vaillant
On Mon, Aug 10, 2009 at 04:44:57PM +0200, Michael Tatge wrote:
> * On Mon, Aug 10, 2009 09:23AM -0400 Marc Vaillant
> * (vaill...@fastmail.fm) muttered:
> > there is no automatic way to execute "$".  i.e. save changes to
> > mailbox. This is particularly a problem for IMAP because losing your
> > internet connection (e.g. sleeping your laptop) usually means losing
> > mailbox changes.
> 
> No, there isn't. And that's a good thing (TM). I don't want messages to
> be auto deleted.

Actually I'm remembering that there is the delete config option which
takes care of this.

> If you want such a feature you always make a macro that does that.
> e.g. macro index 

mutt errors on this macro.

Marc


Re: why is there no auto $ (save changes to mailbox)?

2009-08-10 Thread Kyle Wheeler
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

On Monday, August 10 at 12:34 PM, quoth Marc Vaillant:
>> If you want such a feature you always make a macro that does that.
>> e.g. macro index 
>
>mutt errors on this macro.

That's because it's incomplete. You have to insert whatever key you 
normally have bound to the  function in the middle. 
For example, by default,  is bound to , so by 
default, the following macro would work:

 macro index  

~Kyle
- -- 
There in America we are descended in blood and in spirit from 
revolutionist and rebel men and women who dare to dissent from 
accepted doctrine. As their heirs, may we never confuse honest dissent 
with disloyal subversion.
-- Dwight D. Eisenhower
-BEGIN PGP SIGNATURE-
Comment: Thank you for using encryption!

iQIcBAEBCAAGBQJKgFS+AAoJECuveozR/AWeazAP/AnQ4U6gscHhjqXoJRk274vG
hfEinnvDCcCO8Lhq85eONZORiZ4tN8pKVk+F7RM7q05e6toWy6l34B35A/UfGSax
JPNiiS5J77iQBqKPx/+w1NcvlarsUbd9xmuHq2VKBOxOAAA5ebuF50PoiHGj4AJX
eCvoX6arxrTBBQjkVRVTuDiY/9/bOLocLnDlqFyu+ULmhlj4l2yd3lSos3OJZ1Pl
b6lEF5CR5S+XYKpzXd4mPM0adG+nZiGNys9nY9D/3bmSEzqGXyfsPvMS6IgShEP/
kdvh2XgQKaN56e39yxG4m6dMojoUDosv5NWvBjZRAu9Pk79q3Qbx+iPvHqZd54PO
+2px7ivgS8uHNNFjEWUO8RHCI25UWJN4ZeZw7tR8QYJFlgLALkAItN6szeOkhcTX
oXFcwRlKif9sz60GF8FMudBo1tLaFqipfQMpyxGcNaczO3UksNiJDS9/wbmp8V5Z
P6QptwGx0FQ4Dh0iL+VTKPatEYpEC4CbvgwHmdMAYjo84f/8/BkjAGLs0jTtlyUV
BcZvj2xxfHcjlOZWEvT2P40wjoMoLg+4CUsoPoFpSGk7oKsWqIXPEwPt4H++/4jl
ulZSf2unSz8QXjdQe5e4ON58q35oMjibtWdfSVR81MsuvO2oM+Qi51hsu1U6vDIN
8AB92XIsWyAdhOwHvwME
=IOAb
-END PGP SIGNATURE-


Re: why is there no auto $ (save changes to mailbox)?

2009-08-10 Thread Marc Vaillant
On Mon, Aug 10, 2009 at 12:11:27PM -0500, Kyle Wheeler wrote:
> On Monday, August 10 at 12:34 PM, quoth Marc Vaillant:
> >> If you want such a feature you always make a macro that does that.
> >> e.g. macro index 
> >
> >mutt errors on this macro.
> 
> That's because it's incomplete. You have to insert whatever key you 
> normally have bound to the  function in the middle. 
> For example, by default,  is bound to , so by 
> default, the following macro would work:
> 
>  macro index  

No errors but it doesn't seem to sync. 

Marc


Re: why is there no auto $ (save changes to mailbox)?

2009-08-10 Thread Kyle Wheeler
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

On Monday, August 10 at 01:27 PM, quoth Marc Vaillant:
>On Mon, Aug 10, 2009 at 12:11:27PM -0500, Kyle Wheeler wrote:
>> On Monday, August 10 at 12:34 PM, quoth Marc Vaillant:
>> >> If you want such a feature you always make a macro that does that.
>> >> e.g. macro index 
>> >
>> >mutt errors on this macro.
>>
>> That's because it's incomplete. You have to insert whatever key you
>> normally have bound to the  function in the middle.
>> For example, by default,  is bound to , so by
>> default, the following macro would work:
>>
>>  macro index  
>
>No errors but it doesn't seem to sync.

Oops, that shuold be , not 

~Kyle
- -- 
A deep unwavering belief is a sure sign that you're missing something.
 -- Unknown
-BEGIN PGP SIGNATURE-
Comment: Thank you for using encryption!

iQIcBAEBCAAGBQJKgFnfAAoJECuveozR/AWeDUQP/A/16GzqUZ29zKrjn/2VEXOJ
6ZHiLB6tK0fFY+s490xVSIYnwMhDjs9Dt5Z32+RNQGYV90EYBQTB++hoEsjaxQbD
1Wyp0jFVUsdwJCtzwy2qG8DHOAeQ7HrNcTB1Ywh9Y2BiRUbZDbKsSwP6QMZig2vt
bdHAC0bPSR7ojdJa83ztvPdwDWnIXb15gWGC7HexT085TGNtDdKx7MTYaZqmybaO
sZrpyV122EaMoCpcnIaAicqkFlQ5meDYDlHTpNbNvp65q+jPGzqIsj2WxqmKk4lA
NsHqi7MFbNjxytVKisn0HIA2xw6mhqVbruoGb6v0gX5AHTYnW67uv4hlXCdQmoF3
5eezb9vBmWm4sWOQ0Wn6cFzTVyrwOe2bLADHfKhPDqPBRYjE179HnnufY1tElEwi
fAvSKnVfI6WbAD/yUl50eyKhYzYgjjC/KOwH55qMKWjIOQNJMYVVr9tDCCaMLNgw
VCunIkGQdDNFXeVErLbYWsDw/re3ptsdZiEokPgq6KR2Tej4lInekZCxavF/7ZFZ
J7WxSJFCM6QA7IjX+nrtQ3WruDXtlkVuLrPIM5FULQJGvS5Z5TVXKTNvNVSbLMhJ
QWu7gwTcO381g03DA5U8B4zo8t2+8ijNnXu+9veXL5sxQsCGegGY3NGf8j7QFTm6
u+alaGoRoDiFPlsNPJMS
=Wu6X
-END PGP SIGNATURE-


Re: why is there no auto $ (save changes to mailbox)?

2009-08-10 Thread Rejo Zenger
++ 10/08/09 16:44 +0200 - Michael Tatge:
>> there is no automatic way to execute "$".  i.e. save changes to
>> mailbox. This is particularly a problem for IMAP because losing your
>> internet connection (e.g. sleeping your laptop) usually means losing
>> mailbox changes.
>
>No, there isn't. And that's a good thing (TM). I don't want messages to
>be auto deleted.

No messages will be "auto deleted".

The only thing that happens is that messages you earlier have marked as 
"to be deleted" will be actually deleted. Or better, any changes you 
have made to the status of the message is comitted. The behaviour 
wouldn't be any different from exiting a mailbox or pressing "$". 

And, in the spirit of mutt, such a setting would be configurable. One 
can turn it on or off and set the interval.

I can't think of a reason why this would be bad (especialy if it's 
configurable and the default is "off"). 

-- 
Rejo Zenger .  . 0x21DBEFD4 . 
GPG encrypted e-mail prefered. 


signature.asc
Description: Digital signature


Re: mailbox list problem

2009-08-10 Thread Robert Holtzman
On Mon, Aug 10, 2009 at 10:38:10AM -0500, Kyle Wheeler wrote:
> On Sunday, August  9 at 09:14 PM, quoth Robert Holtzman:
>> The problem was that I stupidly modified the list of mail lists to  
>> duplicate the list of mailboxes. When I went back and realized what I 
>> had done I restored both lists from my backup (let's hear it for  
>> backups!)and added the rkhunter and sounder lists. Now I'm getting  
>> this error message:
>>
>> Error in /home/holtzm/.muttrc, line 298: +saved-slrn-user: unknown  
>> command source: errors in /home/holtzm/.muttrc Press any key to 
>> continue...
>
> Generally speaking, that means that you have a line that starts with  
> “+saved-slrn-usr”, rather than with a regular command.
>
>> #mailboxes ! +mutt-dev +mutt-users +open-pgp +wmaker +hurricane +vim
>> +ietf \
>> 287 #   +drums
>> 288
>> 289
>> 290 mailboxes ! +INCOMING +list-Chevelle +list-PLUG-discuss
>> +list-alpine-info \
>> 291 +list-clamav +list-debian-users +list-exim-users
>> +list-firefox-support \
>> 292 +list-gnupg-users +list-mondo-devel +list-mutt-users
>> +list-openoffice-discuss \
>> 293 +list-openoffice-users +list-procmail +list-slrn-user
>> +list-ubuntu-users +spam \
>> 294 +list-rkhunter +list-sounder +list+saved-alpine
>> +saved-Chevelle +saved-clamav \
>> 295 +saved-debian-users +saved-firefox-support
>> +saved-gnupg-users +saved-mondo-devel \
>> 296 +saved-mutt-users +saved-openoffice-users +saved-PLUG
>> +saved-procmail \
>> 297 +saved-slrn-user +saved-ubuntu-users +saved-messages \
>> 298 #mailboxes `echo $HOME/Mail/*`
>
> Two things: first, I think you have a space at the end of line 295  
> (after the backslash), which breaks the line wrapping. Second, you told 
> mutt to connect lines 297 and 298 (with the backslash at the end), so 
> mutt identifies the whole line by it’s last line number.

That nailed it. I never would have caught it.


>> The line wrapping is weird but you can follow it.
>
> When I get into trouble like that, I always first glue the wrapped lines 
> back together. You have no idea how often (or in how many different 
> programs) doing that has revealed to me that I had a simple  
> line-wrapping error, rather than some other problem.

That tip is worth a lot of beer if you're ever in the area.

>>> (Do you know what the + is there for?)
>>
>> As a matter of fact no. Explain, please.
>
> I thought not - lots of folks get tripped up by that. It’s actually a  
> shortcut for a mailbox specification. Both the + symbol and the = symbol 
> can be used when specifying a mailbox name as a shorthand for the value 
> of $folder.
>
> Think of it this way (I’m using example names here): the mailboxes  
> command expects FULL PATHS to mailboxes, like this:
>
> mailboxes /home/myname/mail/inbox /home/myname/mail/lists
>
> But that’s a lot to type, and can make the list of mailboxes hard to  
> read. BUT, you can do this instead:
>
> set folder=/home/myname/mail
> mailboxes +inbox +lists
>
> The equals sign is a synonym for the plus sign in this context, and can 
> be used as well, if you prefer it:
>
> set folder=/home/myname/mail
> mailboxes =inbox =lists
>
> This can be especially useful when using things like imap, where $folder 
> is something big and ugly like  
> “imaps://user:passw...@imap.server.com/INBOX”.
>

That's the kind of information I have never bee able to get running
searches and reading docs.

> What, specifically, are you trying to do? I mean, you can  
> literally start a www browser in an external program by doing  
> this:
>
>  !firefox

 Not sure where in ~/.muttrc to put this.
>>>
>>> I didn’t say you put that in your muttrc, I said you’d “do” that, by  
>>> which I mean “this is a key sequence to press while running mutt.” 
>>> Sorry if I was unclear. By default, the exclamation mark (pressed 
>>> while mutt is running) tells mutt to get ready to run a shell 
>>> command. Once you press that, type in “firefox” (or whatever command 
>>> to launch a web browser), and hit return. That will cause mutt to run 
>>> that command.
>>>
>>> But that’s just a way to “launch a web browser”, not a way to send 
>>> URLs from your email to that browser.
>>
>> Pardon my seeming ingratitude but from your description, it doesn't 
>> seem to do any more than if I switched workspaces, opened FF and pasted 
>> in the url. Did I miss something?
>
> Nope, that’s exactly right. I didn’t quite understand what you were  
> trying to do, so that seemed as good an answer as any other.
>

I was hoping to duplicate slrn's capability of showing a menu with all
the urls in the message allowing you to highlight one and hit .
That opens the browser in the ~/.slrnrc file and loads the selected url.

I ran across the urlscan package in the repository and installed it. The
description indicates that it is at least close to what I want. Haven't
had a chance to pl