--- mmm-mode-0.4.8.orig/debian/mmm-mode.emacsen-remove +++ mmm-mode-0.4.8/debian/mmm-mode.emacsen-remove @@ -0,0 +1,12 @@ +#!/bin/sh -e + +FLAVOR="$1" + +echo "install/mmm-mode: Handling removal of emacsen flavor ${FLAVOR}" + +if [ "${FLAVOR}" != "emacs" ]; then + echo "install/mmm-mode: purging byte-compiled files for ${FLAVOR}" + rm -rf /usr/share/${FLAVOR}/site-lisp/mmm-mode +fi + +exit 0; --- mmm-mode-0.4.8.orig/debian/README.source +++ mmm-mode-0.4.8/debian/README.source @@ -0,0 +1,38 @@ +This package uses dpatch to manage all modifications to the upstream +source. Changes are stored in the source package as diffs in +debian/patches and applied during the build. + +To get the fully patched source after unpacking the source package, cd +to the root level of the source package and run: + + debian/rules patch + +Removing a patch is as simple as removing its entry from the +debian/patches/00list file, and please also remove the patch file +itself. + +Creating a new patch is done with "dpatch-edit-patch patch XX_patchname" +where you should replace XX with a new number and patchname with a +descriptive shortname of the patch. You can then simply edit all the +files your patch wants to edit, and then simply "exit 0" from the shell +to actually create the patch file. + +To tweak an already existing patch, call "dpatch-edit-patch XX_patchname" +and replace XX_patchname with the actual filename from debian/patches +you want to use. + +To clean up afterwards again, "debian/rules unpatch" will do the +work for you - or you can of course choose to call +"fakeroot debian/rules clean" all together. + + +--- + +this documentation is part of dpatch package, and may be used by +packages using dpatch to comply with policy on README.source. This +documentation is meant to be useful to users who are not proficient in +dpatch in doing work with dpatch-based packages. Please send any +improvements to the BTS of dpatch package. + +original text by Gerfried Fuchs, edited by Junichi Uekawa +10 Aug 2008. --- mmm-mode-0.4.8.orig/debian/changelog +++ mmm-mode-0.4.8/debian/changelog @@ -0,0 +1,93 @@ +mmm-mode (0.4.8-8) unstable; urgency=low + + * pulled recent fixes from upstream git + + -- Alexander Zangerl Fri, 14 Sep 2012 12:24:25 +1000 + +mmm-mode (0.4.8-7) unstable; urgency=low + + * fixed face defaults (closes: #672169) + * don't load regexp-opt unless needed (closes: #672168) + * lifted standards version, fixed most lintian complaints + * incorporated emacs23 fixes from https://github.com/purcell/mmm-mode/ + + -- Alexander Zangerl Thu, 10 May 2012 23:06:25 +1000 + +mmm-mode (0.4.8-6) unstable; urgency=low + + * updated watch file, lifted standards version, added dpatch to build depends + * removed compatibility code for emacs < 19.29, + finally silencing the warnings reported in #506565 and #487926 + + -- Alexander Zangerl Sun, 23 Nov 2008 12:11:59 +1000 + +mmm-mode (0.4.8-5) unstable; urgency=low + + * lifted standards version + * updated dependencies to support emacs22 (closes: #433691) + + -- Alexander Zangerl Tue, 4 Mar 2008 09:23:43 +1000 + +mmm-mode (0.4.8-4) unstable; urgency=low + + * updated watch file, lifted standards version + + -- Alexander Zangerl Tue, 10 Apr 2007 18:21:38 +1000 + +mmm-mode (0.4.8-3) unstable; urgency=low + + * The "But I'm Not Dead Yet!" Release + * New maintainer + + -- Alexander Zangerl Wed, 23 Nov 2005 21:24:00 +1000 + +mmm-mode (0.4.8-2) unstable; urgency=low + + * QA upload. + * Include emacs-snapshot in alternative dependencies. Closes: #323392. + * debian/copyright: + - Remove outdated (and no longer required) list of changes. + - Update FSF address. + * debian/rules: Use dh_install. + * debian/watch: Add. + + -- Matej Vela Thu, 15 Sep 2005 16:10:10 +0200 + +mmm-mode (0.4.8-1) unstable; urgency=low + + * QA upload. + * New upstream version. (Closes: #281659, #214681) + - Use virgin upstream tarball. (Closes: #96185) + * Remove the compatibility code for three-argument regexp-opt in XEmacs, + since XEmacs has now reverted back to two arguments. + * Provide a match-string-no-properties alias for XEmacs. + * Use installation and removal code similar to other mode packages. + - Install *.elc files into a subdirectory. (Closes: #119260) + - Use -no-site-file or --no-site-file. (Closes: #218087) + * Depend on emacs21 instead of emacs20. (Closes: #232775) + * Add a versioned dependency on xemacs21-basesupport to get a + two-argument regexp-opt. + * Update standards-version to 3.6.2 (no changes required). + * Update debhelper level to V4 and add versioned dependency. + + -- Russ Allbery Wed, 3 Aug 2005 00:08:23 -0700 + +mmm-mode (0.4.7-3) unstable; urgency=low + + * QA Group upload orphaning this package + * debian/copyright: mention location of license + + -- Andrew Pollock Tue, 9 Nov 2004 23:24:05 +1100 + +mmm-mode (0.4.7-2) unstable; urgency=low + + * Automatically require mmm-auto, but don't do anything else. (closes: bug#101475) + + -- Michael Alan Dorman Tue, 7 Aug 2001 16:46:02 -0400 + +mmm-mode (0.4.7-1) unstable; urgency=low + + * Initial debianization. + + -- Michael Alan Dorman Sun, 22 Apr 2001 09:56:23 -0400 + --- mmm-mode-0.4.8.orig/debian/mmm-mode.docs +++ mmm-mode-0.4.8/debian/mmm-mode.docs @@ -0,0 +1 @@ +debian/README.source --- mmm-mode-0.4.8.orig/debian/mmm-mode.emacsen-install +++ mmm-mode-0.4.8/debian/mmm-mode.emacsen-install @@ -0,0 +1,28 @@ +#!/bin/sh -e + +FILES="mmm-auto.el mmm-class.el mmm-cmds.el mmm-compat.el mmm-cweb.el mmm-mason.el mmm-mode.el mmm-noweb.el mmm-region.el mmm-rpm.el mmm-sample.el mmm-univ.el mmm-utils.el mmm-vars.el" + +FLAVOR="$1" + +echo "install/mmm-mode: Handling install of emacsen flavor ${FLAVOR}" + +if [ "${FLAVOR}" != "emacs" ]; then + echo "install/mmm-mode: byte-compiling for ${FLAVOR}" + cd /usr/share/emacs/site-lisp/mmm-mode + mkdir -p /usr/share/${FLAVOR}/site-lisp/mmm-mode + cp $FILES /usr/share/${FLAVOR}/site-lisp/mmm-mode + cd /usr/share/${FLAVOR}/site-lisp/mmm-mode + cat < path.el +(setq load-path (cons "." load-path) byte-compile-warnings nil) +EOF + FLAVORTEST=`echo $FLAVOR | cut -c-6` + if [ ${FLAVORTEST} = xemacs ] ; then + SITEFLAG="-no-site-file" + else + SITEFLAG="--no-site-file" + fi + ${FLAVOR} -q ${SITEFLAG} -batch -l path.el -f batch-byte-compile $FILES + rm path.el $FILES +fi + +exit 0; --- mmm-mode-0.4.8.orig/debian/control +++ mmm-mode-0.4.8/debian/control @@ -0,0 +1,17 @@ +Source: mmm-mode +Maintainer: Alexander Zangerl +Section: editors +Priority: optional +Build-Depends: debhelper (>= 8), dpatch +Standards-Version: 3.9.3 + +Package: mmm-mode +Section: editors +Priority: optional +Architecture: all +Depends: emacs23 | emacsen | emacs-snapshot | xemacs21-basesupport (>= 2003.11.13-1), dpkg (>= 1.15.4) | install-info, ${misc:Depends} +Description: Multiple Major Mode for Emacs + MMM Mode is a minor mode for Emacs that allows Multiple Major Modes + (hence the name) to coexist in one buffer. It is particularly + well-suited to editing embedded code, such as Mason server-side Perl, + or HTML output in CGI scripts. --- mmm-mode-0.4.8.orig/debian/copyright +++ mmm-mode-0.4.8/debian/copyright @@ -0,0 +1,46 @@ +This is a version of MMM Mode for Emacs by Michael Abraham Shulman + prepackaged for Debian GNU/Linux. + +MMM Mode is a minor mode for Emacs that allows Multiple Major Modes +(hence the name) to coexist in one buffer. It is particularly +well-suited to editing embedded code, such as Mason server-side Perl, +or HTML output in CGI scripts. + +The package was assembled by Michael Alan Dorman . +The latest version of MMM Mode should always be available from +http://mmm-mode.sourceforge.net/. + +The mmm-mode copyright is: + +;;; mmm-mode.el --- Allow Multiple Major Modes in a buffer + +;; Copyright (C) 1999 by Michael Abraham Shulman + +;; Emacs Lisp Archive Entry +;; Package: mmm-mode +;; Author: Michael Abraham Shulman +;; Keywords: convenience, faces, languages, tools +;; Version: 0.4.7 + +;; Revision: $Id: copyright,v 1.1 2001/04/22 16:21:49 mdorman Exp $ + +;;{{{ 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., 51 Franklin St, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +;;}}} + +On Debian systems, the full text of the GPL can be found in /usr/share/common-licenses/GPL --- mmm-mode-0.4.8.orig/debian/mmm-mode.emacsen-startup +++ mmm-mode-0.4.8/debian/mmm-mode.emacsen-startup @@ -0,0 +1,4 @@ +;; This is as far as you can go without perhaps incurring performance +;; issues. You probably want to add (setq mmm-global-mode 'maybe) in +;; your .emacs. 'info mmm-mode' for details +(require 'mmm-auto) --- mmm-mode-0.4.8.orig/debian/compat +++ mmm-mode-0.4.8/debian/compat @@ -0,0 +1 @@ +8 --- mmm-mode-0.4.8.orig/debian/watch +++ mmm-mode-0.4.8/debian/watch @@ -0,0 +1,2 @@ +version=3 +http://sf.net/mmm-mode/mmm-mode-(.+)\.tar\.gz --- mmm-mode-0.4.8.orig/debian/rules +++ mmm-mode-0.4.8/debian/rules @@ -0,0 +1,42 @@ +#!/usr/bin/make -f + +# to get the patch application targets +include /usr/share/dpatch/dpatch.make + +build-arch: build + +build-indep: build + +build: patch + +clean: unpatch + dh_testdir + dh_testroot + dh_clean + +install: build + dh_testdir + dh_testroot + dh_prep + dh_installdirs + dh_install *.el usr/share/emacs/site-lisp/mmm-mode + +binary-indep: build install + dh_testdir + dh_testroot + dh_installchangelogs ChangeLog + dh_installdocs AUTHORS FAQ NEWS README README.Mason TODO + dh_installemacsen + dh_installinfo mmm.info* + dh_link + dh_compress + dh_fixperms + dh_installdeb + dh_gencontrol + dh_md5sums + dh_builddeb + +binary-arch: build install + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install --- mmm-mode-0.4.8.orig/debian/mmm-mode.README.Debian +++ mmm-mode-0.4.8/debian/mmm-mode.README.Debian @@ -0,0 +1,18 @@ +* emacs 23 + + This package now includes extra fixes for emacs 23++ + by Steve Purcell (from https://github.com/purcell/mmm-mode/, as + the official upstream CVS seams dormant/dead). + +* autoload vs. always on + + We now autoload mmm-mode, but we don't actually turn it on because + that represents a performance hit that we don't want to unilaterally + impose on all emacs users. + + So, if you want to use mmm-mode, you'll need to: + + (setq mmm-global-mode 'maybe) + + + -- Alexander Zangerl , Fri, 11 May 2012 00:04:17 +1000 --- mmm-mode-0.4.8.orig/debian/patches/01compat.dpatch +++ mmm-mode-0.4.8/debian/patches/01compat.dpatch @@ -0,0 +1,92 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 01compat.dpatch by +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: removal of pre-19.28 backquote syntax, collection of other qa-fixes + +@DPATCH@ +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' mmm-mode-0.4.8~/mmm-compat.el mmm-mode-0.4.8/mmm-compat.el +--- mmm-mode-0.4.8~/mmm-compat.el 2012-05-10 23:52:45.000000000 +1000 ++++ mmm-mode-0.4.8/mmm-compat.el 2012-05-10 23:52:45.774573948 +1000 +@@ -64,10 +64,11 @@ + (fboundp 'custom-declare-variable)) + (defmacro defgroup (&rest args) + nil) ++ ;; az Sun Nov 23 12:31:31 2008 nuked old backquotes. 19.28 is dead. + (defmacro defface (var values doc &rest args) +- (` (make-face (quote (, var))))) ++ `(make-face (quote (, var)))) + (defmacro defcustom (var value doc &rest args) +- (` (defvar (, var) (, value) (, doc))))) ++ `(defvar (, var) (, value) (, doc)))) + + ;;}}} + ;;{{{ Regexp-Opt (Emacs 19) +@@ -87,12 +88,13 @@ + ;;}}} + ;;{{{ Regexp-Opt (XEmacs) + ++;; Some versions of XEmacs required a three-argument version of regexp-opt, ++;; but current XEmacs is now back to taking the same number of arguments. ++;; This is now a simple wrapper around regexp-opt. -- rra, 2005-08-03 + (defmacro mmm-regexp-opt (strings paren) + "Act like FSF Emacs' `regexp-opt', whichever Emacs we're in. + XEmacs' `regexp-opt' requires an extra parameter to do grouping." +- (if (featurep 'xemacs) +- `(regexp-opt ,strings ,paren t) +- `(regexp-opt ,strings ,paren))) ++ `(regexp-opt ,strings ,paren)) + + ;;}}} + ;;{{{ Overlays (XEmacs) +@@ -187,7 +189,14 @@ + `(font-lock-set-defaults))) + + ;;}}} ++;;{{{ String Matching (XEmacs) ++ ++;; XEmacs doesn't have match-string-no-properties. -- rra, 2005-08-03 ++(unless (fboundp 'match-string-no-properties) ++ (defalias 'match-string-no-properties 'match-string)) ++ ++;;}}} + + (provide 'mmm-compat) + +-;;; mmm-compat.el ends here +\ No newline at end of file ++;;; mmm-compat.el ends here +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' mmm-mode-0.4.8~/mmm-region.el mmm-mode-0.4.8/mmm-region.el +--- mmm-mode-0.4.8~/mmm-region.el 2003-06-19 21:24:04.000000000 +1000 ++++ mmm-mode-0.4.8/mmm-region.el 2012-05-10 23:56:46.483673235 +1000 +@@ -416,7 +416,9 @@ + (overlay-put back-ovl 'match match-back))) + ;; Update everything and run all the hooks + (mmm-save-all +- (goto-char (overlay-start region-ovl)) ++ (if (overlay-start region-ovl) ++ ;; This happens if a zero-width region is immediately evaporated ++ (goto-char (overlay-start region-ovl))) + (mmm-set-current-submode submode) + (mmm-set-local-variables submode) + (mmm-run-submode-hook submode) +@@ -523,7 +525,8 @@ + ;; Code copied from font-lock.el to detect when font-lock + ;; should be on via global-font-lock-mode. + (and (or font-lock-defaults +- (assq major-mode font-lock-defaults-alist) ++ (and (boundp 'font-lock-defaults-alist) ++ (assq major-mode font-lock-defaults-alist)) + (assq major-mode font-lock-keywords-alist)) + (or (eq font-lock-global-modes t) + (if (eq (car-safe font-lock-global-modes) 'not) +@@ -586,7 +589,8 @@ + (ignore-errors (funcall func))))) + + (defun mmm-add-hooks () +- (make-local-hook 'post-command-hook) ++ (if (featurep 'xemacs) ++ (make-local-hook 'post-command-hook)) + (add-hook 'post-command-hook 'mmm-update-submode-region nil 'local)) + + (defun mmm-remove-hooks () --- mmm-mode-0.4.8.orig/debian/patches/03regexpopt.dpatch +++ mmm-mode-0.4.8/debian/patches/03regexpopt.dpatch @@ -0,0 +1,27 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 03regexpopt.dpatch by +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: don't load regexp-opt unless needed, #672168 + +@DPATCH@ +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' mmm-mode-0.4.8~/mmm-compat.el mmm-mode-0.4.8/mmm-compat.el +--- mmm-mode-0.4.8~/mmm-compat.el 2012-05-11 00:16:09.748341410 +1000 ++++ mmm-mode-0.4.8/mmm-compat.el 2012-05-11 00:16:59.734662910 +1000 +@@ -70,14 +70,8 @@ + (` (defvar (, var) (, value) (, doc))))) + + ;;}}} +-;;{{{ Regexp-Opt (Emacs 19) +- +-(condition-case () +- (require 'regexp-opt) +- (error nil)) +- +-(unless (and (featurep 'regexp-opt) +- (fboundp 'regexp-opt)) ++;;{{{ Regexp-Opt (Emacs) - autoloaded in Emacs 20++ ++(unless (fboundp 'regexp-opt) + ;; No regexp-opt; create one + (defun regexp-opt (strings &optional paren) + (concat (if paren "\\(" "") --- mmm-mode-0.4.8.orig/debian/patches/00list +++ mmm-mode-0.4.8/debian/patches/00list @@ -0,0 +1,6 @@ +01compat +02faces +03regexpopt +04gitupstream + + --- mmm-mode-0.4.8.orig/debian/patches/02faces.dpatch +++ mmm-mode-0.4.8/debian/patches/02faces.dpatch @@ -0,0 +1,70 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 02faces.dpatch by +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: fix default faces for both light and dark backgrounds + +@DPATCH@ +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' mmm-mode-0.4.8~/mmm-vars.el mmm-mode-0.4.8/mmm-vars.el +--- mmm-mode-0.4.8~/mmm-vars.el 2012-05-10 23:36:39.000000000 +1000 ++++ mmm-mode-0.4.8/mmm-vars.el 2012-05-10 23:36:57.746432100 +1000 +@@ -378,35 +378,51 @@ + (const :tag "Low" 1) + (const :tag "High" 2))) + +-(defface mmm-init-submode-face '((t (:background "Pink"))) ++(defface mmm-init-submode-face '((((background light)) (:background "Pink")) ++ (((background dark)) (:background "MediumOrchid")) ++ (t (:background "Pink"))) + "Face used for submodes containing initialization code." + :group 'mmm-faces) + +-(defface mmm-cleanup-submode-face '((t (:background "Wheat"))) ++(defface mmm-cleanup-submode-face '((((background light)) (:background "Wheat")) ++ (((background dark)) (:background "peru")) ++ (t (:background "Wheat"))) + "Face used for submodes containing cleanup code." + :group 'mmm-faces) + +-(defface mmm-declaration-submode-face '((t (:background "Aquamarine"))) ++(defface mmm-declaration-submode-face '((((background light)) (:background "Aquamarine")) ++ (((background dark)) (:background "DarkTurquoise")) ++ (t (:background "Aquamarine"))) + "Face used for submodes containing declarations." + :group 'mmm-faces) + +-(defface mmm-comment-submode-face '((t (:background "SkyBlue"))) ++(defface mmm-comment-submode-face '((((background light)) (:background "SkyBlue")) ++ (((background dark)) (:background "SteelBlue")) ++ (t (:background "SkyBlue"))) + "Face used for submodes containing comments and documentation." + :group 'mmm-faces) + +-(defface mmm-output-submode-face '((t (:background "Plum"))) ++(defface mmm-output-submode-face '((((background light)) (:background "Plum")) ++ (((background dark)) (:background "MediumVioletRed")) ++ (t (:background "Plum"))) + "Face used for submodes containing expression that are output." + :group 'mmm-faces) + +-(defface mmm-special-submode-face '((t (:background "MediumSpringGreen"))) ++(defface mmm-special-submode-face '((((background light)) (:background "MediumSpringGreen")) ++ (((background dark)) (:background "ForestGreen")) ++ (t (:background "MediumSpringGreen"))) + "Face used for special submodes not fitting any other category." + :group 'mmm-faces) + +-(defface mmm-code-submode-face '((t (:background "LightGray"))) ++(defface mmm-code-submode-face '((((background light)) (:background "LightGray")) ++ (((background dark)) (:background "DimGray")) ++ (t (:background "LightGray"))) + "Face used for submodes containing ordinary code." + :group 'mmm-faces) + +-(defface mmm-default-submode-face '((t (:background "gray85"))) ++(defface mmm-default-submode-face '((((background light)) (:background "gray85")) ++ (((background dark)) (:background "gray20")) ++ (t (:background "gray85"))) + "Face used for all submodes at decoration level 1. + Also used at decoration level 2 for submodes not specifying a type." + :group 'mmm-faces) --- mmm-mode-0.4.8.orig/debian/patches/04gitupstream.dpatch +++ mmm-mode-0.4.8/debian/patches/04gitupstream.dpatch @@ -0,0 +1,994 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 04gitupstream.dpatch by +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: pulling recent fixes from upstream git + +@DPATCH@ +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' mmm-mode-0.4.8~/ChangeLog mmm-mode-0.4.8/ChangeLog +--- mmm-mode-0.4.8~/ChangeLog 2004-06-17 00:14:02.000000000 +1000 ++++ mmm-mode-0.4.8/ChangeLog 2012-09-14 12:16:40.017267599 +1000 +@@ -1,3 +1,13 @@ ++2004-11-18 Alan Shutko ++ ++ * mmm-myghty.el: New mode from Ben Bangert. ++ ++ * mmm-vars.el (mmm-major-mode-preferences): Added Python prefs, ++ also from Ben. ++ ++ * mmm-auto.el (mmm-autoloaded-classes): Merged Ben Bangert's ++ Myghty class. ++ + 2004-06-16 Alan Shutko + + * version.texi: Release 0.4.8. +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' mmm-mode-0.4.8~/Checklist mmm-mode-0.4.8/Checklist +--- mmm-mode-0.4.8~/Checklist 1970-01-01 10:00:00.000000000 +1000 ++++ mmm-mode-0.4.8/Checklist 2012-09-14 12:18:01.072888613 +1000 +@@ -0,0 +1,28 @@ ++-*-text-*- ++ Checklist for New MMM Mode Releases ++ ++0. Test all new code, under all Emacsen if possible. Check that the ++ package builds and installs. The ChangeLog should be kept up to ++ date with important changes, such as with `C-x 4 a' in Emacs. ++ ++1. Check everything into CVS. Use of PCL-CVS `C' command is ++ recommended to bring ChangeLog entries into cvs comments, or else ++ update the ChangeLog with `C-x v a' after checking in other files. ++ ++2. Update the NEWS and TODO files and any other commentary files and ++ check them (and ChangeLog) into CVS. ++ ++3. Update version numbers and dates in `mmm-mode.el', `configure.in', ++ `mmm-vars.el', and `version.texi' (the latter by running `make'). ++ Check them in with comment "Released x.x.x". ++ ++4. Make a CVS snapshot (`C-x v s') of the MMM Mode directory. This is ++ the point at which a release becomes official. ++ ++5. Run `make dist' and upload the tarball. Upload to SourceForge. ++ ++ Adding Files ++ ++To add a file to the distribution, edit `Makefile.am' and add it to ++lisp_LISP (if an .el file) or EXTRA_DIST (otherwise). If necessary, ++add autoloads for functions or submode classes to `mmm-auto.el'. +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' mmm-mode-0.4.8~/Makefile.am mmm-mode-0.4.8/Makefile.am +--- mmm-mode-0.4.8~/Makefile.am 2004-05-29 08:14:30.000000000 +1000 ++++ mmm-mode-0.4.8/Makefile.am 2012-09-14 12:18:01.072888613 +1000 +@@ -5,7 +5,7 @@ + lisp_LISP = mmm-compat.el mmm-vars.el mmm-utils.el mmm-auto.el \ + mmm-region.el mmm-class.el mmm-cmds.el mmm-mode.el \ + mmm-sample.el mmm-mason.el mmm-univ.el mmm-rpm.el mmm-cweb.el \ +- mmm-noweb.el ++ mmm-noweb.el mmm-myghty.el + + info_TEXINFOS = mmm.texinfo + +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' mmm-mode-0.4.8~/README mmm-mode-0.4.8/README +--- mmm-mode-0.4.8~/README 2003-03-26 07:43:32.000000000 +1000 ++++ mmm-mode-0.4.8/README 2012-09-14 12:18:01.072888613 +1000 +@@ -14,11 +14,16 @@ + + INSTALLATION + ++ Users of package.el (a.k.a. ELPA) can easily install MMM Mode from the ++ Melpa package repository at http://melpa.milkbox.net/ -- this is the ++ preferred and best-supported installation mechanism. ++ + MMM Mode has a standard GNU configure-driven installation. (See the + file INSTALL for generic instructions, most of which don't apply.) + To install in the standard locations, unpack the archive, `cd' to + the mmm-mode-X.X.X directory created, and run these commands: + ++ ./autogen.sh + ./configure + make + make install +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' mmm-mode-0.4.8~/autogen.sh mmm-mode-0.4.8/autogen.sh +--- mmm-mode-0.4.8~/autogen.sh 1970-01-01 10:00:00.000000000 +1000 ++++ mmm-mode-0.4.8/autogen.sh 2012-09-14 12:18:01.072888613 +1000 +@@ -0,0 +1,28 @@ ++#!/bin/sh ++ ++notfound= ++if ! type aclocal >/dev/null 2>/dev/null; then ++ notfound=aclocal ++elif ! type automake >/dev/null 2>/dev/null; then ++ notfound=automake ++elif ! type autoconf >/dev/null 2>/dev/null; then ++ notfound=autoconf ++fi ++if test -n "$notfound"; then ++ echo OOPS: I can\'t find $notfound in your path! ++ echo You need aclocal, automake, and autoconf to generate configure. ++ echo Otherwise, you can install manually, see the README file. ++ exit; ++fi ++ ++echo -n Running aclocal to generate aclocal.m4... ++aclocal ++echo done. ++ ++echo -n Running automake to generate Makefile.in... ++automake ++echo done. ++ ++echo -n Running autoconf to generate configure... ++autoconf ++echo done +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' mmm-mode-0.4.8~/mmm-auto.el mmm-mode-0.4.8/mmm-auto.el +--- mmm-mode-0.4.8~/mmm-auto.el 2003-03-26 07:49:26.000000000 +1000 ++++ mmm-mode-0.4.8/mmm-auto.el 2012-09-14 12:18:34.179099865 +1000 +@@ -3,7 +3,7 @@ + ;; Copyright (C) 2000 by Michael Abraham Shulman + + ;; Author: Michael Abraham Shulman +-;; Version: $Id: mmm-auto.el,v 1.21 2003/03/25 21:49:26 viritrilbia Exp $ ++;; Version: $Id: mmm-auto.el,v 1.22 2004/11/19 02:33:36 alanshutko Exp $ + + ;;{{{ GPL + +@@ -66,6 +66,7 @@ + + (defvar mmm-autoloaded-classes + '((mason "mmm-mason" nil) ++ (myghty "mmm-myghty" nil) + (embedded-css "mmm-sample" nil) + (html-js "mmm-sample" nil) + (here-doc "mmm-sample" nil) +@@ -147,8 +148,7 @@ + (remove-hook 'post-command-hook 'mmm-check-changed-buffers) + (dolist (buffer mmm-changed-buffers-list) + (when (buffer-live-p buffer) +- (save-excursion +- (set-buffer buffer) ++ (with-current-buffer buffer + (mmm-run-major-mode-hook)))) + (setq mmm-changed-buffers-list '())) + +@@ -175,4 +175,4 @@ + + (provide 'mmm-auto) + +-;;; mmm-auto.el ends here +\ No newline at end of file ++;;; mmm-auto.el ends here +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' mmm-mode-0.4.8~/mmm-class.el mmm-mode-0.4.8/mmm-class.el +--- mmm-mode-0.4.8~/mmm-class.el 2004-06-11 10:31:07.000000000 +1000 ++++ mmm-mode-0.4.8/mmm-class.el 2012-09-14 12:18:55.583943286 +1000 +@@ -112,7 +112,8 @@ + The classes come from mode/ext, `mmm-classes', `mmm-global-classes', + and interactive history." + (mmm-clear-overlays start stop 'strict) +- (mmm-apply-classes (mmm-get-all-classes t) :start start :stop stop) ++ (let ((font-lock-mode)) ++ (mmm-apply-classes (mmm-get-all-classes t) :start start :stop stop)) + (mmm-update-submode-region) + (mmm-refontify-maybe start stop)) + +@@ -205,6 +206,7 @@ + + (defun* mmm-match-region + (&key start stop front back front-verify back-verify ++ front-delim back-delim + include-front include-back front-offset back-offset + front-form back-form save-matches match-submode match-face + front-match back-match end-not-begin +@@ -270,8 +272,8 @@ + and move OFFSET. Handles all values of OFFSET--see `mmm-classes-alist'." + (save-excursion + (goto-char (if beginp +- (match-beginning front-match) +- (match-end back-match))) ++ (match-beginning match) ++ (match-end match))) + (dolist (spec (if (listp offset) offset (list offset))) + (if (numberp spec) + (forward-char (or spec 0)) +@@ -322,4 +324,4 @@ + + (provide 'mmm-class) + +-;;; mmm-class.el ends here +\ No newline at end of file ++;;; mmm-class.el ends here +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' mmm-mode-0.4.8~/mmm-cmds.el mmm-mode-0.4.8/mmm-cmds.el +--- mmm-mode-0.4.8~/mmm-cmds.el 2003-03-26 07:48:33.000000000 +1000 ++++ mmm-mode-0.4.8/mmm-cmds.el 2012-09-14 12:19:10.669128151 +1000 +@@ -30,6 +30,7 @@ + + ;;; Code: + ++(require 'cl) + (require 'font-lock) + (require 'mmm-compat) + (require 'mmm-vars) +@@ -356,9 +357,7 @@ + ;; If we have a group class, recurse. + if (plist-get class :classes) + if (mmm-get-insertion-spec key it) +- return it +- else +- return nil)) ++ return it)) + + ;;}}} + ;;{{{ Help on Insertion +@@ -443,4 +442,4 @@ + + (provide 'mmm-cmds) + +-;;; mmm-cmds.el ends here +\ No newline at end of file ++;;; mmm-cmds.el ends here +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' mmm-mode-0.4.8~/mmm-erb.el mmm-mode-0.4.8/mmm-erb.el +--- mmm-mode-0.4.8~/mmm-erb.el 1970-01-01 10:00:00.000000000 +1000 ++++ mmm-mode-0.4.8/mmm-erb.el 2012-09-14 12:18:01.072888613 +1000 +@@ -0,0 +1,266 @@ ++;;; mmm-erb.el --- ERB templates editing support ++ ++;; Copyright (C) 2012 by Dmitry Gutov ++ ++;; Author: Dmitry Gutov ++ ++;;{{{ 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 definitions of JavaScript, CSS, ERB and EJS submode ++;; classes, and well as support functions for proper indentation. ++ ++;; Usage: ++ ++;; (require 'mmm-auto) ++ ++;; (setq mmm-global-mode 'auto) ++ ++;; (mmm-add-mode-ext-class 'html-erb-mode nil 'html-js) ++;; (mmm-add-mode-ext-class 'html-erb-mode nil 'html-css) ++;; (mmm-add-mode-ext-class 'html-erb-mode "\\.html\\.erb\\'" 'erb) ++;; (mmm-add-mode-ext-class 'html-erb-mode "\\.jst\\.ejs\\'" 'ejs) ++ ++;; (add-to-list 'auto-mode-alist '("\\.html\\.erb\\'" . html-erb-mode)) ++;; (add-to-list 'auto-mode-alist '("\\.jst\\.ejs\\'" . html-erb-mode)) ++ ++;; Optional settings: ++ ++;; (setq mmm-submode-decoration-level 2 ++;; mmm-parse-when-idle t) ++ ++;; nXML as primary mode (supports only JS and CSS subregions): ++ ++;; (mmm-add-mode-ext-class 'nxml-web-mode nil 'html-js) ++;; (mmm-add-mode-ext-class 'nxml-web-mode nil 'html-css) ++ ++;; (add-to-list 'auto-mode-alist '("\\.xhtml\\'" . nxml-web-mode)) ++ ++;;; Code: ++ ++(require 'sgml-mode) ++(eval-when-compile (require 'cl)) ++(require 'mmm-vars) ++(require 'mmm-region) ++ ++(mmm-add-group ++ 'html-js ++ '((js-script-cdata ++ :submode js-mode ++ :face mmm-code-submode-face ++ :front "]*>[ \t\n]*\\(//\\)?[ \t\n]*") ++ (js-script ++ :submode js-mode ++ :face mmm-code-submode-face ++ :front "]*>[ \t]*\n?" ++ :back "[ \t]*" ++ :insert ((?j js-tag nil @ "" @))))) ++ ++(mmm-add-group ++ 'html-css ++ '((css-cdata ++ :submode css-mode ++ :face mmm-code-submode-face ++ :front "]*>[ \t\n]*\\(//\\)?[ \t\n]*") ++ (css ++ :submode css-mode ++ :face mmm-code-submode-face ++ :front "]*>[ \t]*\n?" ++ :back "[ \t]*" ++ :insert ((?c css-tag nil @ "" @))))) ++ ++(mmm-add-classes ++ '((erb :submode ruby-mode :front "<%[#=]?" :back "-?%>" ++ :match-face (("<%#" . mmm-comment-submode-face) ++ ("<%=" . mmm-output-submode-face) ++ ("<%" . mmm-code-submode-face)) ++ :insert ((?% erb-code nil @ "<%" @ " " _ " " @ "%>" @) ++ (?# erb-comment nil @ "<%#" @ " " _ " " @ "%>" @) ++ (?= erb-expression nil @ "<%=" @ " " _ " " @ "%>" @)) ++ :creation-hook mmm-erb-mark-as-special) ++ (ejs :submode js-mode :front "<%[#=]?" :back "-?%>" ++ :match-face (("<%#" . mmm-comment-submode-face) ++ ("<%=" . mmm-output-submode-face) ++ ("<%" . mmm-code-submode-face)) ++ :insert ((?% ejs-code nil @ "<%" @ " " _ " " @ "%>" @) ++ (?# ejs-comment nil @ "<%#" @ " " _ " " @ "%>" @) ++ (?= ejs-expression nil @ "<%=" @ " " _ " " @ "%>" @)) ++ :creation-hook mmm-erb-mark-as-special))) ++ ++(pushnew '(indent-line-function buffer) mmm-save-local-variables) ++ ++;;;###autoload ++(define-derived-mode html-erb-mode html-mode "ERB-HTML" ++ (setq sgml-unclosed-tags nil) ; Simplifies indentation logic. ++ (add-hook 'mmm-html-erb-mode-hook 'mmm-erb-process-submode nil t) ++ (add-hook 'mmm-ruby-mode-submode-hook 'mmm-erb-process-submode nil t) ++ (add-hook 'mmm-css-mode-submode-hook 'mmm-erb-process-submode nil t) ++ (add-hook 'mmm-js-mode-submode-hook 'mmm-erb-process-submode nil t)) ++ ++(defun mmm-erb-process-submode () ++ "Hook function to run after primary or submode major mode function." ++ (setq indent-line-function 'mmm-erb-indent-line)) ++ ++(defun mmm-erb-mark-as-special () ++ "Hook function to run in ERB and EJS tag regions." ++ (overlay-put mmm-current-overlay 'mmm-special-tag t)) ++ ++(defun mmm-erb-indent-line () ++ "Indent the current line intelligently." ++ (interactive) ++ (let ((offset (- (current-column) (current-indentation)))) ++ (back-to-indentation) ++ (mmm-update-submode-region) ++ (if (and mmm-current-overlay mmm-current-submode ++ (< (overlay-start mmm-current-overlay) (point-at-bol))) ++ ;; Region starts before the current line (and contains indentation). ++ (mmm-erb-indent-line-submode) ++ (mmm-erb-indent-line-primary)) ++ (when (> offset 0) (forward-char offset)))) ++ ++(defun mmm-erb-indent-line-submode () ++ "Indent line within a submode." ++ (let (added-whitespace) ++ (if (<= (overlay-end mmm-current-overlay) ++ (save-excursion (back-to-indentation) (point))) ++ ;; We're at a closing tag. ++ (mmm-erb-indent-to-region-start) ++ (save-restriction ++ (save-excursion ++ (goto-char (overlay-start mmm-current-overlay)) ++ (when (not (looking-at "^\\|\\s-*$")) ++ ;; Submode region has text on the same line as the opening tag, ++ ;; pad it with whitespace to make the following lines line up. ++ (setq added-whitespace (current-column)) ++ (insert-char ?\s added-whitespace))) ++ (narrow-to-region (overlay-start mmm-current-overlay) ++ (overlay-end mmm-current-overlay)) ++ (funcall (mmm-erb-orig-indent-function mmm-current-submode)) ++ (when added-whitespace ++ ;; Remove the padding. ++ (save-excursion ++ (goto-char (overlay-start mmm-current-overlay)) ++ (delete-char added-whitespace)))) ++ ;; If submode indent function moved us to bol, ++ ;; we're on the top level, indent according to the primary mode. ++ (when (zerop (current-indentation)) ++ (mmm-erb-indent-to-region-start ++ (mmm-erb-indent-offset mmm-primary-mode)))))) ++ ++(defun mmm-erb-indent-to-region-start (&optional additional-offset) ++ "Indent line to match start of region, possibly adding ADDITIONAL-OFFSET." ++ (let ((indent (current-indentation))) ++ (indent-line-to ++ (save-excursion ++ (goto-char (1- (overlay-start mmm-current-overlay))) ++ (+ (current-indentation) ++ (or additional-offset 0)))))) ++ ++(defun mmm-erb-indent-line-primary () ++ "Indent line in primary mode." ++ (let* ((here (point)) ++ ;; Go before previous line's tag. ++ (start (progn (forward-line -1) ++ (back-to-indentation) ++ (let ((lcon (sgml-lexical-context))) ++ (when (eq (car lcon) 'tag) ++ ;; Tag spreads several lines. ++ (goto-char (cdr lcon)) ++ (back-to-indentation))) ++ (point))) ++ (regions (mmm-regions-in start here)) ++ (n 0)) ++ ;; Collect indent modifier depending on type of tags. ++ (loop for region in regions ++ for type = (mmm-erb-scan-region region) ++ when type do ++ (if (eq type 'close) ++ (when (plusp n) (decf n)) ++ (incf n (if (eq type 'close) 0 1)))) ++ (let ((eol (progn (goto-char here) (end-of-line 1) (point)))) ++ ;; Look for "else" and "end" instructions to adjust modifier. ++ ;; If a block start instruction comes first, abort. ++ (loop for region in (mmm-regions-in here eol) ++ for type = (mmm-erb-scan-region region) ++ until (eq type 'open) ++ when (memq type '(middle close)) do (decf n))) ++ (goto-char here) ++ (funcall (mmm-erb-orig-indent-function mmm-primary-mode)) ++ (let* ((indent (current-indentation)) ++ (indent-step (mmm-erb-indent-offset mmm-primary-mode))) ++ (indent-line-to (+ indent (if n (* indent-step n) 0)))))) ++ ++(defun mmm-erb-scan-region (region) ++ (when region ; Can be nil if a line is empty, for example. ++ (destructuring-bind (submode beg end) region ++ (let ((scan-fn (plist-get '(ruby-mode mmm-erb-scan-erb ++ js-mode mmm-erb-scan-ejs) ++ submode))) ++ (and scan-fn ++ (overlay-get (mmm-overlay-at beg) 'mmm-special-tag) ++ (save-excursion ++ (goto-char beg) ++ (skip-syntax-forward "-") ++ (funcall scan-fn end))))))) ++ ++(defconst mmm-erb-ruby-close-re "\\\\|}" ++ "Regexp to match the end of a Ruby block.") ++ ++(defun mmm-erb-scan-erb (limit) ++ (cond ((looking-at "\\(?:if\\|unless\\|for\\|while\\)\\b") 'open) ++ ((looking-at "\\(?:else\\|elsif\\)\\b") 'middle) ++ ((looking-at mmm-erb-ruby-close-re) 'close) ++ ((and (re-search-forward (concat "\\(?: +do +\\| *{ *\\)" ++ "\\(?:|[A-Za-z0-9_, ]*|\\)? *") ++ limit t) ++ (not (re-search-forward mmm-erb-ruby-close-re limit t))) ++ 'open))) ++ ++(defun mmm-erb-scan-ejs (limit) ++ (cond ((looking-at "\\(?:if\\|for\\|while\\)\\b") 'open) ++ ((looking-at "} *else\\b") 'middle) ++ ((looking-at "}") 'close) ++ ((re-search-forward " *{ *" limit t) 'open))) ++ ++(defun mmm-erb-orig-indent-function (mode) ++ (cadr (assoc 'indent-line-function (get mode 'mmm-local-variables)))) ++ ++(defvar mmm-erb-offset-var-alist ++ '((html-erb-mode . sgml-basic-offset) ++ (nxml-web-mode . nxml-child-indent))) ++ ++(defun mmm-erb-indent-offset (mode) ++ (let ((name (cdr (assoc mode mmm-erb-offset-var-alist)))) ++ (when name (symbol-value name)))) ++ ++;;;###autoload ++(define-derived-mode nxml-web-mode nxml-mode "nXML-Web" ++ (add-hook 'mmm-nxml-web-mode-hook 'mmm-erb-process-submode nil t) ++ (add-hook 'mmm-css-mode-submode-hook 'mmm-erb-process-submode nil t) ++ (add-hook 'mmm-js-mode-submode-hook 'mmm-erb-process-submode nil t)) ++ ++(provide 'mmm-erb) ++ ++;;; mmm-erb.el ends here +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' mmm-mode-0.4.8~/mmm-mode.el mmm-mode-0.4.8/mmm-mode.el +--- mmm-mode-0.4.8~/mmm-mode.el 2004-06-17 00:14:18.000000000 +1000 ++++ mmm-mode-0.4.8/mmm-mode.el 2012-09-14 12:21:02.691074252 +1000 +@@ -160,9 +160,11 @@ + (mmm-add-hooks) + (mmm-fixup-skeleton) + (make-local-variable 'font-lock-fontify-region-function) +- (make-local-variable 'font-lock-beginning-of-syntax-function) +- (setq font-lock-fontify-region-function 'mmm-fontify-region +- font-lock-beginning-of-syntax-function 'mmm-beginning-of-syntax) ++ (setq font-lock-fontify-region-function 'mmm-fontify-region) ++ (set (make-local-variable (if (boundp 'syntax-begin-function) ; Emacs >= 23 ++ 'syntax-begin-function ++ 'font-lock-beginning-of-syntax-function)) ++ 'mmm-beginning-of-syntax) + (setq mmm-mode t) + (condition-case err + (mmm-apply-all) +@@ -189,9 +191,11 @@ + (mmm-clear-local-variables) + (mmm-update-submode-region) + (setq font-lock-fontify-region-function +- (get mmm-primary-mode 'mmm-fontify-region-function) +- font-lock-beginning-of-syntax-function +- (get mmm-primary-mode 'mmm-beginning-of-syntax-function)) ++ (get mmm-primary-mode 'mmm-fontify-region-function)) ++ (set (if (boundp 'syntax-begin-function) ; Emacs >= 23 ++ 'syntax-begin-function ++ 'font-lock-beginning-of-syntax-function) ++ (get mmm-primary-mode 'mmm-beginning-of-syntax-function)) + (mmm-update-font-lock-buffer) + (mmm-refontify-maybe) + (setq mmm-mode nil) +@@ -293,4 +297,4 @@ + + (provide 'mmm-mode) + +-;;; mmm-mode.el ends here +\ No newline at end of file ++;;; mmm-mode.el ends here +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' mmm-mode-0.4.8~/mmm-myghty.el mmm-mode-0.4.8/mmm-myghty.el +--- mmm-mode-0.4.8~/mmm-myghty.el 1970-01-01 10:00:00.000000000 +1000 ++++ mmm-mode-0.4.8/mmm-myghty.el 2012-09-14 12:18:01.072888613 +1000 +@@ -0,0 +1,189 @@ ++;;; mmm-myghty.el --- MMM submode class for Myghty components ++;;; ++ ++;; Copyright (C) 2000 by Michael Abraham Shulman ++;; Copyright (C) 2004 by Ben Bangert ++ ++;; Original Author: Michael Abraham Shulman ++;; Based on mmm-mason.el Version: $Id: mmm-myghty.el,v 1.13 2003/03/09 17:04:03 ++ ++;; Trivial changes by Ben Bangert ++ ++;;{{{ 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: ++ ++;;; I went to the hard (sarcasm) effort of applying two global ++;;; search/replaces, and adding a few keywords for additional ++;;; blocks that Myghty introduced. Many thanks to Michael for writing ++;;; the mmm-mason without which I would never have found the time ++;;; to patch up for Myghty. ++ ++;;; Code: ++ ++(require 'mmm-compat) ++(require 'mmm-vars) ++(require 'mmm-auto) ++ ++;;{{{ Python Tags ++ ++(defvar mmm-myghty-python-tags ++ '("python" "init" "cleanup" "once" "filter" "shared" "global" ++ "threadlocal" "requestlocal" ++ "python_init" "python_cleanup" "python_once" "python_filter")) ++ ++(defvar mmm-myghty-pseudo-python-tags ++ '("args" "python_args" "attr" "flags")) ++ ++(defvar mmm-myghty-non-python-tags ++ '("doc" "python_doc" "text" "python_text" "def" "python_def" "method")) ++ ++(defvar mmm-myghty-python-tags-regexp ++ (concat "<%" (mmm-regexp-opt mmm-myghty-python-tags t) ">") ++ "Matches tags beginning Myghty sections containing Python code. ++Saves the name of the tag matched.") ++ ++(defvar mmm-myghty-pseudo-python-tags-regexp ++ (concat "<%" (mmm-regexp-opt mmm-myghty-pseudo-python-tags t) ">") ++ "Match tags beginning Myghty sections that look like Python but aren't. ++Saves the name of the tag matched.") ++ ++(defvar mmm-myghty-tag-names-regexp ++ (regexp-opt (append mmm-myghty-python-tags mmm-myghty-non-python-tags) t) ++ "Matches any Myghty tag name after the \"<%\". Used to verify that a ++\"<%\" sequence starts an inline section.") ++ ++(defun mmm-myghty-verify-inline () ++ (not (looking-at mmm-myghty-tag-names-regexp))) ++ ++;;}}} ++;;{{{ Add Classes ++ ++(mmm-add-group ++ 'myghty ++ `((myghty-text ++ :submode nil ++ :front "<%text>" ++ :back "" ++ :insert ((?t myghty-<%text> nil @ "<%text>" @ "\n" ++ _ "\n" @ "" @))) ++ (myghty-doc ++ :submode text-mode ++ :face mmm-comment-submode-face ++ :front "<%doc>" ++ :back "" ++ :face nil ++ :insert ((?d myghty-<%doc> nil @ "<%doc>" @ "\n" ++ _ "\n" @ "" @))) ++ (myghty-python ++ :submode python ++ :match-face (("<%python>" . mmm-code-submode-face) ++ ("<%init>" . mmm-init-submode-face) ++ ("<%cleanup>" . mmm-cleanup-submode-face) ++ ("<%once>" . mmm-init-submode-face) ++ ("<%global>" . mmm-init-submode-face) ++ ("<%filter>" . mmm-special-submode-face) ++ ("<%shared>" . mmm-init-submode-face) ++ ("<%threadlocal>" . mmm-init-submode-face) ++ ("<%requestlocal>" . mmm-init-submode-face)) ++ :front ,mmm-myghty-python-tags-regexp ++ :back "" ++ :save-matches 1 ++ :match-name "~1" ++ :save-name 1 ++ :insert ((?, myghty-<%TAG> "Python section: " @ "<%" str ">" @ ++ ";\n" _ "\n" @ "" @) ++ (?< myghty-<%TAG> ?, . nil) ++ (?p myghty-<%python> ?, . "python") ++ (?i myghty-<%init> ?, . "init") ++ (?c myghty-<%cleanup> ?, . "cleanup") ++ (?o myghty-<%once> ?, . "once") ++ (?g myghty-<%global> ?, . "global") ++ (?t myghty-<%threadlocal> ?, . "threadlocal") ++ (?e myghty-<%requestlocal> ?, . "requestlocal") ++ (?l myghty-<%filter> ?, . "filter") ++ (?s myghty-<%shared> ?, . "shared"))) ++ (myghty-pseudo-python ++ :submode python ++ :face mmm-declaration-submode-face ++ :front ,mmm-myghty-pseudo-python-tags-regexp ++ :back "" ++ :save-matches 1 ++ :insert ((?. myghty-pseudo-<%TAG> "Pseudo-python section: " @ "<%" str ">" @ ++ "\n" _ "\n" @ "" @) ++ (?> myghty-pseudo-<%TAG> ?, . nil) ++ (?a myghty-<%args> ?. . "args") ++ (?f myghty-<%flags> ?. . "flags") ++ (?r myghty-<%attr> ?. . "attr"))) ++ (myghty-inline ++ :submode python ++ :face mmm-output-submode-face ++ :front "<%" ++ :front-verify mmm-myghty-verify-inline ++ :back "%>" ++ :insert ((?% myghty-<%-%> nil @ "<%" @ " " _ " " @ "%>" @) ++ (?5 myghty-<%-%> ?% . nil))) ++ (myghty-call ++ :submode python ++ :face mmm-special-submode-face ++ :front "<&" ++ :back "&>" ++ :insert ((?& myghty-<&-&> nil @ "<&" @ " " _ " " @ "&>" @) ++ (?7 myghty-<&-&> ?% . nil))) ++ (myghty-one-line-comment ++ :submode text-mode ++ :face mmm-comment-submode-face ++ :front "^%#" ++ :back "\n" ++ :insert ((?# myghty-%-comment nil (mmm-myghty-start-line) ++ @ "%" @ "# " _ @ '(mmm-myghty-end-line) "\n" @) ++ (?3 myghty-%-comment ?# . nil))) ++ (myghty-one-line ++ :submode python ++ :face mmm-code-submode-face ++ :front "^%" ++ :back "\n" ++ :insert ((return myghty-%-line nil (mmm-myghty-start-line) ++ @ "%" @ " " _ @ '(mmm-myghty-end-line) "\n" @))))) ++ ++;;}}} ++;;{{{ One-line Sections ++ ++(defun mmm-myghty-start-line () ++ (if (bolp) ++ "" ++ "\n")) ++ ++(defun mmm-myghty-end-line () ++ (if (eolp) ++ (delete-char 1))) ++ ++;;}}} ++;;{{{ Set Mode Line ++ ++(defun mmm-myghty-set-mode-line () ++ (setq mmm-buffer-mode-display-name "Myghty")) ++(add-hook 'mmm-myghty-class-hook 'mmm-myghty-set-mode-line) ++ ++;;}}} ++ ++(provide 'mmm-myghty) ++ ++;;; mmm-myghty.el ends here +\ No newline at end of file +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' mmm-mode-0.4.8~/mmm-noweb.el mmm-mode-0.4.8/mmm-noweb.el +--- mmm-mode-0.4.8~/mmm-noweb.el 2004-06-17 00:01:10.000000000 +1000 ++++ mmm-mode-0.4.8/mmm-noweb.el 2012-09-14 12:21:02.691074252 +1000 +@@ -35,6 +35,7 @@ + + ;;; Code: + ++(require 'cl) + (require 'mmm-region) + (require 'mmm-vars) + (require 'mmm-mode) +@@ -407,4 +408,4 @@ + + (provide 'mmm-noweb) + +-;;; mmm-noweb.el ends here +\ No newline at end of file ++;;; mmm-noweb.el ends here +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' mmm-mode-0.4.8~/mmm-region.el mmm-mode-0.4.8/mmm-region.el +--- mmm-mode-0.4.8~/mmm-region.el 2012-09-14 12:15:49.316006343 +1000 ++++ mmm-mode-0.4.8/mmm-region.el 2012-09-14 12:21:02.691074252 +1000 +@@ -417,8 +417,8 @@ + ;; Update everything and run all the hooks + (mmm-save-all + (if (overlay-start region-ovl) +- ;; This happens if a zero-width region is immediately evaporated +- (goto-char (overlay-start region-ovl))) ++ ;; This happens if a zero-width region is immediately evaporated ++ (goto-char (overlay-start region-ovl))) + (mmm-set-current-submode submode) + (mmm-set-local-variables submode) + (mmm-run-submode-hook submode) +@@ -472,12 +472,12 @@ + (defun mmm-clear-overlays (&optional start stop strict) + "Clears all MMM overlays overlapping START and STOP. + If STRICT, only clear those entirely included in that region." +- (mapcar #'delete-overlay +- (if strict +- (mmm-overlays-contained-in (or start (point-min)) +- (or stop (point-max))) +- (mmm-overlays-overlapping (or start (point-min)) +- (or stop (point-max))))) ++ (mapc #'delete-overlay ++ (if strict ++ (mmm-overlays-contained-in (or start (point-min)) ++ (or stop (point-max))) ++ (mmm-overlays-overlapping (or start (point-min)) ++ (or stop (point-max))))) + (mmm-update-submode-region)) + + ;;}}} +@@ -507,8 +507,7 @@ + ;; On errors, the temporary buffers don't get deleted, so here + ;; we get rid of any old ones that may be hanging around. + (when (buffer-live-p (get-buffer mmm-temp-buffer-name)) +- (save-excursion +- (set-buffer (get-buffer mmm-temp-buffer-name)) ++ (with-current-buffer (get-buffer mmm-temp-buffer-name) + (set-buffer-modified-p nil) + (kill-buffer (current-buffer)))) + ;; Now make a new temporary buffer. +@@ -525,8 +524,8 @@ + ;; Code copied from font-lock.el to detect when font-lock + ;; should be on via global-font-lock-mode. + (and (or font-lock-defaults +- (and (boundp 'font-lock-defaults-alist) +- (assq major-mode font-lock-defaults-alist)) ++ (and (boundp 'font-lock-defaults-alist) ++ (assq major-mode font-lock-defaults-alist)) + (assq major-mode font-lock-keywords-alist)) + (or (eq font-lock-global-modes t) + (if (eq (car-safe font-lock-global-modes) 'not) +@@ -566,7 +565,9 @@ + (if region-entry + (setcdr region-entry region-vars) + (push (cons mode region-vars) +- mmm-region-saved-locals-defaults))))) ++ mmm-region-saved-locals-defaults)) ++ ;; The temp buffer stuff above wipes fontification. ++ (mmm-refontify-maybe)))) + + ;;}}} + ;;{{{ Updating Hooks +@@ -591,10 +592,15 @@ + (defun mmm-add-hooks () + (if (featurep 'xemacs) + (make-local-hook 'post-command-hook)) +- (add-hook 'post-command-hook 'mmm-update-submode-region nil 'local)) ++ (add-hook 'post-command-hook 'mmm-update-submode-region nil t) ++ (when mmm-parse-when-idle ++ (add-hook 'pre-command-hook 'mmm-mode-reset-timer nil t) ++ (add-hook 'after-change-functions 'mmm-mode-edit nil t))) + + (defun mmm-remove-hooks () +- (remove-hook 'post-command-hook 'mmm-update-submode-region 'local)) ++ (remove-hook 'post-command-hook 'mmm-update-submode-region t) ++ (remove-hook 'pre-command-hook 'mmm-mode-reset-timer t) ++ (remove-hook 'after-change-functions 'mmm-mode-edit t)) + + ;;}}} + ;;{{{ Local Variables +@@ -778,16 +784,18 @@ + (when (get (car elt) 'mmm-font-lock-mode) + (mmm-fontify-region-list (car elt) (cdr elt)))) + (mmm-regions-alist start stop))) +- ;; With jit-lock, this causes blips in the mode line and menus. +- ;; Shouldn't be necessary here, since it's in post-command-hook too. +- ;;(mmm-update-submode-region) ++ ;; It's in `post-command-hook' too, but that's executed before font-lock, ++ ;; so the latter messes up local vars (such as line-indent-function) ++ ;; until after the next command. ++ (mmm-update-submode-region) + (when loudly (message nil))) + + (defun mmm-fontify-region-list (mode regions) + "Fontify REGIONS, each like \(BEG END), in mode MODE." + (save-excursion + (let (;(major-mode mode) +- (func (get mode 'mmm-fontify-region-function))) ++ (func (get mode 'mmm-fontify-region-function)) ++ font-lock-extend-region-functions) + (mapc #'(lambda (reg) + (goto-char (car reg)) + ;; Here we do the same sort of thing that +@@ -818,4 +826,4 @@ + + (provide 'mmm-region) + +-;;; mmm-region.el ends here +\ No newline at end of file ++;;; mmm-region.el ends here +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' mmm-mode-0.4.8~/mmm-sample.el mmm-mode-0.4.8/mmm-sample.el +--- mmm-mode-0.4.8~/mmm-sample.el 2004-06-03 10:53:52.000000000 +1000 ++++ mmm-mode-0.4.8/mmm-sample.el 2012-09-14 12:21:02.691074252 +1000 +@@ -31,6 +31,7 @@ + + ;;; Code: + ++(require 'cl) + (require 'mmm-auto) + (require 'mmm-vars) + +@@ -371,4 +372,4 @@ + + (provide 'mmm-sample) + +-;;; mmm-sample.el ends here +\ No newline at end of file ++;;; mmm-sample.el ends here +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' mmm-mode-0.4.8~/mmm-utils.el mmm-mode-0.4.8/mmm-utils.el +--- mmm-mode-0.4.8~/mmm-utils.el 2003-03-10 03:04:04.000000000 +1000 ++++ mmm-mode-0.4.8/mmm-utils.el 2012-09-14 12:21:02.691074252 +1000 +@@ -78,7 +78,11 @@ + (save-match-data + (dolist (pair arg-pairs) + (while (string-match (car pair) string) +- (setq string (replace-match (cdr pair) t t string)))))) ++ (setq string (replace-match ++ (if (fboundp 'format-mode-line) ++ (format-mode-line (cdr pair)) ++ (cdr pair)) ++ t t string)))))) + string) + + (defun mmm-format-matches (string &optional on-string) +@@ -93,7 +97,7 @@ + subexp) + (save-match-data + (while (string-match "~\\([0-9]\\)" string) +- (setq subexp (string-to-int (match-string-no-properties 1 string)) ++ (setq subexp (string-to-number (match-string-no-properties 1 string)) + string (replace-match + (save-match-data + (set-match-data old-data) +@@ -155,4 +159,4 @@ + + (provide 'mmm-utils) + +-;;; mmm-utils.el ends here +\ No newline at end of file ++;;; mmm-utils.el ends here +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' mmm-mode-0.4.8~/mmm-vars.el mmm-mode-0.4.8/mmm-vars.el +--- mmm-mode-0.4.8~/mmm-vars.el 2012-09-14 12:15:49.319006181 +1000 ++++ mmm-mode-0.4.8/mmm-vars.el 2012-09-14 12:21:02.691074252 +1000 +@@ -3,7 +3,7 @@ + ;; Copyright (C) 2000, 2004 by Michael Abraham Shulman + + ;; Author: Michael Abraham Shulman +-;; Version: $Id: mmm-vars.el,v 1.56 2004/06/16 14:14:18 alanshutko Exp $ ++;; Version: $Id: mmm-vars.el,v 1.57 2004/11/19 02:33:36 alanshutko Exp $ + + ;;{{{ GPL + +@@ -33,6 +33,7 @@ + ;;; Code: + + (require 'mmm-compat) ++(require 'cl) + + ;; MISCELLANEOUS + ;;{{{ Shut up the Byte Compiler +@@ -288,6 +289,10 @@ + comment-end + comment-start + comment-start-skip)) ++ ,@(mapcar ++ (lambda (var) (list var nil '(js-mode))) ++ '(js--quick-match-re ++ js--quick-match-re-func)) + ;; Skeleton insertion + skeleton-transformation + ;; Abbrev mode +@@ -534,6 +539,7 @@ + + (defcustom mmm-major-mode-preferences + '((perl cperl-mode perl-mode) ++ (python python-mode python-mode) + (javascript javascript-mode c++-mode) + (java jde-mode java-mode c++-mode) + (css css-mode c++-mode)) +@@ -778,6 +784,44 @@ + than it solves, but some modes require it.") + + ;;}}} ++;;{{{ Idle Parsing ++ ++(defcustom mmm-parse-when-idle nil ++ "Non-nil to automatically reparse the buffer when it has some ++ modifications and Emacs has been idle for `mmm-idle-timer-delay'." ++ :type 'boolean ++ :group 'mmm) ++ ++(defcustom mmm-idle-timer-delay 0.2 ++ "Delay in secs before re-parsing after user makes changes." ++ :type 'number ++ :group 'mmm) ++(make-variable-buffer-local 'mmm-idle-timer-delay) ++ ++(defvar mmm-mode-parse-timer nil "Private variable.") ++(make-variable-buffer-local 'mmm-mode-parse-timer) ++(defvar mmm-mode-buffer-dirty nil "Private variable.") ++(make-variable-buffer-local 'mmm-mode-buffer-dirty) ++ ++(defun mmm-mode-edit (beg end len) ++ (setq mmm-mode-buffer-dirty t) ++ (mmm-mode-reset-timer)) ++ ++(defun mmm-mode-reset-timer () ++ (when mmm-mode-parse-timer ++ (cancel-timer mmm-mode-parse-timer)) ++ (setq mmm-mode-parse-timer ++ (run-with-idle-timer mmm-idle-timer-delay nil ++ #'mmm-mode-idle-reparse (current-buffer)))) ++ ++(defun mmm-mode-idle-reparse (buffer) ++ (with-current-buffer buffer ++ (when mmm-mode-buffer-dirty ++ (mmm-apply-all) ++ (setq mmm-mode-buffer-dirty nil) ++ (setq mmm-mode-parse-timer nil)))) ++ ++;;}}} + + ;; NON-USER VARIABLES + ;;{{{ Mode Variable