all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Optional argument in skeleton
@ 2015-05-25 11:37 David Arroyo Menendez
  0 siblings, 0 replies; only message in thread
From: David Arroyo Menendez @ 2015-05-25 11:37 UTC (permalink / raw)
  To: emacs-devel


Hi,

Using define-skeleton, I can create a function, such as

(define-skeleton php-ereg
  "Insert an ereg statement"
  ""
  '(setq regexp (skeleton-read "Regexp? "))
  '(setq string (skeleton-read "String? "))
  > "ereg(" regexp ", " string ");"
)

or 

(define-skeleton php-if
  "Insert a if statement"
  ""
  '(setq condition (skeleton-read "Condition? ")) \n
   > "if( " condition " ) {" \n
   > _ \n
   ( "other condition, %s: "
   > -2 "}" \n  
   > "else if( " str " ) {" \n
   > _ \n)
   > -2 "}" \n
   > "else {" \n
   > _ \n
   resume:
   > -2 "}" \n)

In the second function I've an optional part, but it's repeated n
times. I want a method to express a part conditional, but only 1 time.

Some idea?

Kind regards



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-05-25 11:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-25 11:37 Optional argument in skeleton David Arroyo Menendez

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.