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

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

optimal skeleton definition


From: Martin Slouf
Subject: optimal skeleton definition
Date: Sun, 8 Jan 2006 18:34:48 +0100
User-agent: Mutt/1.5.11

hi,

being not an elisp expert i wrote this kind of skeleton to simplify my java
getter/setter generation, which is later bound to some abbrev to be expanded
automatically.

- - - -

(define-skeleton java-getter-setter
  "inserts java getter/setter pair"
  nil (setq v1 (skeleton-read "Input Java type: "))
  nil (setq v2 (skeleton-read "Input property name: "))
  (setq method-part-name (concat (upcase (substring v2 0 1)) (substring v2 1)))
  nil >"public " v1 " get" method-part-name "() {"?\n
  >"return this." v2 ";"?\n
  "}">""?\n\n
  >"public void set" method-part-name "(" v1 " " v2 ") {"?\n
  >"this." v2 " = " v2 ";"?\n
  "}">)

- - - -

the problem of the code above is, that (setq ...) functions always return a
value and that value is printed into a buffer.  Is there a chance not to print
the value of the setq s-expression to the buffer?

thanks.  martin





reply via email to

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