[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 54396d3 036/433: Added setting and clearing local variable
From: |
Dmitry Gutov |
Subject: |
[elpa] master 54396d3 036/433: Added setting and clearing local variables with mode on and off. |
Date: |
Thu, 15 Mar 2018 19:43:30 -0400 (EDT) |
branch: master
commit 54396d3f2b550cd2ae1c1241a847a3cc05dd6bcb
Author: mas <mas>
Commit: mas <mas>
Added setting and clearing local variables with mode on and off.
---
mmm-mode.el | 32 +++++++++++++++++++-------------
1 file changed, 19 insertions(+), 13 deletions(-)
diff --git a/mmm-mode.el b/mmm-mode.el
index e9dbd9c..5368198 100644
--- a/mmm-mode.el
+++ b/mmm-mode.el
@@ -3,7 +3,7 @@
;; Copyright (C) 1999 by Michael Abraham Shulman
;; Author: Michael Abraham Shulman <address@hidden>
-;; Version: $Id: mmm-mode.el,v 1.4 2000/05/18 18:29:37 mas Exp $
+;; Version: $Id: mmm-mode.el,v 1.5 2000/06/26 22:20:48 mas Exp $
;; Keywords: convenience faces languages tools
;;{{{ GPL
@@ -85,7 +85,7 @@
(require 'cl)
;; If we don't load font-lock now, but it is loaded later, the
-;; necessary mmm-font-lock- properties may not be there.
+;; necessary mmm-font-lock-* properties may not be there.
(require 'font-lock)
(require 'mmm-compat)
(require 'mmm-utils)
@@ -283,10 +283,10 @@ with the variables `mmm-default-submode-face',
`mmm-mode-string', and
`mmm-submode-mode-line-format', which see for further information.
The variable `mmm-save-local-variables' controls what buffer-local
-variables are saved for submodes. This is how comments are handled,
-for instance. You can add variable names to this list. Often something
-that seems like a problem with MMM Mode can be solved by simply saving
-an extra variable.
+variables are saved for submodes. This is how comments are handled,
+for instance. You can add variable names to this list--see its
+documentation for details. Often something that seems like a problem
+with MMM Mode can be solved by simply saving an extra variable.
When entering MMM Mode, the hook `mmm-mode-hook' is run. A hook named
<major-mode>-mmm-hook is also run, if it exists. For example,
@@ -313,12 +313,19 @@ Programming | Tools | Mmm, except the major mode and
submode hooks
"Turn on MMM Mode. See `mmm-mode'."
(interactive)
;; This function is called from mode hooks, so we need to make sure
- ;; we're not in a temporary buffer. We don't need to worry about
+ ;; we're not in a temporary buffer. We don't need to worry about
;; recursively ending up in ourself, however, since by that time the
;; variable `mmm-mode' will already be set.
(mmm-valid-buffer
(unless mmm-mode
(mmm-update-mode-info major-mode)
+ (setq mmm-region-saved-locals-for-dominant
+ (list* (list 'font-lock-cache-state nil)
+ (list 'font-lock-cache-position (make-marker))
+ (copy-tree (cdr (assq major-mode
mmm-region-saved-locals-defaults)))))
+ ;; Without the next line, the (make-marker) above gets replaced
+ ;; with the starting value of nil, and all comes to naught.
+ (mmm-set-local-variables major-mode)
(mmm-add-hooks)
(mmm-fixup-skeleton)
(when (featurep 'font-lock)
@@ -335,6 +342,7 @@ Programming | Tools | Mmm, except the major mode and
submode hooks
;; turned on. Should we delete all previously made submode
;; regions when we find an invalid one?
(message "%s" (error-message-string err))))
+ (mmm-update-current-submode)
(run-hooks 'mmm-mode-hook)
(mmm-run-major-hook))))
@@ -349,13 +357,11 @@ Programming | Tools | Mmm, except the major mode and
submode hooks
(mmm-clear-overlays)
(mmm-clear-history)
(mmm-clear-mode-ext-classes)
+ (mmm-clear-local-variables)
(mmm-update-submode-region)
- (when (boundp 'font-lock-mode)
- (setq font-lock-fontify-region-function
- (get major-mode 'mmm-fontify-region-function)
- font-lock-beginning-of-syntax-function
- (get major-mode 'mmm-beginning-of-syntax-function))
- (if font-lock-mode (font-lock-fontify-buffer)))
+ (and (featurep 'font-lock)
+ font-lock-mode
+ (font-lock-fontify-buffer))
(setq mmm-mode nil)))
(add-to-list 'minor-mode-alist (list 'mmm-mode mmm-mode-string))
- [elpa] master fd76a7a 024/433: # Per-buffer local variable saving., (continued)
- [elpa] master fd76a7a 024/433: # Per-buffer local variable saving., Dmitry Gutov, 2018/03/15
- [elpa] master e1532c5 025/433: # Updated., Dmitry Gutov, 2018/03/15
- [elpa] master 2cecadb 030/433: Released 0.3.10., Dmitry Gutov, 2018/03/15
- [elpa] master 537d48a 029/433: # Added .tar.gz files., Dmitry Gutov, 2018/03/15
- [elpa] master 2055dc3 023/433: (use-local-map): Conditioned advice definition on not XEmacs., Dmitry Gutov, 2018/03/15
- [elpa] master 73a2b86 032/433: # Updated documentation strings., Dmitry Gutov, 2018/03/15
- [elpa] master 04e92ed 034/433: (mmm-save-local-variable): Added comment-line-start-skip for Fortran., Dmitry Gutov, 2018/03/15
- [elpa] master 1d1bd23 038/433: # Changed to use mmm-temp-buffer-name, Dmitry Gutov, 2018/03/15
- [elpa] master 0fbe87a 033/433: Added comment about (require 'mmm-mason)., Dmitry Gutov, 2018/03/15
- [elpa] master 5a34588 028/433: (mmm-overlays-in): Added checks for point-min and point-max for XEmacs., Dmitry Gutov, 2018/03/15
- [elpa] master 54396d3 036/433: Added setting and clearing local variables with mode on and off.,
Dmitry Gutov <=
- [elpa] master f4f6842 039/433: # Improved local variable setting, added some new ideas., Dmitry Gutov, 2018/03/15
- [elpa] master 988a3db 035/433: (mmm-save-local-variables): Added extra parameters for saving type and, Dmitry Gutov, 2018/03/15
- [elpa] master 3c44251 047/433: # Added comment about loading supplied classes separately., Dmitry Gutov, 2018/03/15
- [elpa] master faaf000 040/433: # Commented on local variable improvements and version numbers., Dmitry Gutov, 2018/03/15
- [elpa] master 85ced66 041/433: # Reformatting., Dmitry Gutov, 2018/03/15
- [elpa] master 216c602 046/433: Fixed bug saving variables when creating regions; need to set them first., Dmitry Gutov, 2018/03/15
- [elpa] master 854c8a1 049/433: # Updated., Dmitry Gutov, 2018/03/15
- [elpa] master fbf7da0 045/433: # Updated docstring, Dmitry Gutov, 2018/03/15
- [elpa] master c2f2ef7 050/433: # Changed version numbers, Dmitry Gutov, 2018/03/15
- [elpa] master c22fb9f 054/433: # Updated., Dmitry Gutov, 2018/03/15