Import XE riece pkg Makefile/package-info.in
[packages] / xemacs-packages / docbookide / dbide-abbrev.el
1 ;;;; dbide-abbrev.el --- Abbrev table definitions for docbookide
2 ;; $Id: dbide-abbrev.el,v 1.2 2000/03/29 19:12:16 nwalsh Exp $
3
4 ;; Copyright (C) 2000 Norman Walsh
5 ;; Based extensively on (one might go so far as to say "totally hacked
6 ;; from") Tony Graham's xslide.
7
8 ;; Author: Norman Walsh <ndw@nwalsh.com>
9 ;; Created: 29 March 2000
10 ;; Version: $Revision: 1.2 $
11 ;; Keywords: languages, xml, docbook
12
13 ;;; This file is not part of GNU Emacs.
14
15 ;; This program is free software; you can redistribute it and/or
16 ;; modify it under the terms of the GNU General Public License
17 ;; as published by the Free Software Foundation; either version 2
18 ;; of the License, or (at your option) any later version.
19 ;; 
20 ;; This program is distributed in the hope that it will be useful,
21 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
22 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
23 ;; GNU General Public License for more details.
24 ;; 
25 ;; You should have received a copy of the GNU General Public License
26 ;; along with this program; if not, write to the Free Software
27 ;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
28
29 \f
30 ;;;; Commentary:
31
32 ;; 
33
34 ;; Send bugs to docbookide-bug@menteith.com
35 ;; Use `docbook-submit-bug-report' to submit a bug report
36
37 \f
38 ;;;; Variables:
39
40 (defvar docbook-mode-abbrev-table nil
41   "Abbrev table used while in DOCBOOK mode.")
42
43 ;;; define docbook-mode-abbrev-table if not already defined
44 (if docbook-mode-abbrev-table
45     ()
46   ;; remember current state of abbrevs-changed so we can restore it after
47   ;; defining some abbrevs
48   (let ((ac abbrevs-changed))
49     (define-abbrev-table 'docbook-mode-abbrev-table ())
50
51     ;; Generate abbrevs for DOCBOOK from
52     ;; data in docbook-all-elements-alist
53     (mapcar (lambda (x)
54               (define-abbrev docbook-mode-abbrev-table
55                 (nth 3 x) (car x) nil))
56             docbook-all-elements-alist)
57
58     ;; Generate abbrevs for attributes for DOCBOOK
59     (mapcar (lambda (x)
60               (define-abbrev docbook-mode-abbrev-table
61                 (nth 1 x)
62                 (concat (car x) "=\"\"")
63                 'backward-char))
64             (append
65              docbook-attributes-alist
66              '()))
67
68     ;; restore abbrevs-changed
69     (setq abbrevs-changed ac)))
70
71 (provide 'dbide-abbrev)