On 24 fév 2005, Pierre Courtieu wrote:
> It will insert:
>
> if ( [0] ) {
> [1]
> } else {
> [2]
> }
>
> And write to minibuffer - 'Marks set: 3, use C-u C-SPC to jump next.'
> Hope this is what you are looking for.
This is exactly what I was looking for. Thanks a lot!
Well, after looking at it, specially to this kind of definition:
(defvar mc-if-skel
'(nil
"if (" _ ") {" \n
'(progn (mc-push-mark) nil) \n
"}" '(progn (indent-according-to-mode) nil) \n
'(progn (mc-push-mark) nil)
nil)
"*Skeleton for if statement")
I still think that adding the '@' as a special marker telling "store this
position into skeleton-position" is a good idea. For example the above
statement becomes.:
(defvar mc-if-skel
'(nil
"if (" _ ") {" \n > @ \n > "}"
'(progn (indent-according-to-mode) nil) \n > @
nil)
"*Skeleton for if statement")
Then you can use add a hook skeleton-end-hook to store those positions in
mark-stack if you want (I plan to make another hook building a "hole" at
each position).
Moreover why do you need indent-according-to-mode? replacing it by >
wouldn't be the same?
Anyway thanks for the quick answer.
--
Pierre Courtieu