;;;; oml-mode-abbrev.el --- Abbrev table definitions for oml-mode ;; oml-mode is a copy of xslide modified by Martin Klang to do o:XML ;; Copyright (C) 1998, 1999 Tony Graham ;; Author: Tony Graham ;;; This file is not part of GNU Emacs. ;; This program is free software; you can redistribute it and/or ;; modify it under the terms of the GNU General Public License ;; as published by the Free Software Foundation; either version 2 ;; of the License, or (at your option) any later version. ;; ;; This program is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; ;; You should have received a copy of the GNU General Public License ;; along with this program; if not, write to the Free Software ;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ;;;; Commentary: ;; ;;;; Variables: (defvar oml-mode-abbrev-table nil "Abbrev table used while in o:XML mode.") ;;; define oml-mode-abbrev-table if not already defined (if oml-mode-abbrev-table () ;; remember current state of abbrevs-changed so we can restore it after ;; defining some abbrevs (let ((ac abbrevs-changed)) (define-abbrev-table 'oml-mode-abbrev-table ()) ;; Generate abbrevs for o:XML and Formatting Object elements from ;; data in oml-all-elements-alist (mapcar (lambda (x) (define-abbrev oml-mode-abbrev-table (nth 3 x) (car x) nil)) oml-all-elements-alist) ;; Generate abbrevs for attributes for o:XML and Formatting Object ;; elements (mapcar (lambda (x) (define-abbrev oml-mode-abbrev-table (nth 1 x) (concat (car x) "=\"\"") 'backward-char)) (append oml-attributes-alist oml-fo-attribute-symbol-alist)) ;; Define abbrevs for selectors (define-abbrev oml-mode-abbrev-table "an" "ancestor()" 'backward-char) (define-abbrev oml-mode-abbrev-table "i" "id()" 'backward-char) (define-abbrev oml-mode-abbrev-table "a" "attribute()" 'backward-char) (define-abbrev oml-mode-abbrev-table "c" "constant()" 'backward-char) (define-abbrev oml-mode-abbrev-table "ar" "arg()" 'backward-char) (define-abbrev oml-mode-abbrev-table "fot" "first-of-type()" nil) (define-abbrev oml-mode-abbrev-table "nfot" "not-first-of-type()" nil) (define-abbrev oml-mode-abbrev-table "lot" "last-of-type()" nil) (define-abbrev oml-mode-abbrev-table "nlot" "not-last-of-type()" nil) (define-abbrev oml-mode-abbrev-table "foa" "first-of-any()" nil) (define-abbrev oml-mode-abbrev-table "nfoa" "not-first-of-any()" nil) (define-abbrev oml-mode-abbrev-table "loa" "last-of-any()" nil) (define-abbrev oml-mode-abbrev-table "nloa" "not-last-of-any()" nil) (define-abbrev oml-mode-abbrev-table "oot" "only-of-type()" nil) (define-abbrev oml-mode-abbrev-table "noot" "not-only-of-type()" nil) (define-abbrev oml-mode-abbrev-table "ooa" "only-of-any()" nil) (define-abbrev oml-mode-abbrev-table "nooa" "not-only-of-any()" nil) ;; restore abbrevs-changed (setq abbrevs-changed ac))) (provide 'oml-mode-abbrev)