[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master fe07951 277/433: * mmm-myghty.el: New mode from Ben Banger
From: |
Dmitry Gutov |
Subject: |
[elpa] master fe07951 277/433: * mmm-myghty.el: New mode from Ben Bangert. |
Date: |
Thu, 15 Mar 2018 19:44:20 -0400 (EDT) |
branch: master
commit fe0795147cfddb0757a0eba2457a1e68ba810d2d
Author: alanshutko <alanshutko>
Commit: alanshutko <alanshutko>
* 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.
---
ChangeLog | 10 ++++
mmm-auto.el | 3 +-
mmm-myghty.el | 189 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
mmm-vars.el | 3 +-
4 files changed, 203 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index d2478a6..1f8a161 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2004-11-18 Alan Shutko <address@hidden>
+
+ * 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 <address@hidden>
* version.texi: Release 0.4.8.
diff --git a/mmm-auto.el b/mmm-auto.el
index 8c8aa2c..e068eb4 100644
--- a/mmm-auto.el
+++ b/mmm-auto.el
@@ -3,7 +3,7 @@
;; Copyright (C) 2000 by Michael Abraham Shulman
;; Author: Michael Abraham Shulman <address@hidden>
-;; 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)
diff --git a/mmm-myghty.el b/mmm-myghty.el
new file mode 100644
index 0000000..a745e2f
--- /dev/null
+++ b/mmm-myghty.el
@@ -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 <address@hidden>
+;; 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 "</%text>"
+ :insert ((?t myghty-<%text> nil @ "<%text>" @ "\n"
+ _ "\n" @ "</%text>" @)))
+ (myghty-doc
+ :submode text-mode
+ :face mmm-comment-submode-face
+ :front "<%doc>"
+ :back "</%doc>"
+ :face nil
+ :insert ((?d myghty-<%doc> nil @ "<%doc>" @ "\n"
+ _ "\n" @ "</%doc>" @)))
+ (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 "</%~1>"
+ :save-matches 1
+ :match-name "~1"
+ :save-name 1
+ :insert ((?, myghty-<%TAG> "Python section: " @ "<%" str ">" @
+ ";\n" _ "\n" @ "</%" str ">" @)
+ (?< 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 "</%~1>"
+ :save-matches 1
+ :insert ((?. myghty-pseudo-<%TAG> "Pseudo-python section: " @ "<%" str ">"
@
+ "\n" _ "\n" @ "</%" str ">" @)
+ (?> 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 --git a/mmm-vars.el b/mmm-vars.el
index 68eff49..d4961ed 100644
--- a/mmm-vars.el
+++ b/mmm-vars.el
@@ -3,7 +3,7 @@
;; Copyright (C) 2000, 2004 by Michael Abraham Shulman
;; Author: Michael Abraham Shulman <address@hidden>
-;; 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
@@ -518,6 +518,7 @@ unnecessary. It probably won't go away, though."
(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))
- [elpa] master 278ba52 386/433: Fix #37, (continued)
- [elpa] master 278ba52 386/433: Fix #37, Dmitry Gutov, 2018/03/15
- [elpa] master ed9e32c 242/433: * FAQ: Updated comments about other emacs variants., Dmitry Gutov, 2018/03/15
- [elpa] master ecf2a75 257/433: Use correct variable name..., Dmitry Gutov, 2018/03/15
- [elpa] master cd85acc 266/433: Added file for building SRPMs, thanks to bishop, Dmitry Gutov, 2018/03/15
- [elpa] master 93e7a93 271/433: (mmm-save-local-variables): Add semantic stuff and, Dmitry Gutov, 2018/03/15
- [elpa] master c1a33b7 260/433: (mmm-define-key): Added optional keymap argument, Dmitry Gutov, 2018/03/15
- [elpa] master 821386c 283/433: Ignore .elc files, Dmitry Gutov, 2018/03/15
- [elpa] master 2cb7c99 189/433: Added multiple faces and optional levels of decoration., Dmitry Gutov, 2018/03/15
- [elpa] master 5321422 248/433: Updated docstrings and comments. Added primary mode hook., Dmitry Gutov, 2018/03/15
- [elpa] master 5f82799 276/433: * version.texi: Release 0.4.8., Dmitry Gutov, 2018/03/15
- [elpa] master fe07951 277/433: * mmm-myghty.el: New mode from Ben Bangert.,
Dmitry Gutov <=
- [elpa] master a71a299 207/433: # Updated, Dmitry Gutov, 2018/03/15
- [elpa] master 9aa2af2 239/433: * mmm-class.el (mmm-match-region): Fixed return values bug, so, Dmitry Gutov, 2018/03/15
- [elpa] master a98405e 281/433: Make reference to var font-lock-defaults-alist conditional; var is obsolete in Emacs 24., Dmitry Gutov, 2018/03/15
- [elpa] master a7b8c55 296/433: Do syntax highlighting and indentation in ERB buffers, Dmitry Gutov, 2018/03/15
- [elpa] master 37f9a4b 183/433: Released 0.4.6, Dmitry Gutov, 2018/03/15
- [elpa] master 1e46c43 306/433: Fix #8, Dmitry Gutov, 2018/03/15
- [elpa] master ed0b781 310/433: Merge pull request #9 from dgutov/master, Dmitry Gutov, 2018/03/15
- [elpa] master e5fe9e7 261/433: Implemented a 'local to submode class' keymap binding, using a dummy overlay., Dmitry Gutov, 2018/03/15
- [elpa] master 955038c 302/433: Merge remote-tracking branch 'refs/remotes/dgutov/erb', Dmitry Gutov, 2018/03/15
- [elpa] master 7f9dbdb 292/433: Fix `mmm-insert-region' to not abort loop too soon, Dmitry Gutov, 2018/03/15