1 ;;; mmm-univ.el --- The "Universal" Submode Class
3 ;; Copyright (C) 2000 by Free Software Foundation, Inc.
5 ;; Author: Michael Abraham Shulman <mas@kurukshetra.cjb.net>
9 ;; This file is free software; you can redistribute it and/or modify
10 ;; it under the terms of the GNU General Public License as published by
11 ;; the Free Software Foundation; either version 2, or (at your option)
14 ;; This file is distributed in the hope that it will be useful,
15 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ;; GNU General Public License for more details.
19 ;; You should have received a copy of the GNU General Public License
20 ;; along with GNU Emacs; see the file COPYING. If not, write to
21 ;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
22 ;; Boston, MA 02111-1307, USA.
28 ;; This file defines the "universal" submode class, the default value
29 ;; of `mmm-global-classes', which specifies a standard way to indicate
30 ;; that part of a buffer should be in a different mode--for example,
31 ;; in an email message.
38 (defun mmm-univ-get-mode (string)
39 (string-match "[a-zA-Z-]+" string)
40 (setq string (match-string 0 string))
41 (let ((modestr (intern (if (string-match "mode\\'" string)
43 (concat string "-mode")))))
44 (or (mmm-ensure-modename modestr)
45 (signal 'mmm-no-matching-submode nil))))
49 :front "{%\\([a-zA-Z-]+\\)%}"
51 :insert ((?/ universal "Submode: " @ "{%" str "%}" @ "\n" _ "\n"
53 :match-submode mmm-univ-get-mode
61 ;;; mmm-global-classes: nil
64 ;;; mmm-univ.el ends here