aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/textmodes
diff options
context:
space:
mode:
authorRichard M. Stallman1995-02-06 03:26:35 +0000
committerRichard M. Stallman1995-02-06 03:26:35 +0000
commitc066ae5ca0495c433c47f4b242bd1f0a4c568cd2 (patch)
tree67ba6088ebb024a511911d2ce5e00196cc6dc698 /lisp/textmodes
parent81841847d14e995e083b3a537e97d3401e119abd (diff)
downloademacs-c066ae5ca0495c433c47f4b242bd1f0a4c568cd2.tar.gz
emacs-c066ae5ca0495c433c47f4b242bd1f0a4c568cd2.zip
(texinfo-environment-regexp): Match @menu and
@titlepage --- they require @ends. Don't match @defunx commands; they don't. (texinfo-insert-@end): Don't put a command name after the @end if we ran off the top of the buffer looking for its mate.
Diffstat (limited to 'lisp/textmodes')
-rw-r--r--lisp/textmodes/texinfo.el15
1 files changed, 6 insertions, 9 deletions
diff --git a/lisp/textmodes/texinfo.el b/lisp/textmodes/texinfo.el
index 5067b629ee9..dbdd532a1d9 100644
--- a/lisp/textmodes/texinfo.el
+++ b/lisp/textmodes/texinfo.el
@@ -399,15 +399,11 @@ value of texinfo-mode-hook."
399(defconst texinfo-environment-regexp 399(defconst texinfo-environment-regexp
400 "^@\\(f?table\\|enumerate\\|itemize\\|ifinfo\\|iftex\\|ifset\\|ifclear\ 400 "^@\\(f?table\\|enumerate\\|itemize\\|ifinfo\\|iftex\\|ifset\\|ifclear\
401\\|example\\|quotation\\|lisp\\|smallexample\\|smalllisp\\|display\\|format\ 401\\|example\\|quotation\\|lisp\\|smallexample\\|smalllisp\\|display\\|format\
402\\|flushleft\\|flushright\\|ignore\\|group\\|tex\\|cartouche\\|end\ 402\\|flushleft\\|flushright\\|ignore\\|group\\|tex\\|cartouche\\|menu\
403\\|def[a-z]*\\)" 403\\|titlepage\\|end\\|def[a-z]*[a-wyz]\\>\\)"
404 "Regexp for environment-like Texinfo list commands. 404 "Regexp for environment-like Texinfo list commands.
405Subexpression 1 is what goes into the corresponding `@end' statement.") 405Subexpression 1 is what goes into the corresponding `@end' statement.")
406 406
407;; The following texinfo-insert-@end command not only inserts a SPC
408;; after the @end, but tries to find out what belongs there. It is
409;; not very smart: it does not understand nested lists.
410
411(defun texinfo-insert-@end () 407(defun texinfo-insert-@end ()
412 "Insert the matching `@end' for the last Texinfo command that needs one." 408 "Insert the matching `@end' for the last Texinfo command that needs one."
413 (interactive) 409 (interactive)
@@ -419,9 +415,10 @@ Subexpression 1 is what goes into the corresponding `@end' statement.")
419 (setq depth (1+ depth)) 415 (setq depth (1+ depth))
420 (setq depth (1- depth))))) 416 (setq depth (1- depth)))))
421 (looking-at texinfo-environment-regexp) 417 (looking-at texinfo-environment-regexp)
422 (setq string 418 (if (zerop depth)
423 (buffer-substring (match-beginning 1) 419 (setq string
424 (match-end 1)))) 420 (buffer-substring (match-beginning 1)
421 (match-end 1)))))
425 (insert "@end ") 422 (insert "@end ")
426 (if string (insert string "\n")))) 423 (if string (insert string "\n"))))
427 424