help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: emacs function for writing C++ iterator loop


From: Mohitz
Subject: Re: emacs function for writing C++ iterator loop
Date: Thu, 28 Jun 2007 23:35:37 -0700
User-agent: G2/1.0

> Hi
> This is probably a good starting 
> point:http://www.emacswiki.org/cgi-bin/wiki/SkeletonMode
> Cheers,

Thank you so much... Got it working :)

I would post the solution in case it benefits someone else..

(define-skeleton generate-iterator-loop
      "Generate Iterator Loop"
      ""
      > (setq v1 (skeleton-read "Iterate on? ")) "<"
      > (setq v4 (skeleton-read "Class Name? ")) "> "
      > (setq v2 (skeleton-read "Var Name? ")) " = "
      > (setq v3 (skeleton-read "Points to? ")) ";" \n
      > v1 "<" v4 ">::iterator " v2 "Iterate;" \n
      > v2 "Iterate = " v2 ".begin();" \n
      > "while (" v2 "Iterate != " v2  ".end())" \n
      > "{" \n
      > v4 " temp" v4 ";" \n
      > "temp" v4 " = *" v2 "Iterate;" \n
      > "//Do something with temp" v4 \n
      > v2 "Iterate++;" \n
      > "}" \n)




reply via email to

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