branch: master
commit 0da2ac99c5c1f585284f3984767b6f4014623898
Author: Dmitry Gutov <[email protected]>
Commit: Dmitry Gutov <[email protected]>

    * mmm-syntax-propertize-function: Don't pass nil to mmm-set-local-variables
    
    This is too similar to 61b9cf4.
---
 mmm-region.el | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/mmm-region.el b/mmm-region.el
index aa6728a..9113f14 100644
--- a/mmm-region.el
+++ b/mmm-region.el
@@ -602,6 +602,10 @@ Return \((VAR VALUE) ...).  In some cases, VAR will be of 
the form
   "Get the value of the local variable VAR saved for MODE and OVL, if any."
   (cadr (assq var (mmm-get-saved-local-variables ovl mode))))
 
+;; FIXME: It's too easy to accidentally pass nil as MODE here.
+;; We probably should call this from `mmm-set-current-pair', and not
+;; rely on its callers to default to the primary mode when appropriate.
+;; Also, incorporate the opmimization from `mmm-fontify-region-list'.
 (defun mmm-set-local-variables (mode ovl)
   "Set all the local variables saved for MODE and OVL.
 Looks up global, buffer and region saves.  When MODE is nil, just
@@ -818,7 +822,7 @@ of the REGIONS covers START to STOP."
                           (font-lock-fontify-syntactic-keywords-region beg 
end)))))))
               (mmm-regions-in start stop))
       (mmm-set-current-pair saved-mode saved-ovl)
-      (mmm-set-local-variables saved-mode saved-ovl))))
+      (mmm-set-local-variables (or saved-mode mmm-primary-mode) saved-ovl))))
 
 ;;}}}
 ;;{{{ Indentation

Reply via email to