Initial Commit
[packages] / xemacs-packages / auctex / style / dk-bib.el
1 ;;; dk-bib.el --- AUCTeX style for `dk-bib.sty'
2
3 ;; Copyright (C) 2005 Free Software Foundation, Inc.
4
5 ;; Author: Arne Jørgensen <arne@arnested.dk>
6 ;; Keywords: tex
7
8 ;; This file is part of AUCTeX.
9
10 ;; AUCTeX is free software; you can redistribute it and/or modify it
11 ;; under the terms of the GNU General Public License as published by
12 ;; the Free Software Foundation; either version 3, or (at your option)
13 ;; any later version.
14
15 ;; AUCTeX is distributed in the hope that it will be useful, but
16 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18 ;; General Public License for more details.
19
20 ;; You should have received a copy of the GNU General Public License
21 ;; along with AUCTeX; see the file COPYING.  If not, write to the Free
22 ;; Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
23 ;; MA 02110-1301, USA.
24
25 ;;; Commentary:
26
27 ;; Prompt for package option for dk-bib.sty.
28
29 ;;; Code:
30
31 (defun LaTeX-dk-bib-package-options nil
32   "Prompt for package options for the dk-bib package."
33   (let ((options
34          (mapconcat 'identity
35                     (TeX-completing-read-multiple
36                      "Options: "
37                      '(("isbn") ("issn") ("url") ("annote")
38                        ("printing") ("apalike") ("fixcitedash=false")
39                        ("ordinals2word") ("ordinaldepth=")))
40                     ","))
41         (depth -1))
42     (when (string-match "\\(ordinaldepth=\\)\\([^0-9]\\|$\\)" options)
43       (while (or (< depth 0)
44                  (> depth 20))
45         (setq depth (if (fboundp 'read-number)
46                         (read-number "Ordinal depth: ")
47                       (string-to-number (read-string "Ordinal depth: "))))
48         (when (or (< depth 0)
49                   (> depth 20))
50           (message "Ordinal depth must be between 0 and 20")
51           (sit-for 1)))
52       (setq options (concat
53                      (substring options 0 (match-end 1))
54                      (number-to-string depth)
55                      (substring options (match-end 1)))))
56     options))
57
58 ;; Local Variables:
59 ;; coding: iso-8859-1
60 ;; End:
61
62 ;;; dk-bib.el ends here