Re: macros or hook?
* Nick Wilson [EMAIL PROTECTED] [020124 19:15]: I want to use a different $editor var whenever I either *reply* to or *compose* a message. Reason being a different cursor starting point for each one (on the attribution for replying and on the top line for composing). I'm not sure how to do it, I looked at hooks but didn't see one that seemed to fit? Can't you bind a macro to the key that you press when replying and when composing a message? mdb -- You have the capacity to learn from mistakes. You'll learn a lot today.
macros or hook?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi all, I want to use a different $editor var whenever I either *reply* to or *compose* a message. Reason being a different cursor starting point for each one (on the attribution for replying and on the top line for composing). I'm not sure how to do it, I looked at hooks but didn't see one that seemed to fit? Thanks - -- Nick Wilson Tel:+45 3325 0688 Fax:+45 3325 0677 Web:www.explodingnet.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) iD8DBQE8UE9XHpvrrTa6L5oRAt/VAJ9oFRWG+gHLBsxx5haBsmme9RRPrACdFOMs anX6LenYCNdUK6MwT+3Uqi8= =5Haa -END PGP SIGNATURE-
Re: macros or hook?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 * and then Maarten den Braber blurted Can't you bind a macro to the key that you press when replying and when composing a message? Well, I'm not sure hence the subject line to this thread. If I knew how to do either one I would have done it :) - -- Nick Wilson Tel:+45 3325 0688 Fax:+45 3325 0677 Web:www.explodingnet.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) iD8DBQE8UGQ0HpvrrTa6L5oRAictAJkBI4uWK8Ps/N0wrVqJDI8zgyv3/QCgmceJ PgNkX/loH7Na/qY0dJP2ltE= =SQ1O -END PGP SIGNATURE-
Re: macros or hook?
* Maarten den Braber [EMAIL PROTECTED] [020124 20:03]: * Nick Wilson [EMAIL PROTECTED] [020124 19:15]: I want to use a different $editor var whenever I either *reply* to or *compose* a message. Reason being a different cursor starting point for each one (on the attribution for replying and on the top line for composing). I'm not sure how to do it, I looked at hooks but didn't see one that seemed to fit? Can't you bind a macro to the key that you press when replying and when composing a message? Maybe it's A Good Thing to give an example to ;-), here it is: bind index r noop bind index m noop macro index m :set editor=\vim -c ':0;/Subject'\\\nmail macro index r :set editor=\vim -c ':0;/^$'\\\nreply mdb -- You have the capacity to learn from mistakes. You'll learn a lot today.
Re: macros or hook?
Nick Wilson wrote: I want to use a different $editor var whenever I either *reply* to or *compose* a message. Reason being a different cursor starting point for each one (on the attribution for replying and on the top line for composing). why not just use different macros for 'compose' and 'reply' - ie: (untested) macro index m :set editor=blah\nmail macro index r :set editor=blah\nreply macro index R :set editor=blah\ngroup-reply macro index L :set editor=blah\nlist-reply something like that should work though. w
Re: macros or hook?
I want to use a different $editor var whenever I either *reply* to or *compose* a message. I don't know much about vi, but how about writing a function that greps for /^in-reply-to:/ and takes it from there? Or a shell script like: # untested if grep -i ^in-reply-to $1; then vi --do-reply $1; else vi --don't $1; fi -- Mike Schiraldi VeriSign Applied Research smime.p7s Description: application/pkcs7-signature
Re: macros or hook?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 * and then Maarten den Braber blurted Maybe it's A Good Thing to give an example to ;-), here it is: bind index r noop bind index m noop What's a noop? macro index m :set editor=\vim -c ':0;/Subject'\\\nmail macro index r :set editor=\vim -c ':0;/^$'\\\nreply Hmmm Yeah, I getcha. How does mutt know how to reply/compose as well though? Is that them noop buggers? Much thanks Maarten. - -- Nick Wilson Tel:+45 3325 0688 Fax:+45 3325 0677 Web:www.explodingnet.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) iD8DBQE8UGvoHpvrrTa6L5oRAu1MAJ4n7borCtSCBBp8/PcDPviQZz5nWACgtOJs /eiNDeDHiKb/THwBhnqtHkg= =S3Dq -END PGP SIGNATURE-
Re: macros or hook?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 * and then Will Yardley blurted why not just use different macros for 'compose' and 'reply' - ie: (untested) macro index m :set editor=blah\nmail macro index r :set editor=blah\nreply macro index R :set editor=blah\ngroup-reply macro index L :set editor=blah\nlist-reply Ah now I see a pattern, you can put the mail thingy in the set editor bit. So how might it look with this line: set editor=vim +'/^$/' -c ':set textwidth=72' like this? set editor=vim +'/^$/' -c ':set textwidth=72'mail Thanks for the help guys. - -- Nick Wilson Tel:+45 3325 0688 Fax:+45 3325 0677 Web:www.explodingnet.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) iD8DBQE8UGznHpvrrTa6L5oRAqwQAKCJEgliIUSj3CTX/2uhmy/oEfwrLwCdH+dT yEhT4S4EpDgrvJ67i70P1Uo= =o7zz -END PGP SIGNATURE-
Re: macros or hook?
* Nick Wilson [EMAIL PROTECTED] [020124 21:17]: bind index r noop bind index m noop What's a noop? noop means as much as 'do nothing' (no operation or something i guess), i thought that the macros wouldn't work if i didn't do this, but maybe they do. i don't know for sure. macro index m :set editor=\vim -c ':0;/Subject'\\\nmail macro index r :set editor=\vim -c ':0;/^$'\\\nreply Hmmm Yeah, I getcha. How does mutt know how to reply/compose as well though? Is that them noop buggers? i don't get your question, do you mean how mutt knows when to reply or compose? that's in the 'm'ail and 'r'eply keys i use. mdb -- You have the capacity to learn from mistakes. You'll learn a lot today.
Re: macros or hook?
* Nick Wilson [EMAIL PROTECTED] [020124 21:21]: macro index m :set editor=blah\nmail macro index r :set editor=blah\nreply macro index R :set editor=blah\ngroup-reply macro index L :set editor=blah\nlist-reply Ah now I see a pattern, you can put the mail thingy in the set editor bit. So how might it look with this line: set editor=vim +'/^$/' -c ':set textwidth=72' like this? set editor=vim +'/^$/' -c ':set textwidth=72'mail Almost. You can only use the mail 'thingie' in a macro definition, $editor is just the editor variable. mdb -- You have the capacity to learn from mistakes. You'll learn a lot today.
Re: macros or hook?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 * and then Maarten den Braber blurted i don't get your question, do you mean how mutt knows when to reply or compose? that's in the 'm'ail and 'r'eply keys i use. Yes, sorry. I put 2 and 2 together once I'd seen Wills post, and saw the mail again. Cheers, I'll start messin' with it! - -- Nick Wilson Tel:+45 3325 0688 Fax:+45 3325 0677 Web:www.explodingnet.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) iD8DBQE8UG70HpvrrTa6L5oRAj7EAJ0ay1KjsPixDUywUbsFiBLIm2d81gCfdTeM +8u51qGf/qJYVJ5AJw1ebcE= =2Ses -END PGP SIGNATURE-
Re: macros or hook?
On 2002.01.24, in [EMAIL PROTECTED], Nick Wilson [EMAIL PROTECTED] wrote: * and then Maarten den Braber blurted Maybe it's A Good Thing to give an example to ;-), here it is: bind index r noop bind index m noop What's a noop? No-op: no operation [on this cycle :)]. macro index m :set editor=\vim -c ':0;/Subject'\\\nmail macro index r :set editor=\vim -c ':0;/^$'\\\nreply Hmmm Yeah, I getcha. How does mutt know how to reply/compose as well though? Is that them noop buggers? The \n terminates the :set editor command. It's the same action as pressing the ENTER key. mail inside a macro tells mutt to execute the mail function. This is bound to m by default. Most people probably write their macros with keystrokes -- like : for enter-command, and m for mail -- but using the binding names makes your macros more universal, should you wish to share them or to change your own bindings later in life. You could also write these macros as: macro index m enter-commandset editor=\vim -c ':0;/Subject'\entermail macro index r enter-commandset editor=\vim -c ':0;/^$'\enterreply (to use binding names for all special keystrokes), or as: macro index m :set editor=\vim -c ':0;/Subject'nm macro index r :set editor=\vim -c ':0;/^$'nr to use keystrokes and no binding names. -- -D.[EMAIL PROTECTED]NSITUniversity of Chicago
Re: macros or hook?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 * and then David Champion blurted The \n terminates the :set editor command. It's the same action as pressing the ENTER key. mail inside a macro tells mutt to execute the mail function. This is bound to m by default. Most people probably write their macros with keystrokes -- like : for enter-command, and m for mail -- but using the binding names makes your macros more universal, should you wish to share them or to change your own bindings later in life. Well I did Maatens keystroke way like this: macro index m :set editor=\vim +'/^$/' -c ':set textwidth=72'\\\nmail macro index r :set editor=\vim +'/^$/+1' -c ':set textwidth=72'\\\nreply But I must say that I find it confusing, there are unequall pairs which I guess has something to do wiht \\\n but that too confused me :) Worked though huh? I've settled on: macro index r enter-commandset editor=\vim +'/^$/+1' -c ':set textwidth=72'\enterreply macro index m enter-commandset editor=\vim +'/^$/' -c ':set textwidth=72'\entermail Much easier to read for a dope like me! Thanks very much for all the help it's very much appreciated mutters. - -- Nick Wilson Tel:+45 3325 0688 Fax:+45 3325 0677 Web:www.explodingnet.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) iD8DBQE8UHa7HpvrrTa6L5oRAvmRAJ9xP2mgQflggFMt7NSqdJXAVks7pQCfcwqT wYw4HZIrX6DIOID4T+fVIHw= =iR3v -END PGP SIGNATURE-
Re: macros or hook?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 * and then Maarten den Braber blurted like this? set editor=vim +'/^$/' -c ':set textwidth=72'mail Almost. You can only use the mail 'thingie' in a macro definition, $editor is just the editor variable. Thanks Maarten, got it now. One last thing: I wrote 4 macros (r,g,L,m) for the index and then wrote then *again* for the pager. Could I have done that more efficiently? Thanks again - -- Nick Wilson Tel:+45 3325 0688 Fax:+45 3325 0677 Web:www.explodingnet.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) iD8DBQE8UHkWHpvrrTa6L5oRAtDwAKCVNr/woKI5gAnYdzJHj/S3GUjtNQCfXssc t/KS+rREYpim0nkFI8Kppcg= =if6w -END PGP SIGNATURE-
Re: macros or hook?
* Nick Wilson [EMAIL PROTECTED] [020124 22:13]: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 * and then Maarten den Braber blurted like this? set editor=vim +'/^$/' -c ':set textwidth=72'mail Almost. You can only use the mail 'thingie' in a macro definition, $editor is just the editor variable. Thanks Maarten, got it now. One last thing: I wrote 4 macros (r,g,L,m) for the index and then wrote then *again* for the pager. Could I have done that more efficiently? No, I don't think so, but maybe someone else does know a better way... mdb -- You have the capacity to learn from mistakes. You'll learn a lot today.