]> code.delx.au - gnu-emacs-elpa/blob - packages/auctex/tex-site.el
Get "make -k" to go through
[gnu-emacs-elpa] / packages / auctex / tex-site.el
1 ;;; tex-site.el - Site specific variables. Don't edit.
2
3 ;; Copyright (C) 2005 Free Software Foundation, Inc.
4 ;;
5 ;; completely rewritten.
6
7 ;; Author: David Kastrup <dak@gnu.org>
8 ;; Maintainer: auctex-devel@gnu.org
9 ;; Keywords: tex
10
11 ;; This file is part of AUCTeX.
12
13 ;; AUCTeX is free software; you can redistribute it and/or modify it
14 ;; under the terms of the GNU General Public License as published by
15 ;; the Free Software Foundation; either version 3, or (at your option)
16 ;; any later version.
17
18 ;; AUCTeX is distributed in the hope that it will be useful, but
19 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 ;; General Public License for more details.
22
23 ;; You should have received a copy of the GNU General Public License
24 ;; along with AUCTeX; see the file COPYING. If not, write to the Free
25 ;; Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
26 ;; 02110-1301, USA.
27
28 ;;; Commentary:
29
30 ;; This file contains startup code, autoloads and variables adapted to
31 ;; the local site configuration. It is generated and placed by the
32 ;; installation procedure and should not be edited by hand, nor moved
33 ;; to a different place, as some settings may be established relative
34 ;; to the file.
35
36 ;; All user customization should be done with
37 ;; M-x customize-variable RET
38
39 ;;; Code:
40
41 (if (< emacs-major-version 21)
42 (error "AUCTeX requires Emacs 21 or later"))
43
44 ;; Define here in order for `M-x customize-group <RET> AUCTeX <RET>'
45 ;; to work if the main AUCTeX files are not loaded yet.
46 (defgroup AUCTeX nil
47 "A (La)TeX environment."
48 :tag "AUCTeX"
49 :link '(custom-manual "(auctex)Top")
50 :link '(url-link :tag "Home Page" "http://www.gnu.org/software/auctex/")
51 :prefix "TeX-"
52 :group 'tex
53 :load "tex" :load "latex" :load "tex-style")
54
55 (defvar TeX-lisp-directory (file-name-directory load-file-name)
56 "The directory where most of the AUCTeX lisp files are located.
57 For the location of lisp files associated with
58 styles, see the variables TeX-style-* (hand-generated lisp) and
59 TeX-auto-* (automatically generated lisp).")
60
61 (add-to-list 'load-path TeX-lisp-directory)
62
63 (defvar TeX-data-directory (file-name-directory load-file-name)
64 "The directory where the AUCTeX non-Lisp data is located.")
65
66 (defcustom TeX-auto-global "/usr/local/var/auctex"
67 "Directory containing automatically generated information.
68 Must end with a directory separator.
69
70 For storing automatic extracted information about the TeX macros
71 shared by all users of a site."
72 :group 'TeX-file
73 :type 'directory)
74
75 (defconst TeX-mode-alist
76 '((tex-mode . tex-mode)
77 (plain-tex-mode . tex-mode)
78 (texinfo-mode . texinfo)
79 (latex-mode . tex-mode)
80 (doctex-mode . tex-mode))
81 "Alist of built-in TeX modes and their load files.")
82
83 (defalias 'TeX-load-hack 'ignore)
84
85 (add-hook 'tex-site-unload-hook
86 (lambda ()
87 (let ((list after-load-alist))
88 (while list
89 ;; Adapted copy of the definition of `assq-delete-all'
90 ;; from Emacs 21 as substitute for
91 ;; `(assq-delete-all'TeX-modes-set (car list))' which
92 ;; fails on non-list elements in Emacs 21.
93 (let* ((alist (car list))
94 (tail alist)
95 (key 'TeX-modes-set))
96 (while tail
97 (if (and (consp (car tail))
98 (eq (car (car tail)) key))
99 (setq alist (delq (car tail) alist)))
100 (setq tail (cdr tail))))
101 (setq list (cdr list))))
102 (setq load-path (delq TeX-lisp-directory load-path))))
103
104 (defun TeX-modes-set (var value &optional update)
105 "Set VAR (which should be `TeX-modes') to VALUE.
106
107 This places either the standard or the AUCTeX versions of
108 functions into the respective function cell of the mode.
109 If UPDATE is set, a previously saved value for
110 the non-AUCTeX function gets overwritten with the current
111 definition."
112 (custom-set-default var value)
113 (let ((list TeX-mode-alist) elt)
114 (while list
115 (setq elt (car (pop list)))
116 (when (or update (null (get elt 'tex-saved)))
117 (when (fboundp elt)
118 (put elt 'tex-saved (symbol-function elt))))
119 (defalias elt
120 (if (memq elt value)
121 (intern (concat "TeX-" (symbol-name elt)))
122 (get elt 'tex-saved))))))
123
124 (defcustom TeX-modes
125 (mapcar 'car TeX-mode-alist)
126 "List of modes provided by AUCTeX.
127
128 This variable can't be set normally; use customize for that, or
129 set it with `TeX-modes-set'."
130 :type (cons 'set
131 (mapcar (lambda(x) (list 'const (car x))) TeX-mode-alist))
132 :set 'TeX-modes-set
133 :group 'AUCTeX
134 :initialize (lambda (var value)
135 (custom-initialize-reset var value)
136 (let ((list TeX-mode-alist))
137 (while list
138 (eval-after-load (cdar list)
139 `(TeX-modes-set ',var ,var t))
140 (setq list (cdr list))))))
141
142 (defconst AUCTeX-version "11.86"
143 "AUCTeX version.
144 If not a regular release, the date of the last change.")
145
146 (defconst AUCTeX-date "2010-02-21"
147 "AUCTeX release date using the ISO 8601 format, yyyy-mm-dd.")
148
149 ;; Store bibitems when saving a BibTeX buffer
150 (add-hook 'bibtex-mode-hook 'BibTeX-auto-store)
151
152 \f
153 ;;; Code specific to ELPA packaging:
154
155 ;; From preview-latex.el:
156
157 (defvar preview-TeX-style-dir
158 (expand-file-name "latex" (file-name-directory load-file-name)))
159
160 ;;; Ensure that loading the autoloads file also loads this file.
161 ;;;###autoload (require 'tex-site)
162
163 (provide 'tex-site)
164 ;;; tex-site.el ends here