[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: optimal skeleton definition
From: |
Stefan Monnier |
Subject: |
Re: optimal skeleton definition |
Date: |
Sun, 08 Jan 2006 23:07:13 -0500 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) |
> 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?
Quote your setq. I.e. use
'(setq foo bar)
instead of
(setq foo bar)
-- Stefan