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

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

Re: multiple inserts within skeletons


From: Harry Putnam
Subject: Re: multiple inserts within skeletons
Date: Tue, 29 Apr 2003 14:51:25 GMT
User-agent: Gnus/5.090019 (Oort Gnus v0.19) Emacs/21.3.50 (gnu/linux)

Oliver Scholz <alkibiades@gmx.de> writes:


> A skeleton may contain a sub-skeleton as an element. In this case it
> is repeated until the user hits RET without having anything
> entered. For example:
>
> (define-skeleton my-comment
>   "FIXME: documentation"
>   nil
>   "BEGIN NONSENSE" \n
>   > "Everything on the following lines" \n
>   > "is pure nonsense." \n
>   ("Type a silly word: " "lirum larum -- " str & \n | -15)
>   "END NONSENSE")

This is close to something I've tried to do a few times.  Maybe you
can coach me a little here.

I'd like to produce and insert that looks like:

# Keywords: Some Key words
# More commentary
# yet more comentary
# CURRENT_DATE
# &&

Trying to rework your example like this comes sort of close.:

(define-skeleton my-comment
  "Keywords formatted input"
  nil
  "# Keywords: " 
  ("Type descriptive comments: " "# " str & \n | -15)
  "END NONSENSE")

# Keywords: # some key words
# more commentary
# yet more commentary
# CURRENT_DATE
# &&

NOTE:  Current Date and closing ampersands added by hand but I'd like
the skeleton to do that for me.

1) How can I make the octothorpe begin to appear only after the
   keywords line, so it doesn't appear after `Keywords'.

2) Can I arrange the skeleton so that when I press C-g to break out,
   it inserts the CURRENT_DATE followed by `# &&' on a separate line?
   Or in some other way cause those last two items to be inserted
   automatically 


reply via email to

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