[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: |
Fri, 28 Jun 2013 05:17:42 -0400 |
User-agent: |
Mutt/1.5.20 (2009-06-14) |
On Fri, Jun 28, 2013 at 12:55:48PM +1000, Brendan O'Dea wrote:
> On 28 June 2013 10:40, Thomas Dickey <address@hidden> 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.
>
> An option would be to permit a register prefix to ^X-/ search, in
> which case the search pattern would come from the register rather than
> the screen. Lightly tested implementation appended. Example use:
>
> "zy2e
>
> to yank two words to register z, then
>
> "z^X/
>
> to search for those two words.
But wouldn't that require adding a prefix for "all" commands? That would
seem to introduce some ambiguities. We might need a special flavor for
this, e.g.,
"screen-search-forward" ^X-/
vs
"register-search-forward" ^X-/
Copying between registers (Paul can remind us?) seems to be a weak point.
Also, for macros it might be helpful to add a function that filters a
string so that the regular expression matching metacharacters are escaped.
--
Thomas E. Dickey <address@hidden>
http://invisible-island.net
ftp://invisible-island.net
signature.asc
Description: Digital signature