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

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

Re: optimal skeleton definition: solved


From: Martin Slouf
Subject: Re: optimal skeleton definition: solved
Date: Mon, 9 Jan 2006 16:49:54 +0100
User-agent: Mutt/1.5.11

thanks a lot. m.

On Sun, Jan 08, 2006 at 11:07:13PM -0500, Stefan Monnier wrote:
> > 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
> _______________________________________________
> help-gnu-emacs mailing list
> help-gnu-emacs@gnu.org
> http://lists.gnu.org/mailman/listinfo/help-gnu-emacs




reply via email to

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