[slim-vim] Patch for Vim FFI, searching
Larry Clapp
larry at theclapp.org
Mon Jun 19 10:27:03 CDT 2006
On Mon, Jun 19, 2006 at 07:32:45AM -0700, Brad Beveridge wrote:
> On 19/06/06, Larry Clapp <larry at theclapp.org> wrote:
> > but they both suffer from a minor annoyance: search() in Vim7 has
> > 8 flags, which are all essentially booleans; having a keyword for
> > each, which is just T or NIL, seems excessive. For example, we
> > might end up with
> >
> > (vim:search "pattern"
> > :back t :accept-match-at-cursor t :move-to-end t
> > :return-match-count t :set-tick-mark t :wrap t)
> >
> > All the T's seem pretty redundant. What do we think of just having a
> > list of flags:
> >
> > (vim:search
> > '(:back :accept-match-at-cursor :move-to-end :return-match-count
> > :set-tick-mark :wrap))
> >
> That's a really good point. What is the "Lispy" way to do flags
> like this? I suspect it is probably to have the enabled flags in a
> list like you have them. Alternately we could define search as
> (defun search (pattern &rest flags)....)
Yeah, that'd be better. Oops. :)
We could manually parse the flags and look for ":stopline <string>",
too. ("stopline" is new in Vim7.)
-- Larry
More information about the slim-vim
mailing list