emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master 9afb287 043/433: Added mmm-[get, set]-class-parameters and


From: Dmitry Gutov
Subject: [elpa] master 9afb287 043/433: Added mmm-[get, set]-class-parameters and creation-hook.
Date: Thu, 15 Mar 2018 19:43:31 -0400 (EDT)

branch: master
commit 9afb2872fd7c2a8251245fb18b91bebf0d5440a1
Author: mas <mas>
Commit: mas <mas>

    Added mmm-[get,set]-class-parameters and creation-hook.
---
 mmm-class.el | 23 ++++++++++++++++++++---
 1 file changed, 20 insertions(+), 3 deletions(-)

diff --git a/mmm-class.el b/mmm-class.el
index 656ccc2..42888a6 100644
--- a/mmm-class.el
+++ b/mmm-class.el
@@ -3,7 +3,7 @@
 ;; Copyright (C) 2000 by Michael Abraham Shulman
 
 ;; Author: Michael Abraham Shulman <address@hidden>
-;; Version: $Id: mmm-class.el,v 1.4 2000/05/18 18:28:13 mas Exp $
+;; Version: $Id: mmm-class.el,v 1.5 2000/06/27 02:46:56 mas Exp $
 
 ;;{{{ GPL
 
@@ -51,6 +51,22 @@ class specifier itself."
         (t (signal 'mmm-invalid-submode-class (list class)))))
 
 ;;}}}
+;;{{{ Get and Set Class Parameters
+
+(defun mmm-get-class-parameter (class param)
+  "Get the value of the parameter PARAM for CLASS, or nil if none."
+  (cadr (member param (mmm-get-class-spec class))))
+
+(defun mmm-set-class-parameter (class param value)
+  "Set the value of the parameter PARAM for CLASS to VALUE.
+Creates a new parameter if one is not present."
+  (let* ((spec (mmm-get-class-spec class))
+         (current (member param spec)))
+    (if current
+        (setcar (cdr current) value)
+      (nconc spec (list param value)))))
+
+;;}}}
 ;;{{{ Apply Classes
 
 (defun* mmm-apply-class
@@ -108,7 +124,7 @@ error once all classes have been applied."
            (beg-sticky (not (number-or-marker-p front)))
            (end-sticky (not (number-or-marker-p back)))
            (front-offset 0) (back-offset 0) front-verify back-verify
-           front-form back-form
+           front-form back-form creation-hook
            &allow-other-keys)
   "Create submode regions from START to STOP according to arguments.
 If CLASSES is supplied, it must be a list of valid CLASSes. Otherwise,
@@ -139,7 +155,8 @@ the rest of the arguments are for an actual class being 
applied. See
            (condition-case nil
                (mmm-make-region submode beg end :face face
                  :front front-form :back back-form
-                 :beg-sticky beg-sticky :end-sticky end-sticky)
+                 :beg-sticky beg-sticky :end-sticky end-sticky
+                 :creation-hook creation-hook)
              ;; If our region is invalid, go back to the end of the front
              ;; match and continue on.
              (mmm-invalid-parent (goto-char (- beg front-offset)))))))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]