unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Martin Slouf <mar@centrum.cz>
Subject: optimal skeleton definition
Date: Sun, 8 Jan 2006 18:34:48 +0100	[thread overview]
Message-ID: <20060108173447.GD19057@barbucha.martin.net> (raw)

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	other threads:[~2006-01-08 17:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-08 17:34 Martin Slouf [this message]
     [not found] <mailman.359.1136741825.26925.help-gnu-emacs@gnu.org>
2006-01-09  4:07 ` optimal skeleton definition Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060108173447.GD19057@barbucha.martin.net \
    --to=mar@centrum.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).