[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [vile] searching for register contents
From: |
Thomas Dickey |
Subject: |
Re: [vile] searching for register contents |
Date: |
Sat, 06 Jul 2013 14:25:13 -0400 |
User-agent: |
Mutt/1.5.20 (2009-06-14) |
On Wed, Jul 03, 2013 at 11:14:35PM -0400, Wayne Cuddy wrote:
> On Wed, Jul 03, 2013 at 09:14:31PM -0400, Thomas Dickey wrote:
> > On Wed, Jul 03, 2013 at 05:01:34PM -0400, Wayne Cuddy wrote:
> > > On Thu, Jun 27, 2013 at 08:40:21PM -0400, Thomas Dickey wrote:
> > > > On Thu, Jun 27, 2013 at 03:47:57PM -0400, Wayne Cuddy wrote:
> > > > > If I yank a word (or words) into a register is there a way to search
> > > > > the current buffer for that registers contents?
> > > >
> > > > hmm. That puts the content into the unnamed buffer as well as
> > > > kill-buffer-1.
> > > > The $kill variable gets part of that (I recall as the first chunk, which
> > > > should be enough for word/words), so you could assign that to $search,
> > > > and use it - provided there are no metacharacters.
> > > >
> > >
> > > So how do I set $search to $kill?
> > >
> > > The following sequence
> > >
> > > set-variable $search $kill
> >
> > This seems to work as I would expect (putting it in a file and source'ing
> > it):
> >
> > setv $search=$kill
> > show-register
> > show-variables
> >
> > ...which should work in a macro. If using the : prompt, then there is no
> > substitution
> > performed.
> >
> > > assigned the literal string $kill to search and not the content of
> > > the variable. Is this something I need to use a procedure along with
> > > the &cat command in order to achieve?
> >
> > --
> > Thomas E. Dickey <address@hidden>
> > http://invisible-island.net
> > ftp://invisible-island.net
>
> Ok, looks like I should have tried writing that to a file before mailing
> the list. This is close to what I'm after, but I need to shift between
> several searches. What I want is to load registers a, b and c with 3
> different strings and then be able to switch between searches.
>
> Uh... turns out all I needed was a procedure to load $search from the
> named register:
>
> store-procedure Find-Register string='Register'
> setv $search ®ister $1
> ~endm
>
> Now what would icing on the cake would be a function that could either
> escape the meta-characters in the search string or if there existed
right - that was what I was suggesting.
> something like literal-search-forward that would treat the search
> pattern as a string instead of a regexp.
>
> But I'm good for now :)
>
> Very handy... Thanks for the tips Thomas.
no problem (report bugs). I have changes for 9.8k, but kind of wanted
to investigate the open bug on savannah first...
--
Thomas E. Dickey <address@hidden>
http://invisible-island.net
ftp://invisible-island.net
signature.asc
Description: Digital signature