[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [vile] (no subject)
From: |
Thomas Dickey |
Subject: |
Re: [vile] (no subject) |
Date: |
Mon, 31 Aug 2015 16:58:25 -0400 |
User-agent: |
Mutt/1.5.20 (2009-06-14) |
On Mon, Aug 31, 2015 at 12:45:10PM -0400, Wayne Cuddy wrote:
> On Sat, Aug 22, 2015 at 04:12:44PM -0400, Thomas Dickey wrote:
> > On Sat, Aug 22, 2015 at 10:49:11AM -0400, address@hidden wrote:
> > > : ; Fri, 21 Aug 2015 12:41:04 -0400
> > > Date: Fri, 21 Aug 2015 12:41:04 -0400
> > > From: Wayne Cuddy <address@hidden>
> > > To: Vile List <address@hidden>
> > > Subject: show contents of only a specified register
> > ...
> > > Is there a way to show the contents just one register?
> >
> > You could do this with a macro, e.g., something using the "put" command
> > into a buffer.
> >
> > > Sometimes I have a lot of registers in use so show-registers is a
> > > little noisy.
> >
>
> So here is the macro that I've come up with. The problem I'm having is
> that the 'put' function doesn't seem to accept the register to put from.
hmm -- I should have spent more time before replying, rather than rely upon
memory. But I've spent a little more time thinking how to improve this
area:
a) my initial view was noticing that there's no name-completion for registers,
and there's no special parameter type of registers for macros. Seemed like
an area for improvement.
b) As it exists, vile is running use-register before the put/yank commands.
That doesn't seem to mesh with scripts. At the moment I'm investigating
how to improve _that_ (or discover how it can be made to work with scripts).
> ~~~~~~~~~~~~~~~~~~~~
> store-procedure show-register string="reg" "show the contents of a single
> register"
> ~local %bn
> setv %bn &cat "register-" $1
> find-file %bn
> 1 goto-line
> delete-lines-til end-of-file
> put $1
> ~endm
> ~~~~~~~~~~~~~~~~~~~~
>
> I've tried:
>
> put "$1"
> $1 put
> "$1" put
>
> It will only put the contents of the unnamed register. If there is
> nothing in the unnamed register then it produces an error stating there
> is nothing in register 0.
>
> Also, I would have preferred to use kill-buffer to remove any existing
> register-X buffer before putting the register's contents. However when a
> buffer already exists, which is the case on subsequent runs, kill-buffer
> prompts to remove a modified but unsaved buffer. I tried the various
> nowarn settings as well as ~force with no success.
c) for this, I would refer to the which-keywords macro -- the first third
of that does the sort of buffer manipulation you're talking about.
--
Thomas E. Dickey <address@hidden>
http://invisible-island.net
ftp://invisible-island.net
signature.asc
Description: Digital signature