Initial Commit
[packages] / xemacs-packages / auctex / style / url.el
1 ;;; url.el --- AUCTeX style for `url.sty'
2
3 ;; Copyright (C) 2004, 2005 Free Software Foundation, Inc.
4
5 ;; Author: Ralf Angeli <angeli@iwi.uni-sb.de>
6 ;; Maintainer: auctex-devel@gnu.org
7 ;; Created: 2004-10-13
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 `url.sty'.
30
31 ;;; Code:
32
33 (TeX-add-style-hook
34  "url"
35  (lambda ()
36    ;; New symbols
37    (TeX-add-symbols
38     "Url"
39     "UrlBigBreakPenalty"
40     "UrlBigBreaks"
41     "UrlBreakPenalty"
42     "UrlBreaks"
43     "UrlFont"
44     "UrlLeft"
45     "UrlNoBreaks"
46     "UrlOrds"
47     "UrlRight"
48     "UrlSpecials"
49     "path"
50     "url"
51     "urldef"
52     '("urlstyle" TeX-arg-urlstyle))
53
54    (add-to-list 'LaTeX-verbatim-macros-with-delims-local "path")
55    (add-to-list 'LaTeX-verbatim-macros-with-delims-local "url")
56    (add-to-list 'LaTeX-verbatim-macros-with-braces-local "path")
57    (add-to-list 'LaTeX-verbatim-macros-with-braces-local "url")
58
59    ;; Fontification
60    (when (and (featurep 'font-latex)
61               (eq TeX-install-font-lock 'font-latex-setup))
62      (font-latex-add-keywords '(("path" "{") ("url" "{")) 'reference)
63      (font-latex-add-keywords '(("Url" "")
64                                 ("UrlBigBreakPenalty" "")
65                                 ("UrlBigBreaks" "")
66                                 ("UrlBreakPenalty" "")
67                                 ("UrlBreaks" "")
68                                 ("UrlFont" "")
69                                 ("UrlLeft" "")
70                                 ("UrlNoBreaks" "")
71                                 ("UrlOrds" "")
72                                 ("UrlRight" "")
73                                 ("UrlSpecials" "")
74                                 ("urldef" "")
75                                 ("urlstyle" "{"))
76                               'variable)
77      ;; For syntactic fontification, e.g. verbatim constructs.
78      (font-latex-set-syntactic-keywords)
79      ;; Tell font-lock about the update.
80      (setq font-lock-set-defaults nil)
81      (font-lock-set-defaults)))
82  LaTeX-dialect)
83
84 (defun TeX-arg-urlstyle (optional &optional prompt)
85   "Prompt for style used in \\urlstyle with completion."
86   (TeX-argument-insert
87    (completing-read (TeX-argument-prompt optional prompt "Style")
88                     (mapcar 'list '("rm" "same" "sf" "tt"))
89                     nil t)
90    optional))
91
92 (defvar LaTeX-url-package-options '("hyphens" "obeyspaces" "spaces" "LY1"
93                                     "T1" "allowmove")
94   "Package options for the url package.")
95
96 ;;; url.el ends here