Re: using 'push' in a macro

2015-06-03 Thread Xu Wang
On Wed, Jun 3, 2015 at 11:22 AM, David Champion d...@bikeshed.us wrote:
 * On 03 Jun 2015, Cameron Simpson wrote:
 On 31May2015 08:26, Xu Wang xuwang...@gmail.com wrote:
 Sometimes I would like to use 'push' in a macro, but I cannot figure
 out the way to achieve this. For example, I have:
 
 macro attach E push
 save-entrykill-line/home/xuwang/Downloads/enteryenter xu
 save
 
 What would the correct syntax be?

 push is a command line command, which is accessed by typing :. So you
 need to prefix push with : to enter the command line. So you would start
 your macro :push instead of push.

 There may be a misundertanding though.  Hooks execute commands, so
 to make a hook trigger keyboard events you need push.  Macros are
 opposite: they do not execute commands, they execute keyboard events.
 So typically a macro would not use push -- it would be redundant.  On
 the surface, it seems this should do what you want:

   macro attach E 
 save-entrykill-line/home/xuwang/Downloads/enteryenter xu save

 There may be reasons to have a push inside a macro, but it would
 be as part of some other command which the macro is executing via
 enter-command (same as Cameron's : above).  So then it's a problem
 of using push with that command, not of using push with macro.

Yes, indeed I have misunderstood. Thank you for such clarification.
The suggested macro does indeed do what I had intended. Thank you so
much!

Xu


Re: using 'push' in a macro

2015-06-03 Thread Cameron Simpson

On 31May2015 08:26, Xu Wang xuwang...@gmail.com wrote:

Sometimes I would like to use 'push' in a macro, but I cannot figure
out the way to achieve this. For example, I have:

macro attach E push
save-entrykill-line/home/xuwang/Downloads/enteryenter xu
save

What would the correct syntax be?


push is a command line command, which is accessed by typing :. So you need 
to prefix push with : to enter the command line. So you would start your 
macro :push instead of push.


Cheers,
Cameron Simpson c...@zip.com.au

(Bashir tells the story of the boy who cried Wolf)
Bashir: If you lie all the time, no one is going to believe you, even
 when you're telling the truth.
Garak: Are you sure that's the point, Doctor?
Bashir: Of course. What else would it be?
Garak: That you should never tell the same lie twice.


Re: using 'push' in a macro

2015-06-03 Thread David Champion
* On 03 Jun 2015, Cameron Simpson wrote: 
 On 31May2015 08:26, Xu Wang xuwang...@gmail.com wrote:
 Sometimes I would like to use 'push' in a macro, but I cannot figure
 out the way to achieve this. For example, I have:
 
 macro attach E push
 save-entrykill-line/home/xuwang/Downloads/enteryenter xu
 save
 
 What would the correct syntax be?
 
 push is a command line command, which is accessed by typing :. So you
 need to prefix push with : to enter the command line. So you would start
 your macro :push instead of push.

There may be a misundertanding though.  Hooks execute commands, so
to make a hook trigger keyboard events you need push.  Macros are
opposite: they do not execute commands, they execute keyboard events.
So typically a macro would not use push -- it would be redundant.  On
the surface, it seems this should do what you want:

  macro attach E 
save-entrykill-line/home/xuwang/Downloads/enteryenter xu save

There may be reasons to have a push inside a macro, but it would
be as part of some other command which the macro is executing via
enter-command (same as Cameron's : above).  So then it's a problem
of using push with that command, not of using push with macro.

-- 
David Champion • d...@bikeshed.us


using 'push' in a macro

2015-05-31 Thread Xu Wang
Sometimes I would like to use 'push' in a macro, but I cannot figure
out the way to achieve this. For example, I have:

macro attach E push
save-entrykill-line/home/xuwang/Downloads/enteryenter xu
save

What would the correct syntax be?

Kind regards,

Xu