Re: [SOLVED] writing macros correctly

2013-04-16 Thread rj
On Tue 16 at 09:00 AM +0100, James Griffin j...@kontrol.kode5.net wrote:

 RJ, Kevin's macro here is the usual way macros are written, as opposed
 to using control sequences as you've done. It's a lot clearer when
 looking at it. And it's best to write the macro using explicit commands
 rather than using key bindings you've set elsewhere in your muttrc.

Thanks for your response and for the reality check.  I've replaced the
following macros:

# Reply w/quoting, put cursor on line 10:
macro index,pager  r  :set editor='vim +10'^M{^M reply with quoting

# Reply w/out quoting, put cursor at line 10:
macro index,pager  R  :set editor='vim +10'^M{  reply without quoting

# List-reply w/quoting, put cursor on line 10:
macro index,pager  p  :set editor='vim +10'^M}   list-reply with quoting

# List-reply w/out quoting, put cursor at line 10:
macro index,pager _R  :set editor='vim +10'^M}   list-reply without quoting

with these:

# Reply w/quoting, put cursor on line 10:
macro index,pager  r  enter-commandset editor='vim +10'enterreply 
reply with quoting

# Reply w/out quoting, put cursor at line 10:
macro index,pager  R  enter-commandset editor='vim +10'enterreply 
reply with quoting

# List-reply w/quoting, put cursor on line 10:
macro index,pager  p  enter-commandset editor='vim +10'enterreply 
list-reply with quoting

# List-reply w/out quoting, put cursor at line 10:
macro index,pager  _R  enter-commandset editor='vim +10'enterreply 
list-reply without quoting

And I've gotten rid of all the unnecessary key-bindings and any other
macros with the obscure-looking control sequences.

 I read further down thread you've still got some issues with your macro?
 What exactly is happening or not happening that you would like to change?

Actually, there are no more issues.  What I *thought* was an issue was that
when I replied to a group with r (regular reply) instead of my defined
p  (group-reply), I was startled to see the prompt:

Reply to name-of-mailing-list? ([yes]/no):

But I realized that's completely as it should be.  I think I was previously
set up for r to work with lists also.

-- 
  Energizer Bunny arrested - charged with battery.



Re: [SOLVED] writing macros correctly

2013-04-16 Thread Kevin J. McCarthy
rj wrote:
 # List-reply w/quoting, put cursor on line 10:
 macro index,pager  p  enter-commandset editor='vim +10'enterreply 
 list-reply with quoting
 
 # List-reply w/out quoting, put cursor at line 10:
 macro index,pager  _R  enter-commandset editor='vim +10'enterreply 
 list-reply without quoting

Did you intend to use list-reply instead of reply for the two macros
above?  Otherwise, nice job cleaning them up.  They look much more
readable and less likely for a stray character to sneak into them.

-Kevin


signature.asc
Description: Digital signature


Re: writing macros correctly

2013-04-16 Thread rj
On Tue 16 at 12:15 PM -0700, Kevin J. McCarthy ke...@8t8.us wrote:

 rj wrote:
  macro index,pager  p  enter-commandset editor='vim +10'enterreply 
  list-reply with quoting
  macro index,pager _R  enter-commandset editor='vim +10'enterreply 
  list-reply without quoting
 
 Did you intend to use list-reply instead of reply for the two macros
 above?  Otherwise, nice job cleaning them up.  They look much more
 readable and less likely for a stray character to sneak into them.

Yes!  I did, thank you.  But the second one is identical to the first.
I tried the following for reply without quoting, and it works, but
after using it, if I want to reply *with* quoting, using r, I get
no-quoting again, so this can't be right:

macro index,pager  R  enter-commandset include='no'enterenter-commandset 
editor='vim +10'enterreply
reply without quoting





pgph4atoU0C7H.pgp
Description: PGP signature


Re: writing macros correctly

2013-04-16 Thread s. keeling
Incoming from rj:
 On Tue 16 at 12:15 PM -0700, Kevin J. McCarthy ke...@8t8.us wrote:
 
  rj wrote:
   macro index,pager  p  enter-commandset editor='vim +10'enterreply 
   list-reply with quoting
   macro index,pager _R  enter-commandset editor='vim +10'enterreply 
   list-reply without quoting
  
  Did you intend to use list-reply instead of reply for the two macros
 
 Yes!  I did, thank you.  But the second one is identical to the first.
 I tried the following for reply without quoting, and it works, but
 after using it, if I want to reply *with* quoting, using r, I get
 no-quoting again, so this can't be right:
 
 macro index,pager  R  enter-commandset 
 include='no'enterenter-commandset editor='vim +10'enterreply
 reply without quoting

Forgive me if I'm doing a Department of Redundancy Department thing.
Why are you doing this?  In mutt, I hit r, and emacs fires up with
the contents of the email I'm replying to.  What are you doing that
improves or differs from that, and why are you needing to stuff a
macro to do it?

I'm just trying to understand the situation, and I'm not seeing why
you're going to such lengths for something that I think is already
there.  :-|


-- 
Any technology distinguishable from magic is insufficiently advanced.
(*) :(){ :|: };:
- -


signature.asc
Description: Digital signature


Re: writing macros correctly

2013-04-16 Thread Kevin J. McCarthy
rj wrote:
 Yes!  I did, thank you.  But the second one is identical to the first.
 I tried the following for reply without quoting, and it works, but
 after using it, if I want to reply *with* quoting, using r, I get
 no-quoting again, so this can't be right:

The settings you change are not local to the macro.  So when you turn
off include, it will stay off even after you finish replying.  If you
have other macros where you want it on, you'll have to turn it back on
for each of those.

