Function: Texinfo-mode

Texinfo-mode is an autoloaded, interactive and byte-compiled function defined in tex-info.el.

Signature

(Texinfo-mode)

Documentation

Major mode in AUCTeX for editing Texinfo files.

Entering Texinfo mode calls the value of text-mode-hook and then the value of Texinfo-mode-hook.

" TeX-insert-quote
$ TeX-insert-dollar
$ self-insert-command
@ TeX-insert-backslash
C-M-h Texinfo-mark-node
C-M-i TeX-complete-symbol
C-c " TeX-uncomment
C-c # TeX-normal-mode
C-c % TeX-comment-or-uncomment-paragraph
C-c ' TeX-comment-or-uncomment-paragraph
C-c * Texinfo-mark-section
C-c . Texinfo-mark-environment
C-c : comment-or-uncomment-region
C-c ; comment-or-uncomment-region
C-c ? TeX-documentation-texdoc
C-c C-a TeX-command-run-all
C-c C-b TeX-command-buffer(var)/TeX-command-buffer(fun)
C-c C-c TeX-command-master
C-c C-d TeX-save-document
C-c C-e Texinfo-environment
C-c C-f TeX-font
C-c C-j texinfo-insert-@item
C-c C-k TeX-kill-job
C-c C-l TeX-recenter-output-buffer
C-c C-n TeX-normal-mode
C-c C-o C-f TeX-fold-mode(var)/TeX-fold-mode(fun)
C-c C-r TeX-command-region
C-c C-s Texinfo-insert-node
C-c C-t C-b TeX-toggle-debug-bad-boxes
C-c C-t C-p TeX-PDF-mode(var)/TeX-PDF-mode(fun)
C-c C-t C-r TeX-pin-region
C-c C-t C-s TeX-source-correlate-mode(var)/TeX-source-correlate-mode(fun)
C-c C-t C-w TeX-toggle-debug-warnings
C-c C-t C-x TeX-toggle-suppress-ignored-warnings
C-c C-t TAB TeX-interactive-mode(var)/TeX-interactive-mode(fun)
C-c C-u C-a texinfo-all-menus-update
C-c C-u C-d texinfo-start-menu-description
C-c C-u C-e texinfo-every-node-update
C-c C-u C-n texinfo-update-node
C-c C-u RET texinfo-make-menu
C-c C-u m texinfo-master-menu
C-c C-v TeX-view
C-c C-w TeX-toggle-debug-bad-boxes
C-c RET TeX-insert-macro
C-c TAB TeX-goto-info-page
C-c ] texinfo-insert-@end
C-c ^ TeX-home-buffer
C-c _ TeX-master-file-ask
C-c ` TeX-next-error
C-c { TeX-insert-braces(var)/TeX-insert-braces(fun)
C-c } up-list
C-x ` TeX-next-error
C-x n g TeX-narrow-to-group
M-g p TeX-previous-error
RET TeX-newline
\ TeX-insert-backslash
\ self-insert-command
^ TeX-insert-sub-or-superscript
^ self-insert-command
_ TeX-insert-sub-or-superscript
_ self-insert-command

Key Bindings

Source Code

