[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 988a3db 035/433: (mmm-save-local-variables): Added extra p
From: |
Dmitry Gutov |
Subject: |
[elpa] master 988a3db 035/433: (mmm-save-local-variables): Added extra parameters for saving type and |
Date: |
Thu, 15 Mar 2018 19:43:30 -0400 (EDT) |
branch: master
commit 988a3db3b6c1798efb57145cba29b7ec5f1ce593
Author: mas <mas>
Commit: mas <mas>
(mmm-save-local-variables): Added extra parameters for saving type and
modes, and updated documentation.
Created several variables to save buffer- and region- locals.
(mmm-temp-buffer-name): Created variable and changed references.
---
mmm-vars.el | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-------
1 file changed, 70 insertions(+), 8 deletions(-)
diff --git a/mmm-vars.el b/mmm-vars.el
index 08da3c5..1e2b370 100644
--- a/mmm-vars.el
+++ b/mmm-vars.el
@@ -3,7 +3,7 @@
;; Copyright (C) 2000 by Michael Abraham Shulman
;; Author: Michael Abraham Shulman <address@hidden>
-;; Version: $Id: mmm-vars.el,v 1.6 2000/06/23 22:58:54 mas Exp $
+;; Version: $Id: mmm-vars.el,v 1.7 2000/06/26 22:19:40 mas Exp $
;;{{{ GPL
@@ -80,11 +80,13 @@
;;{{{ Save Local Variables
(defcustom mmm-save-local-variables
- '(comment-start
+ '(
+ mode-name
+ comment-start
comment-end
- comment-line-start-skip ; For fortran-mode
+ (comment-line-start-skip buffer (fortran-mode))
comment-start-skip
- comment-column
+ (comment-column buffer)
comment-indent-function
comment-line-break-function
sentence-end
@@ -92,16 +94,70 @@
font-lock-keywords-only
font-lock-keywords-case-fold-search
font-lock-syntax-table
- font-lock-mark-block-function ; Replace this?
+ font-lock-mark-block-function ; Override this?
font-lock-syntactic-keywords
+ ;; Don't use `function' (#') here!! We're already inside `quote'!
+ (font-lock-mode nil (lambda () (featurep 'font-lock)))
indent-line-function
- skeleton-transformation)
- "Which local variables to save for secondary major modes.
+ (c-basic-offset buffer (cc-mode))
+ skeleton-transformation
+ ((syntax-table . set-syntax-table))
+ ((current-local-map . use-local-map) buffer)
+ )
+ "Which local variables to save for major mode regions.
+Each element has the form \(VARIABLE [TYPE [MODES]]), causing VARIABLE
+to be saved for all major modes in the list MODES. If MODES is t or
+absent, the variable is saved for all major modes. MODES can also be
+a function of no arguments which returns non-nil whenever the variable
+should be saved.
+
+TYPE should be either the symbol `global', meaning to save the
+variable globally, the symbol `buffer', meaning to save it per buffer,
+or the symbol `region', meaning to save it for each submode region.
+If TYPE has any other value, such as nil, or is absent, the variable
+is saved globally. If all optional parameters are omitted, the
+element may be simply VARIABLE instead of \(VARIABLE).
+
+It is possible for VARIABLE to be not a symbol but a cons cell of the
+form \(GETTER . SETTER), thus specifying special functions to set and
+get the value of the \"variable\". This is used for objects like
+local maps, syntax tables, etc. which need to be installed in a
+special way. GETTER should be a function of no arguments, and SETTER
+a function of one. In this case, even if TYPE and MODES are omitted,
+the list cannot be flattened--it must be \((GETTER . SETTER)).
+\"Variables\" of this type cannot be seen with `mmm-get-saved-local'.
+
+A single variable may appear more than once in this list, with
+different modes and/or types. If the same mode appears more than once
+for the same variable with different types, the behavior is undefined.
Changing the value of this variable after MMM Mode has been activated
-in some buffer may produce unpredictable results."
+in some buffer may produce unpredictable results.
+
+Globally saved variables are saved in the mmm-local-variables property
+of the mode symbol. Buffer saved variables are saved in the alist
+`mmm-buffer-saved-locals'. Region saved variables are saved in the
+mmm-local-variables property of the overlay."
:group 'mmm
:type '(repeat (symbol :tag "Variable")))
+(defvar mmm-buffer-saved-locals ()
+ "Stores saved local variables for this buffer, by mode.
+Each element looks like \(MODE \(VAR VALUE) ...).")
+(make-variable-buffer-local 'mmm-buffer-saved-locals)
+
+(defvar mmm-region-saved-locals-defaults ()
+ "Stores saved defaults for region-saved locals, by mode.
+Each element looks like \(MODE \(VAR VALUE) ...). Used to initialize
+new submode regions.")
+(make-variable-buffer-local 'mmm-region-saved-locals-defaults)
+
+(defvar mmm-region-saved-locals-for-dominant ()
+ "Stores saved region locals for the dominant major mode.
+The dominant major mode is considered to be one region for purposes of
+saving region variables. Region-saved variables for submode regions
+are saved as overlay properties.")
+(make-variable-buffer-local 'mmm-region-saved-locals-for-dominant)
+
;;}}}
;;{{{ Default Submode Face
@@ -430,6 +486,12 @@ and the end of the back delimiter.")
(message "MMM Mode version %s by Michael Abraham Shulman" mmm-version))
;;}}}
+;;{{{ Temp Buffer Name
+
+(defvar mmm-temp-buffer-name " *mmm-temp*"
+ "Name for temporary buffers created by MMM Mode.")
+
+;;}}}
;;{{{ Interactive History
(defvar mmm-interactive-history nil
- [elpa] master 2cecadb 030/433: Released 0.3.10., (continued)
- [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, 2018/03/15
- [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 <=
- [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
- [elpa] master aedb013 060/433: # Updated comment about psgml., Dmitry Gutov, 2018/03/15
- [elpa] master 9afb287 043/433: Added mmm-[get, set]-class-parameters and creation-hook., Dmitry Gutov, 2018/03/15