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

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

[elpa] master 216c602 046/433: Fixed bug saving variables when creating


From: Dmitry Gutov
Subject: [elpa] master 216c602 046/433: Fixed bug saving variables when creating regions; need to set them first.
Date: Thu, 15 Mar 2018 19:43:32 -0400 (EDT)

branch: master
commit 216c6026a39dedc3a66313ea3bb20b7288b723f5
Author: mas <mas>
Commit: mas <mas>

    Fixed bug saving variables when creating regions; need to set them first.
---
 mmm-region.el | 24 ++++++++++++++----------
 1 file changed, 14 insertions(+), 10 deletions(-)

diff --git a/mmm-region.el b/mmm-region.el
index e304dbd..cbc29d7 100644
--- a/mmm-region.el
+++ b/mmm-region.el
@@ -3,7 +3,7 @@
 ;; Copyright (C) 2000 by Michael Abraham Shulman
 
 ;; Author: Michael Abraham Shulman <address@hidden>
-;; Version: $Id: mmm-region.el,v 1.10 2000/06/27 02:47:32 mas Exp $
+;; Version: $Id: mmm-region.el,v 1.11 2000/06/27 03:25:20 mas Exp $
 
 ;;{{{ GPL
 
@@ -58,7 +58,8 @@ i.e. whether text inserted at the marker should be inside the 
region."
 (defun* mmm-make-region
     (submode beg end &rest rest &key (front "") (back "")
              (beg-sticky t) (end-sticky t) face creation-hook
-             &allow-other-keys)
+             ;&allow-other-keys
+             )
   "Make a submode region from BEG to END of SUBMODE in FACE.
 FACE defaults to `mmm-default-submode-face'.  FRONT and BACK are
 regexps or functions to match the correct delimiters--see
@@ -96,13 +97,15 @@ arguments are stored as properties of the overlay, 
un-keyword-ified."
               (,mmm-evaporate-property t)
               (face ,(or face (if submode 'mmm-default-submode-face)))
               ))
-    (when submode
-      (save-excursion
-        (goto-char (overlay-start ovl))
-        (mmm-run-submode-hook submode)
-        (when creation-hook
-          (funcall creation-hook))
-        (mmm-save-changed-local-variables ovl submode)))
+    (save-excursion
+      (goto-char (overlay-start ovl))
+      (mmm-set-local-variables submode)
+      (mmm-run-submode-hook submode)
+      (when creation-hook
+        (funcall creation-hook))
+      (mmm-save-changed-local-variables ovl submode))
+    (setq mmm-previous-submode submode
+          mmm-previous-overlay ovl)
     (mmm-update-current-submode)
     ovl))
 
@@ -497,7 +500,8 @@ Looks up both global, buffer, and region saves."
   "Save by-buffer and by-region variables for OVL and MODE.
 Called when we move to a new submode region, with OVL and MODE the
 region and mode for the previous position."
-  (let ((buffer-vars (cdr (assq mode mmm-buffer-saved-locals)))
+  (let ((buffer-vars (cdr (assq (or mode major-mode)
+                                mmm-buffer-saved-locals)))
         (region-vars (if ovl
                          (overlay-get ovl 'mmm-local-variables)
                        mmm-region-saved-locals-for-dominant))



reply via email to

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