changeset 33367:e4270e3ec3a4

(texinfo-block-default): New var. (texinfo-insert-block): Use it. Insert a newline if needed.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Fri, 10 Nov 2000 11:54:55 +0000
parents 756e811e42d2
children e2dab599ef4a
files lisp/textmodes/texinfo.el
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/textmodes/texinfo.el	Fri Nov 10 11:43:55 2000 +0000
+++ b/lisp/textmodes/texinfo.el	Fri Nov 10 11:54:55 2000 +0000
@@ -624,10 +624,16 @@
   "Regexp for environment-like TexInfo list commands.
    Subexpression 1 is what goes into the corresponding `@end' statement.")
 
+(defvar texinfo-block-default "example")
+
 (define-skeleton texinfo-insert-block
   "Create a matching pair @<cmd> .. @end <cmd> at point.
 Puts point on a blank line between them."
-  (completing-read "Block name: " (mapcar 'list texinfo-environments))
+  (setq texinfo-block-default
+	(completing-read (format "Block name [%s]: " texinfo-block-default)
+			 (mapcar 'list texinfo-environments)
+			 nil nil nil nil texinfo-block-default))
+  (unless (save-excursion (beginning-of-line) (looking-at "[ \t]*$")) '\n)
   "@" str \n _ \n "@end " str \n)
 
 (defun texinfo-inside-macro-p (macro &optional bound)