Re: skeleton improvement

Zajcev Evgeny <[email protected]> Thu, 24 Feb 2005 15:04:05 +0300
Newsgroups gmane.emacs.xemacs.design
Message-ID <[email protected]>
Pierre Courtieu <[email protected]> writes:

> Hi,
>
> I am writing a minor mode for having "holes" in your buffer that you can
> fill by different means. I would like to interface it with skeletons, and I
> am not able to get interesting positions after a skeleton has been
> inserted. In Emacs there is this variable 'skeleton-position which is made
> for this (added recently it seems). Moreover one can define in the skeleton
> what are the positions which should be added to this variable.
>
> My question is: is it possible to have such a variable also in XEmacs
> please?

Take a look at mcskels.el package, and how it defines/jumps to
interesting positions.  Basically there is only one interesting
position after skeleton is inserted - and point jumps to it.  However
mcskels.el has functionality which allows you to jump over numerous
interesting positions.  As an example, suppose you want to insert
if-else C statement:

   M-x mc-insert-stat-complete RET if-else RET

It will insert:

        if ( [0] ) {
                [1]
        } else {
                [2]
        }

And write to minibuffer - 'Marks set: 3, use C-u C-SPC to jump next.'

[0], [1] and [2] - are not text - they are interesting point position
- [0] is default interesting position where point jump after skeleton
is insreted.

Once you've have entered some text at [0] and pressed C-u C-SPC - it
will jump to [1] position, once you've finished with [1] and pressed
C-u C-SPC - it will jump to [2] position.

Hope this is what you are looking for.

-- 
lg