1 ;;; tex-info.el --- Support for editing Texinfo source.
3 ;; Copyright (C) 1993, 1994, 1997, 2000, 2001, 2004, 2005, 2006, 2011
4 ;; Free Software Foundation, Inc.
6 ;; Maintainer: auctex-devel@gnu.org
9 ;; This file is part of AUCTeX.
11 ;; AUCTeX is free software; you can redistribute it and/or modify it
12 ;; under the terms of the GNU General Public License as published by
13 ;; the Free Software Foundation; either version 3, or (at your option)
16 ;; AUCTeX is distributed in the hope that it will be useful, but
17 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 ;; General Public License for more details.
21 ;; You should have received a copy of the GNU General Public License
22 ;; along with AUCTeX; see the file COPYING. If not, write to the Free
23 ;; Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
31 ;; Make sure the Texinfo mode of AUCTeX is still used after loading
32 ;; texinfo.el. (This is only an issue on Emacs 21.)
33 (when (and (boundp 'TeX-modes)
34 (memq 'texinfo-mode TeX-modes))
35 (defalias 'texinfo-mode 'TeX-texinfo-mode))
38 (defvar Texinfo-environment-list
39 '(("cartouche") ("command") ("copying") ("defcv") ("deffn") ("defivar")
40 ("defmac") ("defmethod") ("defop") ("defopt") ("defspec")
41 ("deftp") ("deftypefn") ("deftypefun") ("deftypevar") ("deftypevr")
42 ("defun") ("defvar") ("defvr") ("description") ("detailmenu")
43 ("direntry") ("display") ("documentdescription") ("enumerate")
44 ("example") ("float") ("flushleft") ("flushright") ("format") ("ftable")
45 ("group") ("html") ("ifclear") ("ifdocbook") ("ifhtml") ("ifinfo")
46 ("ifnotdocbook") ("ifnothtml") ("ifnotinfo") ("ifnotplaintext")
47 ("ifnottex") ("ifnotxml") ("ifplaintext") ("ifset") ("iftex")
48 ("ifxml") ("ignore") ("itemize") ("lisp") ("macro") ("menu")
49 ("multitable") ("quotation") ("smalldisplay") ("smallexample")
50 ("smallformat") ("smalllisp") ("table") ("tex") ("titlepage")
51 ("verbatim") ("vtable"))
52 "Alist of Texinfo environments.")
54 (defconst texinfo-environment-regexp
55 ;; Overwrite version from `texinfo.el'.
57 (mapconcat 'car Texinfo-environment-list "\\|")
59 "Regexp for environment-like Texinfo list commands.
60 Subexpression 1 is what goes into the corresponding `@end' statement.")
62 (defun Texinfo-environment (env &optional arg)
63 "Make Texinfo environment ENV.
64 With optional ARG, modify current environment."
65 ;; XXX: This could be enhanced to act like `LaTeX-environment',
66 ;; i.e. suggest a default environment and have its own history.
67 (interactive (list (completing-read "Environment: "
68 Texinfo-environment-list)
71 (Texinfo-modify-environment env)
72 (Texinfo-insert-environment env)))
74 (defun Texinfo-insert-environment (env)
75 "Insert Texinfo environment ENV."
76 (if (and (TeX-active-mark)
77 (not (eq (mark) (point))))
79 (when (< (mark) (point))
80 (exchange-point-and-mark))
81 (unless (TeX-looking-at-backward "^[ \t]*")
86 (unless (TeX-looking-at-backward "^[ \t]*")
89 (save-excursion (newline))
91 (insert "@" env "\n\n@end " env "\n")
92 (if (null (cdr-safe (assoc "defcv" Texinfo-environment-list)))
95 (defun Texinfo-modify-environment (env)
96 "Change current environment to environment ENV."
98 (Texinfo-find-env-end)
99 (re-search-backward (concat (regexp-quote TeX-esc) "end \\([a-zA-Z]*\\)")
100 (line-beginning-position))
101 (replace-match env t t nil 1)
103 (Texinfo-find-env-start)
104 (re-search-forward (concat (regexp-quote TeX-esc) "\\([a-zA-Z]*\\)")
106 (replace-match env t t nil 1)))
108 (defun Texinfo-find-env-end ()
109 "Move point to the end of the current environment."
111 (let* ((envs (mapcar 'car Texinfo-environment-list))
112 (regexp (concat "^[ \t]*" (regexp-quote TeX-esc) "\\(end \\)*"
113 (regexp-opt envs t) "\\b"))
121 ;; Stop if point is inside of an @end <env> command, but not
122 ;; if it is behind it.
123 (when (and (looking-at regexp)
125 (> (match-end 0) orig-pos))
127 (while (and (> level 0) (re-search-forward regexp nil t))
129 (setq level (1- level))
130 (setq level (1+ level)))))
132 (goto-char (match-end 0))
133 (error "Can't locate end of current environment")))))
135 (defun Texinfo-find-env-start ()
136 "Move point to the start of the current environment."
138 (let* ((envs (mapcar 'car Texinfo-environment-list))
139 (regexp (concat "^[ \t]*\\(" (regexp-quote TeX-esc) "\\)\\(end \\)*"
140 (regexp-opt envs t) "\\b"))
148 ;; Stop if point is inside of an @<env> command, but not if
150 (when (and (looking-at regexp)
151 (not (match-string 2))
152 (< (match-beginning 1) orig-pos))
154 (while (and (> level 0) (re-search-backward regexp nil t))
156 (setq level (1+ level))
157 (setq level (1- level)))))
159 (goto-char (match-beginning 0))
160 (error "Can't locate start of current environment")))))
162 (defun Texinfo-mark-environment (&optional count)
163 "Set mark to end of current environment and point to the matching begin.
164 If prefix argument COUNT is given, mark the respective number of
165 enclosing environments. The command will not work properly if
166 there are unbalanced begin-end pairs in comments and verbatim
169 ;; This is identical to the LaTeX counterpart but for the find begin/end
170 ;; functions. So some day the implemenation should be factorized.
172 (setq count (if count (abs count) 1))
173 (let ((cur (point)) beg end)
174 ;; Only change point and mark after beginning and end were found.
175 ;; Point should not end up in the middle of nowhere if the search fails.
178 (Texinfo-find-env-end))
179 (setq end (line-beginning-position 2))
182 (Texinfo-find-env-start)
183 (unless (= (1+ c) count)
184 (beginning-of-line 0)))
188 (TeX-activate-region)))
190 (defun Texinfo-mark-section (&optional no-subsection)
191 "Mark current section, with inclusion of any containing node.
193 The current section is detected as starting by any of the
194 structuring commands matched by regexp in variable
195 `outline-regexp' which in turn is a regexp matching any element
196 of variable `texinfo-section-list'.
198 If optional argument NO-SUBSECTION is set to any integer or is a
199 non nil empty argument (i.e. `C-u \\[Texinfo-mark-section]'),
200 then mark the current section with exclusion of any subsections.
202 Otherwise, any included subsections are also marked along with
205 Note that when current section is starting immediatley after a
206 node commande, then the node command is also marked as part as
209 (let (beg end is-beg-section is-end-section
210 (section-re (concat "^\\s-*" outline-regexp)))
211 (if (and (consp no-subsection) (eq (car no-subsection) 4))
212 ;; section with exclusion of any subsection
213 (setq beg (save-excursion
214 (unless (looking-at section-re)
216 (re-search-backward section-re nil t))
221 (re-search-forward (concat section-re
222 "\\|^\\s-*@bye\\_>" ) nil t)
226 is-end-section (match-string 1))
227 ;; full section without exclusion of any subsection
228 (let (section-command-level)
232 (re-search-backward section-re nil t)))
234 (setq is-beg-section t
235 section-command-level
236 (cadr (assoc (match-string 1) texinfo-section-list))
241 (and (re-search-forward
242 (concat section-re "\\|^\\s-*@bye\\_>" ) nil t)
243 (or (null (setq is-end-section (match-string 1)))
244 (> (cadr (assoc is-end-section
245 texinfo-section-list))
246 section-command-level))))
247 (when (match-string 0)
249 (point))))))); (if ...)
251 ;; now take also enclosing node of beg and end
253 (boundary '(beg end))
254 (when (symbol-value (intern (concat "is-" (symbol-name boundary)
257 (goto-char (symbol-value boundary))
262 (beginning-of-line 0)
263 (looking-at "^\\s-*\\($\\|@\\(c\\|comment\\)\\_>\\)"))))
264 (when (looking-at "^\\s-*@node\\_>")
265 (set boundary (point))))))
269 (TeX-activate-region) )))
271 (defun Texinfo-mark-node ()
272 "Mark the current node. \
273 This is the node in which the pointer is. It is starting at
274 previous beginning of keyword `@node' and ending at next
275 beginning of keyword `@node' or `@bye'."
277 (let ((beg (save-excursion
278 (unless (looking-at "^\\s-*@\\(?:node\\)\\_>")
280 (re-search-backward "^\\s-*@\\(?:node\\)\\_>" nil t )))
283 (and (re-search-forward "^\\s-*@\\(?:node\\|bye\\)\\_>" nil t )
284 (progn (beginning-of-line) (point))))))
289 (TeX-activate-region) )))
291 (defun Texinfo-insert-node ()
292 "Insert a Texinfo node in the current buffer.
293 That means, insert the string `@node' and prompt for current,
294 next, previous and upper node. If there is an active region, use
295 this for the current node and inhibit the prompt for it. Insert
296 a comment on the following line indicating the order of arguments
299 (let ((active-mark (and (TeX-active-mark) (not (eq (mark) (point)))))
300 nodes node-name next-node previous-node up-node)
301 ;; Build list of nodes in current buffer.
302 ;; (What about using `imenu--index-alist'?)
303 ;; FIXME: Support multi-file documents.
305 (goto-char (point-min))
306 (while (re-search-forward "^@node\\b" nil t)
307 (skip-chars-forward " \t")
309 (list (buffer-substring-no-properties
310 (point) (progn (skip-chars-forward "^,")
313 (setq node-name (read-string "Node name: ")))
314 ;; FIXME: What if key binding for `minibuffer-complete' was changed?
315 ;; `substitute-command-keys' doesn't return the correct value.
316 (setq next-node (completing-read "Next node (TAB completes): " nodes))
318 (completing-read "Previous node (TAB completes): " nodes))
319 (setq up-node (completing-read "Upper node (TAB completes): " nodes))
320 (when (and active-mark
322 (exchange-point-and-mark))
327 (insert ", " next-node ", " previous-node ", " up-node
328 "\n@comment node-name, next, previous, up\n")
329 ;; Position point at first empty field.
330 (unless (and (or (> (length node-name) 0) active-mark)
331 (> (length next-node) 0)
332 (> (length previous-node) 0)
333 (> (length up-node) 0))
337 (if (or (> (length node-name) 0) active-mark)
338 (progn (skip-chars-forward "^,") (forward-char 2))
340 (dolist (node (list next-node previous-node up-node))
341 (if (> (length node) 0)
342 (progn (skip-chars-forward "^,") (forward-char 2))
343 (throw 'break nil)))))))
345 ;; Silence the byte-compiler from warnings for variables and functions declared
348 (defvar reftex-section-levels-all)
349 (defvar reftex-level-indent)
350 (defvar reftex-label-menu-flags)
351 (defvar reftex-tables-dirty)
353 (when (fboundp 'declare-function)
354 (declare-function reftex-match-string "reftex" (n))
355 (declare-function reftex-section-number "reftex-parse" (&optional level star))
356 (declare-function reftex-nicify-text "reftex" (text))
357 (declare-function reftex-ensure-compiled-variables "reftex" ())))
359 (defun Texinfo-reftex-section-info (file)
360 ;; Return a section entry for the current match.
361 ;; Carefull: This function expects the match-data to be still in place!
362 (let* ((marker (set-marker (make-marker) (1- (match-beginning 3))))
363 (macro (reftex-match-string 3))
364 (level-exp (cdr (assoc macro reftex-section-levels-all)))
365 (level (if (symbolp level-exp)
366 (save-match-data (funcall level-exp))
368 (unnumbered (< level 0))
370 (section-number (reftex-section-number level unnumbered))
371 (text1 (save-match-data
373 (buffer-substring-no-properties (point) (progn (end-of-line) (point))))))
374 (literal (buffer-substring-no-properties
375 (1- (match-beginning 3))
376 (min (point-max) (+ (match-end 0) (length text1) 1))))
377 ;; Literal can be too short since text1 too short. No big problem.
378 (text (reftex-nicify-text text1)))
380 ;; Add section number and indentation
383 (make-string (* reftex-level-indent level) ?\ )
384 (if (nth 1 reftex-label-menu-flags) ; section number flag
385 (concat section-number " "))
387 (list 'toc "toc" text file marker level section-number
388 literal (marker-position marker))))
390 (defun Texinfo-reftex-hook ()
391 "Hook function to plug Texinfo into RefTeX."
392 ;; force recompilation of variables
393 (when (string= TeX-base-mode-name "Texinfo")
394 ;; dirty temporary hook to remove when reftex has a Texinfo builtin
395 ;; TODO --- taken on <2014-01-06 mon> --- remove the dirty trick once reftex
396 ;; has been corrected for long enough a time
397 (unless (assq 'Texinfo reftex-label-alist-builtin)
398 (setq reftex-label-alist-builtin (append reftex-label-alist-builtin
399 '((Texinfo "Texinfo default environments" nil)))))
400 (dolist (v `((reftex-section-pre-regexp . "@")
401 ; section post-regexp must contain exactly one group
402 (reftex-section-post-regexp . "\\([ \t]+\\)")
403 (reftex-section-info-function . Texinfo-reftex-section-info)
404 (reftex-default-label-alist-entries . (Texinfo))
405 (reftex-section-levels
408 (if (string-match "\\(\\`unnumbered\\)\\|\\(heading\\'\\)\\|\\(\\`top\\'\\)"
410 (cons (car x) (- (cadr x)))
411 (cons (car x) (cadr x))))
412 texinfo-section-list))))
413 (set (make-local-variable (car v) ) (cdr v)))
414 (reftex-ensure-compiled-variables)))
418 (defvar Texinfo-mode-map
419 (let ((map (make-sparse-keymap)))
420 (set-keymap-parent map TeX-mode-map)
423 ;; bindings for updating nodes and menus
424 (define-key map "\C-c\C-um" 'texinfo-master-menu)
425 (define-key map "\C-c\C-u\C-m" 'texinfo-make-menu)
426 (define-key map "\C-c\C-u\C-n" 'texinfo-update-node)
427 (define-key map "\C-c\C-u\C-e" 'texinfo-every-node-update)
428 (define-key map "\C-c\C-u\C-a" 'texinfo-all-menus-update)
430 ;; Simulating LaTeX-mode
431 (define-key map "\C-c\C-e" 'Texinfo-environment)
432 (define-key map "\C-c." 'Texinfo-mark-environment)
433 (define-key map "\C-c*" 'Texinfo-mark-section)
434 (define-key map "\M-\C-h" 'Texinfo-mark-node)
435 (define-key map "\C-c\n" 'texinfo-insert-@item)
436 (or (key-binding "\e\r")
437 (define-key map "\e\r" 'texinfo-insert-@item)) ;*** Alias
438 (define-key map "\C-c\C-s" 'Texinfo-insert-node)
439 (define-key map "\C-c]" 'texinfo-insert-@end)
441 "Keymap for Texinfo mode.")
443 (easy-menu-define Texinfo-command-menu
445 "Menu used in Texinfo mode for external commands."
446 (TeX-mode-specific-command-menu 'texinfo-mode))
448 (easy-menu-define Texinfo-mode-menu
450 "Menu used in Texinfo mode."
453 ["Node ..." texinfo-insert-@node
454 :help "Insert a node"]
455 ["Macro ..." TeX-insert-macro
456 :help "Insert a macro and possibly arguments"]
457 ["Complete Macro" TeX-complete-symbol
458 :help "Complete the current macro"]
459 ["Environment ..." Texinfo-insert-environment
460 :help "Insert an environment"]
461 ["Item" texinfo-insert-@item
462 :help "Insert an @item"]
465 ["Emphasize" (TeX-font nil ?\C-e) :keys "C-c C-f C-e"]
466 ["Bold" (TeX-font nil ?\C-b) :keys "C-c C-f C-b"]
467 ["Typewriter" (TeX-font nil ?\C-t) :keys "C-c C-f C-t"]
468 ["Small Caps" (TeX-font nil ?\C-c) :keys "C-c C-f C-c"]
469 ["Italic" (TeX-font nil ?\C-i) :keys "C-c C-f C-i"]
470 ["Sample" (TeX-font nil ?\C-s) :keys "C-c C-f C-s"]
471 ["Roman" (TeX-font nil ?\C-r) :keys "C-c C-f C-r"])
473 ["Emphasize" (TeX-font t ?\C-e) :keys "C-u C-c C-f C-e"]
474 ["Bold" (TeX-font t ?\C-b) :keys "C-u C-c C-f C-b"]
475 ["Typewriter" (TeX-font t ?\C-t) :keys "C-u C-c C-f C-t"]
476 ["Small Caps" (TeX-font t ?\C-c) :keys "C-u C-c C-f C-c"]
477 ["Italic" (TeX-font t ?\C-i) :keys "C-u C-c C-f C-i"]
478 ["Sample" (TeX-font t ?\C-s) :keys "C-u C-c C-f C-s"]
479 ["Roman" (TeX-font t ?\C-r) :keys "C-u C-c C-f C-r"])
480 ["Delete Font" (TeX-font t ?\C-d) :keys "C-c C-f C-d"]
482 ["Create Master Menu" texinfo-master-menu
483 :help "Make a master menu for the whole Texinfo file"]
484 ["Create Menu" texinfo-make-menu
485 :help "Make or update the menu for the current section"]
486 ["Update Node" texinfo-update-node
487 :help "Update the current node"]
488 ["Update Every Node" texinfo-every-node-update
489 :help "Update every node in the current file"]
490 ["Update All Menus" texinfo-all-menus-update
491 :help "Update every menu in the current file"]
494 ["Comment or Uncomment Region"
495 TeX-comment-or-uncomment-region
496 :help "Comment or uncomment the currently selected region"]
497 ["Comment or Uncomment Paragraph"
498 TeX-comment-or-uncomment-paragraph
499 :help "Comment or uncomment the current paragraph"])
502 . ,TeX-common-menu-entries)))
504 (defvar Texinfo-font-list
521 "Font commands used in Texinfo mode. See `TeX-font-list'.")
526 (defalias 'Texinfo-mode 'texinfo-mode)
529 (defun TeX-texinfo-mode ()
530 "Major mode in AUCTeX for editing Texinfo files.
535 Entering Texinfo mode calls the value of `text-mode-hook' and then the
536 value of `Texinfo-mode-hook'."
538 (kill-all-local-variables)
540 (setq TeX-sentinel-default-function 'TeX-TeX-sentinel)
541 ;; Mostly stolen from texinfo.el
542 (setq TeX-base-mode-name "Texinfo")
543 (setq major-mode 'texinfo-mode)
544 (use-local-map Texinfo-mode-map)
545 (set-syntax-table texinfo-mode-syntax-table)
547 (set (make-local-variable 'page-delimiter)
549 "^@node [ \t]*[Tt]op\\|^@\\("
550 texinfo-chapter-level-regexp
552 (set (make-local-variable 'require-final-newline) t)
553 (set (make-local-variable 'indent-tabs-mode) nil)
554 (set (make-local-variable 'paragraph-separate)
555 (concat "\b\\|^@[a-zA-Z]*[ \n]\\|" paragraph-separate))
556 (set (make-local-variable 'paragraph-start)
557 (concat "\b\\|^@[a-zA-Z]*[ \n]\\|" paragraph-start))
558 (set (make-local-variable 'fill-column) 72)
559 (set (make-local-variable 'comment-start) "@c ")
560 (set (make-local-variable 'comment-start-skip) "@c +\\|@comment +")
561 (set (make-local-variable 'comment-use-syntax) nil)
562 (set (make-local-variable 'words-include-escapes) t)
563 (if (boundp 'texinfo-imenu-generic-expression)
564 ;; This was introduced in 19.30.
565 (set (make-local-variable 'imenu-generic-expression) texinfo-imenu-generic-expression))
567 (set (make-local-variable 'font-lock-defaults)
568 ;; COMPATIBILITY for Emacs 20
569 (if (boundp 'texinfo-font-lock-syntactic-keywords)
570 '(texinfo-font-lock-keywords
571 nil nil nil backward-paragraph
572 (font-lock-syntactic-keywords
573 . texinfo-font-lock-syntactic-keywords))
574 '(texinfo-font-lock-keywords t)))
575 (if (not (boundp 'texinfo-section-list))
576 ;; This was included in 19.31.
578 (set (make-local-variable 'outline-regexp)
580 (mapconcat 'car texinfo-section-list "\\>\\|")
582 (set (make-local-variable 'outline-level) 'texinfo-outline-level))
584 ;; Mostly AUCTeX stuff
585 (easy-menu-add Texinfo-mode-menu Texinfo-mode-map)
586 (easy-menu-add Texinfo-command-menu Texinfo-mode-map)
587 (set (make-local-variable 'TeX-command-current) 'TeX-command-master)
589 (setq TeX-default-extension "texi")
590 (set (make-local-variable 'TeX-esc) "@")
592 (set (make-local-variable 'TeX-auto-regexp-list) 'TeX-auto-empty-regexp-list)
593 (set (make-local-variable 'TeX-auto-update) t)
595 (setq TeX-command-default "TeX")
596 (setq TeX-header-end "%*end")
597 (setq TeX-trailer-start (regexp-quote (concat TeX-esc "bye")))
599 (set (make-local-variable 'TeX-complete-list)
600 (list (list "@\\([a-zA-Z]*\\)" 1 'TeX-symbol-list-filtered nil)
601 (list "" TeX-complete-word)))
603 (set (make-local-variable 'TeX-font-list) Texinfo-font-list)
604 (set (make-local-variable 'TeX-font-replace-function) 'TeX-font-replace-macro)
605 (set (make-local-variable 'TeX-style-hook-dialect) :texinfo)
607 (add-hook 'find-file-hooks (lambda ()
608 (unless (file-exists-p (buffer-file-name))
609 (TeX-master-file nil nil t))) nil t)
611 (when (and (boundp 'add-log-current-defun-function)
612 (fboundp 'texinfo-current-defun-name))
613 (setq add-log-current-defun-function
614 #'texinfo-current-defun-name))
617 '("acronym" "Acronym")
618 '("appendix" (TeX-arg-literal " ") (TeX-arg-free "Title"))
619 '("appendixsec" (TeX-arg-literal " ") (TeX-arg-free "Title"))
620 '("appendixsection" (TeX-arg-literal " ") (TeX-arg-free "Title"))
621 '("appendixsubsec" (TeX-arg-literal " ") (TeX-arg-free "Title"))
622 '("appendixsubsubsec" (TeX-arg-literal " ") (TeX-arg-free "Title"))
624 '("author" (TeX-arg-literal " ") (TeX-arg-free "Author"))
628 '("c" (TeX-arg-literal " ") (TeX-arg-free "Comment"))
629 '("caption" "Caption"
630 ;; TODO: caption is meaningful only inside float env. Maybe some checking
631 ;; and warning would be good.
633 '("center" (TeX-arg-literal " ") (TeX-arg-free "Line of text"))
634 '("chapheading" (TeX-arg-literal " ") (TeX-arg-free "Title"))
635 '("chapter" (TeX-arg-literal " ") (TeX-arg-free "Title"))
636 '("cindex" (TeX-arg-literal " ") (TeX-arg-free "Entry"))
637 '("cite" "Reference")
638 '("clear" (TeX-arg-literal " ") (TeX-arg-free "Flag"))
639 '("code" "Sample code")
640 '("command" "Command")
641 '("comment" (TeX-arg-literal " ") (TeX-arg-free "Comment"))
644 '("defcodeindex" (TeX-arg-literal " ") (TeX-arg-free "Index name"))
645 '("defindex" (TeX-arg-literal " ") (TeX-arg-free "Index name"))
650 '("email" "Email address")
653 '("evenfooting" Texinfo-lrc-argument-hook)
654 '("evenheading" Texinfo-lrc-argument-hook)
655 '("everyfooting" Texinfo-lrc-argument-hook)
656 '("everyheading" Texinfo-lrc-argument-hook)
657 '("exdent" (TeX-arg-literal " ") (TeX-arg-free "Line of text"))
661 '("findex" (TeX-arg-literal " ") (TeX-arg-free "Entry"))
662 '("footnote" "Text of footnote")
663 '("footnotestyle" (TeX-arg-literal " ") (TeX-arg-free "Style"))
665 '("heading" (TeX-arg-literal " ") (TeX-arg-free "Title"))
666 ;; XXX: Would be nice with completion.
667 '("headings" (TeX-arg-literal " ") (TeX-arg-free "On off single double"))
670 '("include" (TeX-arg-literal " ") (TeX-arg-free "Filename"))
671 '("inforef" "Node name" "Info file name")
674 '("kbd" "Keyboard characters")
676 '("kindex" (TeX-arg-literal " ") (TeX-arg-free "Entry"))
678 '("majorheading" (TeX-arg-literal " ") (TeX-arg-free "Title"))
682 '("node" (TeX-arg-literal " ") (TeX-arg-free "Name")
683 (TeX-arg-literal ", ") (TeX-arg-free "Next")
684 (TeX-arg-literal ", ") (TeX-arg-free "Previous")
685 (TeX-arg-literal ", ") (TeX-arg-free "Up"))
687 '("oddfooting" Texinfo-lrc-argument-hook)
688 '("oddheading" Texinfo-lrc-argument-hook)
690 '("paragraphindent" (TeX-arg-literal " ") (TeX-arg-free "Indent"))
694 '("printindex" (TeX-arg-literal " ") (TeX-arg-free "Index name"))
695 '("pxref" "Node name")
703 '("section" (TeX-arg-literal " ") (TeX-arg-free "Title"))
704 '("set" (TeX-arg-literal " ") (TeX-arg-free "Flag"))
705 ;; XXX: Would be nice with completion.
706 '("setchapternewpage" (TeX-arg-literal " ") (TeX-arg-free "On off odd"))
707 '("setfilename" (TeX-arg-literal " ") (TeX-arg-free "Info file name"))
708 '("settitle" (TeX-arg-literal " ") (TeX-arg-free "Title"))
713 '("subheading" (TeX-arg-literal " ") (TeX-arg-free "Title"))
714 '("subsection" (TeX-arg-literal " ") (TeX-arg-free "Title"))
715 '("subsubheading" (TeX-arg-literal " ") (TeX-arg-free "Title"))
716 '("subsubsection" (TeX-arg-literal " ") (TeX-arg-free "Title"))
717 '("subtitle" (TeX-arg-literal " ") (TeX-arg-free "Title"))
719 '("syncodeindex" (TeX-arg-literal " ") (TeX-arg-free "From index")
720 (TeX-arg-literal " ") (TeX-arg-free "Into index"))
721 '("synindex" (TeX-arg-literal " ") (TeX-arg-free "From index")
722 (TeX-arg-literal " ") (TeX-arg-free "Into index"))
730 '("tindex" (TeX-arg-literal " ") (TeX-arg-free "Entry"))
731 '("title" (TeX-arg-literal " ") (TeX-arg-free "Title"))
732 '("titlefont" "Text")
735 '("top" (TeX-arg-literal " ") (TeX-arg-free "Title"))
736 '("unnumbered" (TeX-arg-literal " ") (TeX-arg-free "Title"))
737 '("unnumberedsec" (TeX-arg-literal " ") (TeX-arg-free "Title"))
738 '("unnumberedsubsec" (TeX-arg-literal " ") (TeX-arg-free "Title"))
739 '("unnumberedsubsubsec" (TeX-arg-literal " ") (TeX-arg-free "Title"))
741 '("var" "Metasyntactic variable")
742 '("vindex" (TeX-arg-literal " ") (TeX-arg-free "Entry"))
743 '("vskip" (TeX-arg-literal " ") (TeX-arg-free "Amount"))
745 '("xref" "Node name"))
748 (add-hook 'reftex-mode-hook 'Texinfo-reftex-hook)
749 (if (and (boundp 'reftex-mode) reftex-mode)
750 (Texinfo-reftex-hook))
752 (TeX-run-mode-hooks 'text-mode-hook 'Texinfo-mode-hook)
755 (defcustom Texinfo-clean-intermediate-suffixes nil
756 "List of regexps matching suffixes of files to be deleted.
757 The regexps will be anchored at the end of the file name to be matched,
758 i.e. you do _not_ have to cater for this yourself by adding \\\\' or $."
759 :type '(repeat regexp)
762 (defcustom Texinfo-clean-output-suffixes
763 ;; See `man texi2html' for the HTML stuff.
764 '("\\.info\\(-[0-9]+\\)?" "\\.dvi" "\\.pdf" "\\.ps" "\\.html"
765 "_toc\\.html" "_fot\\.html" "_abt\\.html" "_[0-9]+\\.html" "_l2h_img.+")
766 "List of regexps matching suffixes of files to be deleted.
767 The regexps will be anchored at the end of the file name to be matched,
768 i.e. you do _not_ have to cater for this yourself by adding \\\\' or $."
769 :type '(repeat regexp)
774 ;;; tex-info.el ends here