summaryrefslogtreecommitdiff
path: root/lisp/textmodes/texinfo.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2000-11-10 11:55:06 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2000-11-10 11:55:06 +0000
commitd7fa3319f5bf4c6e23ffc45c2d4385698773a080 (patch)
tree2f25f9bcffb8c8ed390e0b4def41d18e191557c3 /lisp/textmodes/texinfo.el
parent178932de25318366416499c3af975340c22323e4 (diff)
downloademacs-d7fa3319f5bf4c6e23ffc45c2d4385698773a080.tar.gz
(texinfo-block-default): New var.
(texinfo-insert-block): Use it. Insert a newline if needed.
Diffstat (limited to 'lisp/textmodes/texinfo.el')
-rw-r--r--lisp/textmodes/texinfo.el8
1 files changed, 7 insertions, 1 deletions
diff --git a/lisp/textmodes/texinfo.el b/lisp/textmodes/texinfo.el
index 1a8eec0cbd3..d578362f517 100644
--- a/lisp/textmodes/texinfo.el
+++ b/lisp/textmodes/texinfo.el
@@ -624,10 +624,16 @@ value of `texinfo-mode-hook'."
"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)