diff options
author | Richard M. Stallman <[email protected]> | 1995-02-06 03:26:35 +0000 |
---|---|---|
committer | Richard M. Stallman <[email protected]> | 1995-02-06 03:26:35 +0000 |
commit | c066ae5ca0495c433c47f4b242bd1f0a4c568cd2 (patch) | |
tree | 67ba6088ebb024a511911d2ce5e00196cc6dc698 /lisp/textmodes | |
parent | 81841847d14e995e083b3a537e97d3401e119abd (diff) |
(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.el | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/lisp/textmodes/texinfo.el b/lisp/textmodes/texinfo.el index 5067b629ee..dbdd532a1d 100644 --- a/lisp/textmodes/texinfo.el +++ b/lisp/textmodes/texinfo.el @@ -399,15 +399,11 @@ value of texinfo-mode-hook." (defconst texinfo-environment-regexp "^@\\(f?table\\|enumerate\\|itemize\\|ifinfo\\|iftex\\|ifset\\|ifclear\ \\|example\\|quotation\\|lisp\\|smallexample\\|smalllisp\\|display\\|format\ -\\|flushleft\\|flushright\\|ignore\\|group\\|tex\\|cartouche\\|end\ -\\|def[a-z]*\\)" +\\|flushleft\\|flushright\\|ignore\\|group\\|tex\\|cartouche\\|menu\ +\\|titlepage\\|end\\|def[a-z]*[a-wyz]\\>\\)" "Regexp for environment-like Texinfo list commands. Subexpression 1 is what goes into the corresponding `@end' statement.") -;; The following texinfo-insert-@end command not only inserts a SPC -;; after the @end, but tries to find out what belongs there. It is -;; not very smart: it does not understand nested lists. - (defun texinfo-insert-@end () "Insert the matching `@end' for the last Texinfo command that needs one." (interactive) @@ -419,9 +415,10 @@ Subexpression 1 is what goes into the corresponding `@end' statement.") (setq depth (1+ depth)) (setq depth (1- depth))))) (looking-at texinfo-environment-regexp) - (setq string - (buffer-substring (match-beginning 1) - (match-end 1)))) + (if (zerop depth) + (setq string + (buffer-substring (match-beginning 1) + (match-end 1))))) (insert "@end ") (if string (insert string "\n")))) |