1 ;;; mmm-cweb.el --- MMM submode class for CWeb programs
3 ;; Copyright (C) 2001 by Alan Shutko
5 ;; Author: Alan Shutko <ats@acm.org>
6 ;; Version: $Id: mmm-cweb.el,v 1.3 2002/11/12 02:44:06 alanshutko Exp $
10 ;; This file is free software; you can redistribute it and/or modify
11 ;; it under the terms of the GNU General Public License as published by
12 ;; the Free Software Foundation; either version 2, or (at your option)
15 ;; This file 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.
20 ;; You should have received a copy of the GNU General Public License
21 ;; along with GNU Emacs; see the file COPYING. If not, write to
22 ;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23 ;; Boston, MA 02111-1307, USA.
29 ;; This file contains the definition of an MMM Mode submode class for
30 ;; editing CWeb programs.
38 (defvar mmm-cweb-section-tags
41 (defvar mmm-cweb-section-regexp
42 (concat "^" (mmm-regexp-opt mmm-cweb-section-tags t)))
44 (defvar mmm-cweb-c-part-tags
45 '("@c" "@>=" "@>+=" "@p"))
47 (defvar mmm-cweb-c-part-regexp
48 (concat (mmm-regexp-opt mmm-cweb-c-part-tags t)))
50 (defun mmm-cweb-in-limbo (pos)
51 "Check to see if POS is in limbo, ie before any cweb sections."
55 (not (re-search-backward mmm-cweb-section-regexp nil t)))))
57 (defun mmm-cweb-verify-brief-c ()
58 "Verify function for cweb-brief-c class.
59 Checks whether the match is in limbo."
60 (not (mmm-cweb-in-limbo (match-beginning 0))))
67 :front ,mmm-cweb-c-part-regexp
68 :back ,mmm-cweb-section-regexp)
73 :face mmm-comment-submode-face
74 :insert ((?l cweb-label nil @ "@<" @ "@>")))
77 :front "[^\\|]\\(|\\)[^|]"
79 :front-verify mmm-cweb-verify-brief-c
85 :insert ((?| cweb-c-in-tex nil "|" @ "|")))
90 :face mmm-comment-submode-face)
93 ;; (add-to-list 'mmm-mode-ext-classes-alist
94 ;; '(plain-tex-mode "\\.w\\'" cweb))
95 ;; (add-to-list 'mmm-mode-ext-classes-alist
96 ;; '(latex-mode "\\.w\\'" cweb))
97 ;; (add-to-list 'auto-mode-alist '("\\.w\\'" . tex-mode))
101 ;;; mmm-cweb.el ends here