emacs-devel
[Top][All Lists]
Advanced

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

Re: skeleton.el _ versus @, a new patch


From: Stefan Monnier
Subject: Re: skeleton.el _ versus @, a new patch
Date: Tue, 22 Apr 2003 09:31:35 -0400

> > > Here is a patch to add - as an alternate skeleton character.  - operates
> > > exactly as _ in setting skeleton-point, but does not interact with the
> > > region wrapping effects.  This means that @ is completely unaffected and
> > > remains as just the method of setting the skeleton-positions.
> > > 
> > > --- skeleton.el.orig    Sat Jul 14 04:21:08 2001
> > > +++ skeleton.el Sun Apr 20 15:44:44 2003
> > > @@ -453,7 +453,8 @@
> > >         ((eq element '|)
> > >          (unless skeleton-modified (pop skeleton)))
> > >         ((eq element '@)
> > > -        (push (point) skeleton-positions)
> > > +        (push (point) skeleton-positions))
> > > +       ((eq element '-)
> > >          (unless skeleton-point (setq skeleton-point (point))))
> > >         ((eq 'quote (car-safe element))
> > >          (eval (nth 1 element)))
> > 
> > I think in that case, we should set skeleton-point unconditionally.
> 
> You *really* only want to set it on the first occurrence of the
> appropriate character, not the last!

I don't see why anyone would want to put more than 1 such operator
in a skeleton anyway.  So reason why I want to make it unconditional
is so that you can do (nil "do {" \n _ \n "} while (" - ")") and be
sure that point will always end up between the parens (I wouldn't
want this behavior, personally, but given such a skeleton why would
the author have put the `-' if it's not to specify where to place
point).


        Stefan





reply via email to

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