[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how to use "process"?

From: clemens fischer
Subject: Re: how to use "process"?
Date: Tue, 16 Jun 2009 17:24:34 +0200
User-agent: tin/1.9.4-20090211 ("Rieclachan") (UNIX) (Linux/2.6.29-ARCH (i686))

Micah Cowan wrote:

> You could do
>  register r "^a:eval 'echo text one' 'sleep 3' 'echo text 2'^m"
>  process r
> for what you wanted... but then you could just as easily do the eval
> command by itself. :)

That is true, but I wanted to achieve something more complicated:  Often
I need to save some text from the screen with a prefix and a postfix
(for filenames conforming to my private naming scheme), ie.
mark-and-buffer-prefix, mark-and-buffer-postfix,
mark-and-buffer-actual-string and finally paste-prefix-string-postfix.
So I need to accumulate the various parts in registers.  I have
keybindings like "paste . p", "paste . r", "paste p.r" and needed one to
execute the last of them.

Now I need to make a keybinding in the copy-map to drop the second mark
and copy the paste-buffer over to some other register.  As it turns out,
"bindkey -m P paste . p" does not drop the second mark.

What I have now is this:

  # drop _second_ mark, transfer paste-buffer to register
  bindkey -m P eval 'stuff \040' 'paste . p'
  bindkey -m R eval 'stuff \040' 'paste . r'
  # paste prefix, paste-buffer and postfix
  bind r paste r.p

and I don't even need "process" ...  which doesn't matter, because now
I know what it does, which is a plus in itself!

Coming to think of it:  this is to the person wanting to make a (Lua-)
scripting interface:  all the functions from the copy-mode and the
keybinding mechanism need to be exported to scripting-land!  For
example, the keybindings above will certainly fail to work as intended
if the first mark hasn't been set, and this would have to be testable.

Again, thank's, guys, for your help!


reply via email to

[Prev in Thread] Current Thread [Next in Thread]