aboutsummaryrefslogtreecommitdiffhomepage
path: root/contrib
diff options
context:
space:
mode:
authorGravatar David Aspinall <da@inf.ed.ac.uk>2010-08-27 11:24:51 +0000
committerGravatar David Aspinall <da@inf.ed.ac.uk>2010-08-27 11:24:51 +0000
commit78c8235a75eb1d4c75abfa62785cac79d989075f (patch)
treed1445198b94317e2c645872b75600d5025aadf8c /contrib
parent364817969e4744ae372a802b75c5c4c22680527b (diff)
Renamed file contrib/mmm/mmm-rpm.el, formerly mmm/mmm-rpm.el
Diffstat (limited to 'contrib')
-rw-r--r--contrib/mmm/mmm-rpm.el81
1 files changed, 81 insertions, 0 deletions
diff --git a/contrib/mmm/mmm-rpm.el b/contrib/mmm/mmm-rpm.el
new file mode 100644
index 00000000..0661e1ad
--- /dev/null
+++ b/contrib/mmm/mmm-rpm.el
@@ -0,0 +1,81 @@
+;;; mmm-rpm.el --- MMM submode class for RPM spec files
+
+;; Copyright (C) 2000 by Marcus Harnisch <Marcus.Harnisch@gmx.net>
+
+;; Author: Marcus Harnisch <Marcus.Harnisch@gmx.net>
+;; Version: $Id$
+
+;;{{{ GPL
+
+;; This file 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, or (at your option)
+;; any later version.
+
+;; This file 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 GNU Emacs; see the file COPYING. If not, write to
+;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
+;;}}}
+
+;;; Commentary:
+
+;; This file contains the definition of an MMM Mode submode class for
+;; editing shell script sections within RPM (Redhat Package Manager)
+;; spec files. I recommend to use it in combination with
+;; rpm-spec-mode.el by Stig Bjørlykke <stigb@tihlde.hist.no> and Steve
+;; Sanbeg <sanbeg@dset.com> (http://www.xemacs.org/~stigb/rpm-spec-mode.el)
+
+;;; Installation:
+
+;; 1. Copy this file where Emacs can find it.
+;;
+;; 2. Add the following lines to one of your startup files (e.g. ~/.emacs):
+;;
+;; (add-to-list 'mmm-mode-ext-classes-alist
+;; '(rpm-spec-mode "\\.spec\\'" rpm-sh))
+
+;;; Code:
+
+(require 'mmm-auto)
+
+(defconst mmm-rpm-sh-start-tags
+ '("prep" "build" "install" "clean" "preun" "postun" "pre"
+ "post" "triggerin" "triggerun" "triggerpostun")
+ "List containing RPM tags that start a shell-script section in a spec file")
+
+(defvar mmm-rpm-sh-end-tags
+ (append '("files" "description" "package") mmm-rpm-sh-start-tags)
+ "List containing RPM tags that end a shell-script section in a spec file")
+
+(defvar mmm-rpm-sh-start-regexp
+ (concat "^%" (mmm-regexp-opt mmm-rpm-sh-start-tags t) "\\b.*$")
+ "Regexp matching RPM tags that start a shell-script section in a spec file")
+
+(defvar mmm-rpm-sh-end-regexp
+ (concat "\\'\\|^%" (mmm-regexp-opt mmm-rpm-sh-end-tags t) "\\b.*$")
+ "Regexp matching RPM tags that end a shell-script section in a spec file")
+
+(mmm-add-group
+ 'rpm
+ `((rpm-sh
+ :submode sh-mode
+ :face mmm-code-submode-face
+ ;; match tags that starts sh-script region
+ :front ,mmm-rpm-sh-start-regexp
+ ;; match end of buffer or next tag that ends sh-script region
+ :back ,mmm-rpm-sh-end-regexp
+ :front-offset 1
+ :back-offset 0
+ :save-matches 0
+ )))
+
+(provide 'mmm-rpm)
+
+;;; mmm-rpm.el ends here \ No newline at end of file