By the way, you can combine various setting changes into a single set
command to make your macro less lengthy:

macro index,pager  r  enter-commandset include=yes editor='vim 
+10'enterreply reply with quoting
macro index,pager  R  enter-commandset include=no editor='vim 
+10'enterreply reply without quoting

macro index,pager  p  enter-commandset include=yes editor='vim 
+10'enterlist-reply list-reply with quoting
macro index,pager  _R  enter-commandset include=no editor='vim 
+10'enterlist-reply list-reply without quoting

-Kevin


signature.asc
Description: Digital signature


Re: writing macros correctly

2013-04-16 Thread rj

On Tue 16 at 04:43 PM -0600, s. keeling keel...@nucleus.com wrote:

 Why are you doing this?  In mutt, I hit r, and emacs fires up with
 the contents of the email I'm replying to.  What are you doing that
 improves or differs from that, and why are you needing to stuff a
 macro to do it?

For reply with quoting, you're absolutely right.  I can comment-out the
two macros for RWQ and list-RWQ and get the exact thing I get with them.

So I'll get rid of them. (And thanks for your prodding.)  I think when
I set them long ago, the cursor wasn't placing itself where I wanted it,
and instead of fixing that correctly, I wrote a quick macro to be done with
it, since that was what I knew how to do (incorectly, as it turns out, but
enough to get them to work).  It was a quick fix.

There may also, for all I know, be a one-keypress solution for reply with
*no* quoting, but until I find out what it is, I'll leave my macros for
that in place.

 I'm just trying to understand the situation, and I'm not seeing why
 you're going to such lengths for something that I think is already
 there.  :-|

No, that's fine -- I appreciate it.

---
  Experience is something you don't get until just after you need it.



Re: writing macros correctly

2013-04-16 Thread rj
On Tue 16 at 04:21 PM -0700, Kevin J. McCarthy ke...@8t8.us wrote:

 The settings you change are not local to the macro.  So when you turn
 off include, it will stay off even after you finish replying.  If you
 have other macros where you want it on, you'll have to turn it back on
 for each of those.

I did just get that and was about to post:

macro index,pager  R  enter-commandset editor='vim 
+10'enterenter-command\
set include=noenterreplyenter-commandset include=yesenter\
reply without quoting

I may also be able to get rid of the '+10' setting as, which s. keeling
pointed out, seems to be unneccesary.

 By the way, you can combine various setting changes into a single set
 command to make your macro less lengthy:

 macro index,pager  r  enter-commandset include=yes editor='vim 
 +10'enterreply reply with quoting
 macro index,pager  R  enter-commandset include=no editor='vim 
 +10'enterreply reply without quoting

 macro index,pager  p  enter-commandset include=yes editor='vim 
 +10'enterlist-reply list-reply with quoting
 macro index,pager  _R  enter-commandset include=no editor='vim 
 +10'enterlist-reply list-reply without quoting


And that's what I was wondering about the syntax for, since my version
above was getting very long.  Thank you all.



Re: writing macros correctly

2013-04-16 Thread s. keeling
Incoming from rj:
 On Tue 16 at 04:21 PM -0700, Kevin J. McCarthy ke...@8t8.us wrote:
 
 I may also be able to get rid of the '+10' setting as, which s. keeling
 pointed out, seems to be unneccesary.

I did not say that.  I didn't even mean to imply it.  I just wondered
why you were banging your head on macros, which appear to be
unnecessary.  Whatever you want to do (including using vi(m) instead
of emacs :-) with mutt's fine by me.

Carry on.

Ya know, ...

There's a muttrc.el that makes mutt + emacs gorgious?  Just sayin'.
:-)  I do like vi(m) too; don't get me wrong.


-- 
Any technology distinguishable from magic is insufficiently advanced.
(*) :(){ :|: };:
- -


signature.asc
Description: Digital signature


Re: writing macros correctly

2013-04-16 Thread rj
On Tue 16 at 06:25 PM -0600, s. keeling keel...@nucleus.com wrote:

 Incoming from rj:
  On Tue 16 at 04:21 PM -0700, Kevin J. McCarthy ke...@8t8.us wrote:
  
  I may also be able to get rid of the '+10' setting as, which s. keeling
  pointed out, seems to be unneccesary.
 
 I did not say that.  I didn't even mean to imply it.

Apologies, I think I included it by extension when I discovered that it
also wasn't necessary in the sense you were talking about insofar as
without the macro I still landed exactly at line 10.




[off-list] Re: writing macros correctly

2013-04-16 Thread s. keeling
Incoming from rj:
 On Tue 16 at 06:25 PM -0600, s. keeling keel...@nucleus.com wrote:
 
  Incoming from rj:
   On Tue 16 at 04:21 PM -0700, Kevin J. McCarthy ke...@8t8.us wrote:
   
   I may also be able to get rid of the '+10' setting as, which s. keeling
   pointed out, seems to be unneccesary.
  
  I did not say that.  I didn't even mean to imply it.
 
 Apologies, I think I included it by extension when I discovered that it

No problemo.  :-) I was just playin' wit cha.  I'm a geek, so I want
to start *everything* from the beginning.  Okay, and then what
happens?   etc.

 also wasn't necessary in the sense you were talking about insofar as
 without the macro I still landed exactly at line 10.

I just want to help people think.  Understand the problem, what are
the options, where do we go from here, and what traps await us?  We're
better than this stuff.  All's necessary is for us to bang our heads
on it.  It'll fall over; eventually.

De nada.  Have fun.  :-)


-- 
Any technology distinguishable from magic is insufficiently advanced.
(*) :(){ :|: };:
- -


signature.asc
Description: Digital signature