ambevar-dotfiles/.emacs.d/mode-texinfo.el

55 lines
1.7 KiB
EmacsLisp
Raw Normal View History

2013-06-12 23:40:20 +02:00
;;==============================================================================
;; Texinfo using TeX setup
2013-06-12 23:40:20 +02:00
;;==============================================================================
(require 'mode-tex)
2013-06-12 23:40:20 +02:00
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; VARIABLE
(defvar tex-default-compiler "texi2pdf -b"
"Default compiler for LaTeX mode. Used if `tex-compiler' is
empty.")
2013-06-12 23:40:20 +02:00
(defvar tex-extension-list '("aux" "cp" "cps" "fn" "ky" "log" "pg" "toc" "tp" "vr" "vrs")
"List of known Texinfo exentsions. This list is used by
'texinfo-clean to purge all matching files.")
(defcustom tex-compiler-options ""
"The options to the tex compiler. Options are set between the
compiler name and the file name.
Interesting options:
2013-06-12 23:40:20 +02:00
* --shell-escape: allow the use of \write18{<external command>}
from within TeX documents. This is a potential security issue.
2013-06-12 23:40:20 +02:00
You may use file local variable for convenience:
2013-06-12 23:40:20 +02:00
% -*- tex-compiler-options: \"--shell-escape\"
2013-06-12 23:40:20 +02:00
Note that --shell-escape can also be toggled with universal
argument."
:safe 'stringp)
2013-06-12 23:40:20 +02:00
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; FUNCTIONS
2013-06-12 23:40:20 +02:00
(defun texinfo-menu-update ()
2013-06-12 23:40:20 +02:00
"Update texinfo node menu automatically."
(interactive)
(hack-local-variables)
2013-06-12 23:40:20 +02:00
(let
;; Master file.
((local-master (if (not masterfile) buffer-file-name masterfile)))
2013-06-12 23:40:20 +02:00
(texinfo-multiple-files-update local-master t 8)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; HOOKS
2013-06-12 23:40:20 +02:00
(add-hook
'texinfo-mode-hook
(lambda ()
(setq fill-column 80) ;; Really needed?
(local-set-key (kbd "C-c C-b") 'texinfo-menu-update)))