]> code.delx.au - gnu-emacs-elpa/blob - packages/auctex/style/paralist.el
Remove version numbers in packages/ directory
[gnu-emacs-elpa] / packages / auctex / style / paralist.el
1 ;;; paralist.el -- AUCTeX style for paralist.sty
2
3 ;; Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
4
5 ;; Author: Ralf Angeli <angeli@iwi.uni-sb.de>
6 ;; Maintainer: auctex-devel@gnu.org
7 ;; Created: 2003-10-22
8 ;; Keywords: tex
9
10 ;; This file is part of AUCTeX.
11
12 ;; AUCTeX is free software; you can redistribute it and/or modify it
13 ;; under the terms of the GNU General Public License as published by
14 ;; the Free Software Foundation; either version 3, or (at your option)
15 ;; any later version.
16
17 ;; AUCTeX is distributed in the hope that it will be useful, but
18 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 ;; General Public License for more details.
21
22 ;; You should have received a copy of the GNU General Public License
23 ;; along with AUCTeX; see the file COPYING. If not, write to the Free
24 ;; Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
25 ;; 02110-1301, USA.
26
27 ;;; Commentary:
28
29 ;; This file adds support for `paralist.sty'.
30
31 ;;; Code:
32
33 ;; Insert an itemize-ish environment and ask for an optional label
34 (defun LaTeX-paralist-env-item-opt-label (environment)
35 "Insert ENVIRONMENT, an optional label and the first item."
36 (LaTeX-insert-environment
37 environment
38 (let ((label (read-string "(Optional) Label: ")))
39 (concat (unless (zerop (length label))
40 (format "[%s]" label)))))
41 (LaTeX-find-matching-begin)
42 (end-of-line 1)
43 (delete-char 1)
44 (delete-horizontal-space)
45 (LaTeX-insert-item))
46
47 (TeX-add-style-hook
48 "paralist"
49 (lambda ()
50
51 ;; Add compactdesc to the list of environments which have an optional
52 ;; argument for each item.
53 (add-to-list 'LaTeX-item-list '("compactdesc" . LaTeX-item-argument))
54
55 ;; New symbols
56 (TeX-add-symbols
57 '("pointedenum")
58 '("pointlessenum")
59 '("paradescriptionlabel")
60 '("setdefaultitem" "First level" "Second level" "Third level"
61 "Fourth level")
62 '("setdefaultenum" "First level" "Second level" "Third level"
63 "Fourth level")
64 '("setdefaultleftmargin" "First level" "Second level" "Third level"
65 "Fourth level" "Fifth level" "Sixth level"))
66
67 ;; New environments
68 (LaTeX-add-environments
69 '("asparaenum" LaTeX-paralist-env-item-opt-label)
70 '("inparaenum" LaTeX-paralist-env-item-opt-label)
71 '("compactenum" LaTeX-paralist-env-item-opt-label)
72 '("asparaitem" LaTeX-paralist-env-item-opt-label)
73 '("inparaitem" LaTeX-paralist-env-item-opt-label)
74 '("compactitem" LaTeX-paralist-env-item-opt-label)
75 '("compactdesc" LaTeX-env-item)
76 ;; FIXME: Should not be available if package is loaded with option
77 ;; `olditem':
78 '("itemize" LaTeX-paralist-env-item-opt-label)
79 ;; FIXME: Should not be available if package is loaded with option
80 ;; `oldenum':
81 '("enumerate" LaTeX-paralist-env-item-opt-label)
82 ;; FIXME: Only defined if package is loaded with option
83 ;; `defblank':
84 '("asparablank" LaTeX-env-item)
85 '("inparablank" LaTeX-env-item))
86
87 ;; Fontification
88 (when (and (featurep 'font-latex)
89 (eq TeX-install-font-lock 'font-latex-setup))
90 (font-latex-add-keywords '(("setdefaultitem" "{{{{")
91 ("setdefaultenum" "{{{{")
92 ("setdefaultleftmargin" "{{{{{{"))
93 'variable))))
94
95 (defvar LaTeX-paralist-package-options '("newitem" "olditem" "newenum"
96 "oldenum" "alwaysadjust"
97 "neveradjust" "neverdecrease"
98 "increaseonly" "defblank"
99 "pointedenum" "pointlessenum"
100 "cfg" "nocfg" "flushright"
101 "flushleft")
102 "Package options for the paralist package.")
103
104 ;;; paralist.el ends here