Initial Commit
[packages] / xemacs-packages / x-symbol / lisp / x-symbol-bib.el
1 ;;; x-symbol-bib.el --- token language "BibTeX macro" for package x-symbol
2
3 ;; Copyright (C) 2002-2003 Free Software Foundation, Inc.
4 ;;
5 ;; Author: Christoph Wedler <wedler@users.sourceforge.net>
6 ;; Maintainer: (Please use `M-x x-symbol-package-bug' to contact the maintainer)
7 ;; Version: 4.5
8 ;; Keywords: WYSIWYG, LaTeX, HTML, wp, math, internationalization
9 ;; X-URL: http://x-symbol.sourceforge.net/
10
11 ;; This program is free software; you can redistribute it and/or modify
12 ;; it under the terms of the GNU General Public License as published by
13 ;; the Free Software Foundation; either version 2, or (at your option)
14 ;; any later version.
15 ;;
16 ;; This program is distributed in the hope that it will be useful,
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19 ;; GNU General Public License for more details.
20 ;;
21 ;; You should have received a copy of the GNU General Public License
22 ;; along with this program; if not, write to the Free Software
23 ;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24
25 ;;; Commentary:
26
27 ;; If you want to use package x-symbol, please visit the URL (use
28 ;; \\[x-symbol-package-web]) and read the info (use \\[x-symbol-package-info]).
29
30 ;; 
31
32 ;;; Code:
33
34 (provide 'x-symbol-bib)
35 (require 'x-symbol-tex)
36
37
38 ;;;===========================================================================
39 ;;;  General language accesses, see `x-symbol-language-access-alist'
40 ;;;===========================================================================
41
42 (defcustom x-symbol-bib-auto-style '(t nil nil nil nil nil)
43   "Values for X-Symbol's buffer-local variables with language `bib'.
44 See language access `x-symbol-LANG-auto-style'."
45   :group 'x-symbol-bib
46   :group 'x-symbol-mode
47   :type 'x-symbol-auto-style)
48
49 (defcustom x-symbol-bib-modeline-name "bib"
50   "Modeline name of token language `bib'.
51 See language access `x-symbol-LANG-modeline-name'."
52   :group 'x-symbol-bib
53   :type 'string)
54
55 (defcustom x-symbol-bib-header-groups-alist x-symbol-tex-header-groups-alist
56   "Header/submenu specification of the specific menu for language `bib'.
57 See language access `x-symbol-LANG-header-groups-alist'."
58   :group 'x-symbol-bib
59   :group 'x-symbol-input-init
60   :type 'x-symbol-headers)
61
62 (defcustom x-symbol-bib-electric-ignore x-symbol-tex-electric-ignore
63   "Specification restricting input method ELECTRIC with language `bib'.
64 See language access `x-symbol-LANG-electric-ignore'."
65   :group 'x-symbol-bib
66   :group 'x-symbol-input-control
67   :type 'x-symbol-function-or-regexp)
68
69 (defcustom x-symbol-bib-class-alist x-symbol-tex-class-alist
70   "Token classes displayed by info in echo area, for language `bib'.
71 See language access `x-symbol-LANG-class-alist'."
72   :group 'x-symbol-bib
73   :group 'x-symbol-info-strings
74   :type 'x-symbol-class-info)
75
76 (defcustom x-symbol-bib-class-face-alist x-symbol-tex-class-face-alist
77   "Color scheme in language specific grid and info, for language `bib'.
78 See language access `x-symbol-LANG-class-face-alist'."
79   :group 'x-symbol-bib
80   :group 'x-symbol-input-init
81   :group 'x-symbol-info-general
82   :type 'x-symbol-class-faces)
83
84
85 ;;;===========================================================================
86 ;;;  foo
87 ;;;===========================================================================
88
89 (defvar x-symbol-bib-token-grammar
90   '(x-symbol-make-grammar
91     :encode-spec (?\\ (math . "[a-z@-Z]"))
92     :decode-regexp "\\\\\\(?:[@A-Za-z]+\\|[-{}#_&]\\)\\|{\\\\\\(?:[ckvuHr]\\(?: [A-Za-z]\\|{}\\|\\\\ \\)\\|[@A-Za-z]+\\|[.~^\"'`=]\\(?:[A-Za-z]\\|{}\\|\\\\[ij]\\)\\)}"
93     :decode-spec (?\\)
94     :input-spec (?\\ (math . "[a-z@-Z]"))
95     :token-list x-symbol-bib-default-token-list)
96   "Grammar of token language `bib'.
97 See language access `x-symbol-LANG-token-grammar'.")
98
99 (defvar x-symbol-bib-required-fonts x-symbol-tex-required-fonts
100   "Features providing required fonts for language `bib'.
101 See language access `x-symbol-LANG-required-fonts'.")
102
103 (defvar x-symbol-bib-user-table nil
104   "User table defining TeX macros, used in `x-symbol-bib-table'.")
105
106 (defvar x-symbol-bib-table
107   (append x-symbol-bib-user-table x-symbol-tex-table)
108   "Table defining `bib' tokens for the characters.
109 See language access `x-symbol-LANG-table'.  Default value uses all
110 definitions in `x-symbol-tex-table'.  Use `x-symbol-bib-user-table' to
111 define private TeX macros or shadow existing ones.  ")
112
113 (defvar x-symbol-bib-generated-data nil
114   "Generated data for token language `bib'.
115 See language access `x-symbol-LANG-generated-data'.")
116
117 (defun x-symbol-bib-default-token-list (tokens)
118   (if (stringp tokens)
119       (list (list (concat "{" tokens "}")))
120     (mapcar (lambda (x)
121               (cons x (if (string-match "\\\\[A-Za-z]+\\'" x) 'math)))
122             tokens)))
123
124 ;;; Local IspellPersDict: .ispell_xsymb
125 ;;; x-symbol-bib.el ends here