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