;; Defined in ~/.emacs.d/elpa/auctex-14.1.2/tex-info.el
;;;###autoload
(define-derived-mode Texinfo-mode text-mode "Texinfo"
  "Major mode in AUCTeX for editing Texinfo files.

Entering Texinfo mode calls the value of `text-mode-hook' and then the
value of `Texinfo-mode-hook'."
  :syntax-table texinfo-mode-syntax-table
  :after-hook (Texinfo-mode-cleanup)

  (setq TeX-mode-p t)
  (setq TeX-output-extension (if TeX-PDF-mode "pdf" "dvi"))
  (setq TeX-sentinel-default-function #'TeX-TeX-sentinel)
  ;; Mostly stolen from texinfo.el
  (setq TeX-base-mode-name mode-name)

  ;; Moved after `run-mode-hooks'. (bug#65750)
  ;; (set (make-local-variable 'page-delimiter)
  ;;      (concat
  ;;       "^@node [ \t]*[Tt]op\\|^@\\("
  ;;       texinfo-chapter-level-regexp
  ;;       "\\)"))
  (setq-local require-final-newline mode-require-final-newline)
  (setq-local indent-tabs-mode nil)
  (setq-local paragraph-separate
              (concat "@[a-zA-Z]*[ \n]\\|" paragraph-separate))
  (setq-local paragraph-start
              (concat "@[a-zA-Z]*[ \n]\\|" paragraph-start))
  (setq-local fill-column 72)
  (setq-local comment-start "@c ")
  (setq-local comment-start-skip "@c +\\|@comment +")
  (setq-local comment-use-syntax nil)
  (setq TeX-comment-start-regexp "@c\\(?:omment\\)?\\>")
  (setq-local words-include-escapes t)
  (setq-local imenu-generic-expression texinfo-imenu-generic-expression)
  (setq imenu-case-fold-search nil)

  (setq-local font-lock-defaults
              '(texinfo-font-lock-keywords nil nil nil backward-paragraph))
  (setq-local syntax-propertize-function
              texinfo-syntax-propertize-function)

  (setq-local outline-heading-alist
              (mapcar (lambda (x) (cons (concat "@" (car x)) (cadr x)))
                      texinfo-section-list))
  (setq-local outline-regexp
              (concat (regexp-opt (mapcar #'car outline-heading-alist) t)
                      "\\>"))

  ;; Mostly AUCTeX stuff
  (setq-local TeX-command-current #'TeX-command-master)

  (setq TeX-default-extension "texi")
  (setq-local TeX-esc "@")

  (setq-local TeX-auto-regexp-list 'TeX-auto-empty-regexp-list)

  (setq TeX-command-default "TeX")
  (setq TeX-header-end (regexp-quote "%**end of header"))
  (setq TeX-trailer-start (format "^%s$"
                                  (regexp-quote (concat TeX-esc "bye"))))

  ;; Moved after `run-mode-hooks'. (bug#65750)
  ;; (set (make-local-variable 'TeX-complete-list)
  ;;      (list (list "@\\([a-zA-Z]*\\)" 1 #'TeX-symbol-list-filtered nil)
  ;;            (list "" TeX-complete-word)))

  (setq-local TeX-font-list Texinfo-font-list)
  (setq-local TeX-font-replace-function #'TeX-font-replace-macro)
  (setq-local TeX-style-hook-dialect :texinfo)

  (add-hook 'find-file-hook (lambda ()
                              (unless (file-exists-p (TeX-buffer-file-name))
                                (TeX-master-file nil nil t)))
            nil t)

  (when (and (boundp 'add-log-current-defun-function)
             (fboundp 'texinfo-current-defun-name))
    (setq-local add-log-current-defun-function
                #'texinfo-current-defun-name))

  (TeX-add-symbols
   '("acronym" "Acronym")
   '("allowcodebreaks" (TeX-arg-literal " ") (Texinfo-arg-on|off nil :true|false) (Texinfo-arg-next-line))
   '("appendix" (TeX-arg-literal " ") (TeX-arg-free "Title"))
   '("appendixsec" (TeX-arg-literal " ") (TeX-arg-free "Title"))
   '("appendixsection" (TeX-arg-literal " ") (TeX-arg-free "Title"))
   '("appendixsubsec" (TeX-arg-literal " ") (TeX-arg-free "Title"))
   '("appendixsubsubsec" (TeX-arg-literal " ") (TeX-arg-free "Title"))
   '("asis")
   '("atchar" nil)
   '("author" (TeX-arg-literal " ") (TeX-arg-free "Author"))
   '("b" "Text")
   '("bullet")
   '("bye")
   '("c" (TeX-arg-literal " ") (TeX-arg-free "Comment"))
   '("caption" "Caption"
     ;; TODO: caption is meaningful only inside float env.  Maybe some checking
     ;; and warning would be good.
     )
   '("center" (TeX-arg-literal " ") (TeX-arg-free "Line of text"))
   '("chapheading" (TeX-arg-literal " ") (TeX-arg-free "Title"))
   '("chapter" (TeX-arg-literal " ") (TeX-arg-free "Title"))
   '("cindex" (TeX-arg-literal " ") (TeX-arg-free "Entry"))
   '("cite" "Reference")
   '("clear" (TeX-arg-literal " ") (TeX-arg-free "Flag"))
   '("code" "Sample code")
   '("codequotebacktick" (TeX-arg-literal " ") (Texinfo-arg-on|off) (Texinfo-arg-next-line))
   '("codequoteundirected"  (TeX-arg-literal " ") (Texinfo-arg-on|off) (Texinfo-arg-next-line))
   '("command" "Command")
   '("comment" (TeX-arg-literal " ") (TeX-arg-free "Comment"))
   '("contents")
   '("copyright" nil)
   '("defcodeindex" (TeX-arg-literal " ") (TeX-arg-free "Index name"))
   '("defindex" (TeX-arg-literal " ") (TeX-arg-free "Index name"))
   '("dfn" "Term")
   '("dmn" "Dimension")
   '("documentlanguage"  (TeX-arg-literal " ") (Texinfo-arg-choice "Language" ("ca" "cs" "de" "en" "es" "fr" "hu" "is" "it" "ja" "nb" "nl" "nn" "pl" "pt" "ru" "sr" "tr" "uk"))  (Texinfo-arg-next-line))
   '("documentencoding"  (TeX-arg-literal " ") (Texinfo-arg-choice "Encoding" ("US-ASCII" "UTF-8" "ISO-8859-1" "ISO-8859-15" "ISO-8859-2" "koi8-r" "koi8-u"))  (Texinfo-arg-next-line))
   '("dots" nil)
   '("emph" "Text")
   '("email" "Email address")
   '("equiv" nil)
   '("error")
   '("evenfooting" Texinfo-arg-lrc)
   '("evenheading" Texinfo-arg-lrc)
   '("everyfooting" Texinfo-arg-lrc)
   '("everyheading" Texinfo-arg-lrc)
   '("exdent" (TeX-arg-literal " ") (TeX-arg-free "Line of text"))
   '("expansion" nil)
   '("file" "Filename")
   '("finalout")
   '("findex" (TeX-arg-literal " ") (TeX-arg-free "Entry"))
   '("footnote" "Text of footnote")
   '("footnotestyle" (TeX-arg-literal " ") (TeX-arg-free "Style"))
   '("guillemetleft")
   '("guillemetright")
   '("guilsinglleft")
   '("guilsinglright")
   '("heading" (TeX-arg-literal " ") (TeX-arg-free "Title"))
   ;; XXX: Would be nice with completion.
   '("headings" (TeX-arg-literal " ") (TeX-arg-free "On off single double"))
   '("i" "Text")
   '("ignore")
   '("include" (TeX-arg-literal " ") (TeX-arg-free "Filename"))
   '("inforef" "Node name" "Info file name")
   '("item")
   '("itemx")
   '("kbd" "Keyboard characters")
   '("key" "Key name")
   '("kindex" (TeX-arg-literal " ") (TeX-arg-free "Entry"))
   '("LaTeX" nil)
   '("lowersections" 0)
   '("majorheading" (TeX-arg-literal " ") (TeX-arg-free "Title"))
   '("menu")
   '("minus")
   '("need" "N")
   '("node" (TeX-arg-literal " ") (TeX-arg-free "Name")
     (TeX-arg-literal ", ") (TeX-arg-free "Next")
     (TeX-arg-literal ", ") (TeX-arg-free "Previous")
     (TeX-arg-literal ", ") (TeX-arg-free "Up"))
   '("noindent")
   '("oddfooting" Texinfo-arg-lrc)
   '("oddheading" Texinfo-arg-lrc)
   '("page")
   '("paragraphindent" (TeX-arg-literal " ") (TeX-arg-free "Indent"))
   '("pindex" "Entry")
   '("point" nil)
   '("print")
   '("printindex" (TeX-arg-literal " ") (TeX-arg-free "Index name"))
   '("pxref" (Texinfo-arg-nodename "Node name"))
   '("quotedblbase")
   '("quotesinglbase")
   '("r" "Text")
   '("raisesections" 0)
   '("ref" (Texinfo-arg-nodename "Node name"))
   '("refill")
   '("result")
   '("samp" "Text")
   '("sc" "Text")
   '("section" (TeX-arg-literal " ") (TeX-arg-free "Title"))
   '("set" (TeX-arg-literal " ") (TeX-arg-free "Flag"))
   '("setchapternewpage" (TeX-arg-literal " ") (Texinfo-arg-choice "On off odd" ("on" "off" "odd")) (Texinfo-arg-next-line))
   '("setfilename" (TeX-arg-literal " ") (TeX-arg-free "Info file name"))
   '("settitle" (TeX-arg-literal " ") (TeX-arg-free "Title"))
   '("shortcontents")
   '("smallbook")
   '("sp" "N")
   '("strong" "Text")
   '("subheading" (TeX-arg-literal " ") (TeX-arg-free "Title"))
   '("subsection" (TeX-arg-literal " ") (TeX-arg-free "Title"))
   '("subsubheading" (TeX-arg-literal " ") (TeX-arg-free "Title"))
   '("subsubsection" (TeX-arg-literal " ") (TeX-arg-free "Title"))
   '("subtitle" (TeX-arg-literal " ") (TeX-arg-free "Title"))
   '("summarycontents")
   '("syncodeindex" (TeX-arg-literal " ") (TeX-arg-free "From index")
     (TeX-arg-literal " ") (TeX-arg-free "Into index"))
   '("synindex" (TeX-arg-literal " ") (TeX-arg-free "From index")
     (TeX-arg-literal " ") (TeX-arg-free "Into index"))
   '("t" "Text")
   '("TeX" nil)
   '("thischapter")
   '("thischaptername")
   '("thisfile")
   '("thispage")
   '("tie")
   '("tindex" (TeX-arg-literal " ") (TeX-arg-free "Entry"))
   '("title" (TeX-arg-literal " ") (TeX-arg-free "Title"))
   '("titlefont" "Text")
   '("titlepage")
   '("today" nil)
   '("top" (TeX-arg-literal " ") (TeX-arg-free "Title"))
   '("unnumbered" (TeX-arg-literal " ") (TeX-arg-free "Title"))
   '("unnumberedsec" (TeX-arg-literal " ") (TeX-arg-free "Title"))
   '("unnumberedsubsec" (TeX-arg-literal " ") (TeX-arg-free "Title"))
   '("unnumberedsubsubsec" (TeX-arg-literal " ") (TeX-arg-free "Title"))
   '("url" "Link")
   '("value" "Flag")
   '("var" "Metasyntactic variable")
   '("vindex" (TeX-arg-literal " ") (TeX-arg-free "Entry"))
   '("vskip" (TeX-arg-literal " ") (TeX-arg-free "Amount"))
   '("w" "Text")
   '("xref" (Texinfo-arg-nodename "Node name")))

  ;; RefTeX plugging
  (add-hook 'reftex-mode-hook #'Texinfo-reftex-hook nil t)
  (if (and (boundp 'reftex-mode) reftex-mode)
      (Texinfo-reftex-hook)))