~ubuntu-branches/ubuntu/natty/auctex/natty

« back to all changes in this revision

Viewing changes to style/dk-bib.el

  • Committer: Bazaar Package Importer
  • Author(s): Davide G. M. Salvetti
  • Date: 2007-03-14 00:43:56 UTC
  • mfrom: (2.1.8 feisty)
  • Revision ID: james.westby@ubuntu.com-20070314004356-xtqoxu6ousd1ldn6
Tags: 11.83-6
* Rebuild with clean source.
* rules.in (build-package): Added dependency on the "clean" target.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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 2, 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-input "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