diff options
Diffstat (limited to 'lisp/textmodes/texinfo.el')
-rw-r--r-- | lisp/textmodes/texinfo.el | 40 |
1 files changed, 27 insertions, 13 deletions
diff --git a/lisp/textmodes/texinfo.el b/lisp/textmodes/texinfo.el index 37da88410f9..8e5b94114a3 100644 --- a/lisp/textmodes/texinfo.el +++ b/lisp/textmodes/texinfo.el @@ -1,11 +1,11 @@ ;;; texinfo.el --- major mode for editing Texinfo files -;; Copyright (C) 1985,88,89,90,91,92,93,96,97,2000,01,03 +;; Copyright (C) 1985,88,89,90,91,92,93,96,97,2000,01,03,04 ;; Free Software Foundation, Inc. ;; Author: Robert J. Chassell ;; Date: [See date below for texinfo-version] -;; Maintainer: bug-texinfo@gnu.org +;; Maintainer: FSF ;; Keywords: maint, tex, docs ;; This file is part of GNU Emacs. @@ -59,6 +59,12 @@ :type 'string :group 'texinfo) +(defcustom texinfo-mode-hook nil + "Normal hook run when entering Texinfo mode." + :type 'hook + :options '(turn-on-auto-fill flyspell-mode) + :group 'texinfo) + ;;; Autoloads: @@ -310,7 +316,7 @@ chapter." (defvar texinfo-imenu-generic-expression '((nil "^@\\(node\\|anchor\\)[ \t]+\\([^,\n]*\\)" 2) ("Chapters" "^@chapter[ \t]+\\(.*\\)$" 1)) - "Imenu generic expression for TexInfo mode. See `imenu-generic-expression'.") + "Imenu generic expression for Texinfo mode. See `imenu-generic-expression'.") (defvar texinfo-font-lock-syntactic-keywords '(("\\(@\\)c\\(omment\\)?\\>" (1 "<")) @@ -330,11 +336,11 @@ chapter." "macro" "menu" "multitable" "quotation" "smalldisplay" "smallexample" "smallformat" "smalllisp" "table" "tex" "titlepage" "verbatim" "vtable") - "List of TeXinfo environments.") + "List of Texinfo environments.") (defconst texinfo-environment-regexp (concat "^@" (regexp-opt (cons "end" texinfo-environments) t) "\\>") - "Regexp for environment-like TexInfo list commands. + "Regexp for environment-like Texinfo list commands. Subexpression 1 is what goes into the corresponding `@end' statement.") (defface texinfo-heading-face @@ -367,7 +373,7 @@ Subexpression 1 is what goes into the corresponding `@end' statement.") ;; 1 (texinfo-clone-environment (match-beginning 1) (match-end 1)) keep) (,(concat "^@" (regexp-opt (mapcar 'car texinfo-section-list) t) ".*\n") 0 texinfo-heading-face t)) - "Additional expressions to highlight in TeXinfo mode.") + "Additional expressions to highlight in Texinfo mode.") (defun texinfo-clone-environment (start end) (let ((endp nil)) @@ -670,7 +676,7 @@ Puts point on a blank line between them." (defvar texinfo-enable-quote-macros "@\\(code\\|samp\\|kbd\\)\\>") (defvar texinfo-enable-quote-envs '("example\\>" "lisp\\>")) (defun texinfo-insert-quote (&optional arg) - "Insert the appropriate quote mark for TeXinfo. + "Insert the appropriate quote mark for Texinfo. Usually inserts the value of `texinfo-open-quote' (normally ``) or `texinfo-close-quote' (normally ''), depending on the context. With prefix argument or inside @code or @example, inserts a plain \"." @@ -797,10 +803,18 @@ The default is not to surround any existing words with the braces." (texinfo-insert-@-with-arg "file" arg)) (defun texinfo-insert-@item () - "Insert the string `@item' in a Texinfo buffer." + "Insert the string `@item' in a Texinfo buffer. +If in a table defined by @table, follow said string with a space. +Otherwise, follow with a newline." (interactive) - (insert "@item") - (newline)) + (insert "@item" + (if (equal (ignore-errors + (save-excursion + (texinfo-last-unended-begin) + (match-string 1))) + "table") + ? ;space + ?\n))) (defun texinfo-insert-@kbd (&optional arg) "Insert a `@kbd{...}' command in a Texinfo buffer. @@ -898,9 +912,8 @@ to jump to the corresponding spot in the Texinfo source file." ;; Second, create and format an *Occur* buffer (save-excursion (goto-char (point-min)) - (if nodes-too - (occur (concat "^@node\\>\\|" outline-regexp)) - (occur outline-regexp))) + (occur (concat "^\\(?:" (if nodes-too "@node\\>\\|") + outline-regexp "\\)"))) (pop-to-buffer "*Occur*") (goto-char (point-min)) (let ((inhibit-read-only t)) @@ -1039,4 +1052,5 @@ You are prompted for the job number (use a number shown by a previous (provide 'texinfo) +;;; arch-tag: 005d7c38-43b9-4b7d-aa1d-aea69bae73e1 ;;; texinfo.el ends here |