1 ;;; mmm-rpm.el --- MMM submode class for RPM spec files
3 ;; Copyright (C) 2000 by Marcus Harnisch <Marcus.Harnisch@gmx.net>
5 ;; Author: Marcus Harnisch <Marcus.Harnisch@gmx.net>
6 ;; Version: $Id: mmm-rpm.el,v 1.3 2001/01/11 00:56:30 mas 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 shell script sections within RPM (Redhat Package Manager)
31 ;; spec files. I recommend to use it in combination with
32 ;; rpm-spec-mode.el by Stig Bjørlykke <stigb@tihlde.hist.no> and Steve
33 ;; Sanbeg <sanbeg@dset.com> (http://www.xemacs.org/~stigb/rpm-spec-mode.el)
37 ;; 1. Copy this file where Emacs can find it.
39 ;; 2. Add the following lines to one of your startup files (e.g. ~/.emacs):
41 ;; (add-to-list 'mmm-mode-ext-classes-alist
42 ;; '(rpm-spec-mode "\\.spec\\'" rpm-sh))
48 (defconst mmm-rpm-sh-start-tags
49 '("prep" "build" "install" "clean" "preun" "postun" "pre"
50 "post" "triggerin" "triggerun" "triggerpostun")
51 "List containing RPM tags that start a shell-script section in a spec file")
53 (defvar mmm-rpm-sh-end-tags
54 (append '("files" "description" "package") mmm-rpm-sh-start-tags)
55 "List containing RPM tags that end a shell-script section in a spec file")
57 (defvar mmm-rpm-sh-start-regexp
58 (concat "^%" (mmm-regexp-opt mmm-rpm-sh-start-tags t) "\\b.*$")
59 "Regexp matching RPM tags that start a shell-script section in a spec file")
61 (defvar mmm-rpm-sh-end-regexp
62 (concat "\\'\\|^%" (mmm-regexp-opt mmm-rpm-sh-end-tags t) "\\b.*$")
63 "Regexp matching RPM tags that end a shell-script section in a spec file")
69 :face mmm-code-submode-face
70 ;; match tags that starts sh-script region
71 :front ,mmm-rpm-sh-start-regexp
72 ;; match end of buffer or next tag that ends sh-script region
73 :back ,mmm-rpm-sh-end-regexp
81 ;;; mmm-rpm.el ends here