unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* skeletons/abbrevs
@ 2003-04-25 15:38 Oliver Lohmann
  0 siblings, 0 replies; 2+ messages in thread
From: Oliver Lohmann @ 2003-04-25 15:38 UTC (permalink / raw)


Hello,

i've got a problem with making useful
skeletons/abbrevs:

i.e. i define the following function/skeleton-construct:
;;===
(defun myFor(s1 s2 s3)
  (interactive "sSet Var: \nsSet BreakCondition: \nsSet Incr: ")
  (skeleton-insert'(nil
                    >"for(" s1 ";" s2 ";" s3 ")" "{" \n
                    > _ \n
                    > "}" \n
                    )))
;;===

how can i put into my abbrev-list with full functionality?

this entry does not work because of the missing parameters:
;;===
(define-abbrev c-mode-abbrev-table ";for"
  "" 'myFor)
;;===


thanks a lot for your help!

Best regards,
 Oliver Lohmann
____________   ______
\   \~~~\   \  \    /   Fachhochschule Wedel
 \   \   \   \  \  /   Feldstrasse 143
  \   \== \   \==\/   D-22880 Wedel
   \   \   \   \     Fachbereich
    \  /    \  /    Medieninformatik
     \/      \/    http://www.fh-wedel.de/

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: skeletons/abbrevs
       [not found] <mailman.5197.1051285138.21513.help-gnu-emacs@gnu.org>
@ 2003-04-26  9:34 ` Oliver Scholz
  0 siblings, 0 replies; 2+ messages in thread
From: Oliver Scholz @ 2003-04-26  9:34 UTC (permalink / raw)


Oliver Lohmann <nagash2270@yahoo.de> writes:

> Hello,
>
> i've got a problem with making useful
> skeletons/abbrevs:
>
> i.e. i define the following function/skeleton-construct:
> ;;===
> (defun myFor(s1 s2 s3)
>   (interactive "sSet Var: \nsSet BreakCondition: \nsSet Incr: ")
>   (skeleton-insert'(nil
>                     >"for(" s1 ";" s2 ";" s3 ")" "{" \n
>                     > _ \n
>                     > "}" \n
>                     )))
> ;;===

Use `define-skeleton' instead:

(define-skeleton my-for
  "Insert the skeleton for a for-loop."
  >"for(" 
  (skeleton-read "Set Var: ") ";" 
  (skeleton-read "Set BreakCondition: ") ";" 
  (skeleton-read "Set Incr: ") ")" "{" \n
  > _ \n
  > "}" \n)

(define-abbrev c-mode-abbrev-table "ffor" "" 'my-for)

    Oliver
-- 
6 Floréal an 211 de la Révolution
Liberté, Egalité, Fraternité!

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-04-26  9:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.5197.1051285138.21513.help-gnu-emacs@gnu.org>
2003-04-26  9:34 ` skeletons/abbrevs Oliver Scholz
2003-04-25 15:38 skeletons/abbrevs Oliver Lohmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).