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

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

[elpa] master 48e8e70 042/433: Fixed bug where font-lock-mode was set to


From: Dmitry Gutov
Subject: [elpa] master 48e8e70 042/433: Fixed bug where font-lock-mode was set to `t' globally, causing
Date: Thu, 15 Mar 2018 19:43:31 -0400 (EDT)

branch: master
commit 48e8e70d317ab9a47e0830b6d23ce7c852cf6c19
Author: mas <mas>
Commit: mas <mas>

    Fixed bug where font-lock-mode was set to `t' globally, causing
    global-font-lock-mode to turn it off.
---
 mmm-auto.el   |  5 ++++-
 mmm-region.el | 12 +++++++-----
 mmm-vars.el   |  6 ++----
 3 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/mmm-auto.el b/mmm-auto.el
index 0baa29a..a39f383 100644
--- a/mmm-auto.el
+++ b/mmm-auto.el
@@ -3,7 +3,7 @@
 ;; Copyright (C) 2000 by Michael Abraham Shulman
 
 ;; Author: Michael Abraham Shulman <address@hidden>
-;; Version: $Id: mmm-auto.el,v 1.5 2000/05/24 09:13:00 mas Exp $
+;; Version: $Id: mmm-auto.el,v 1.6 2000/06/27 00:35:02 mas Exp $
 
 ;;{{{ GPL
 
@@ -104,6 +104,9 @@ positive and off otherwise." t))
 (defun mmm-major-mode-change ()
   "Add mode hooks to turn MMM Mode on where appropriate.
 Actually adds `mmm-run-major-mode-hook' to all major mode hooks."
+  (and (boundp 'mmm-mode)
+       mmm-mode
+       (mmm-mode-off))
   (unless (window-minibuffer-p (selected-window))
     (loop for lookback from 4
           for frame = (backtrace-frame lookback)
diff --git a/mmm-region.el b/mmm-region.el
index 038e8fb..ab91fce 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.8 2000/06/26 22:22:43 mas Exp $
+;; Version: $Id: mmm-region.el,v 1.9 2000/06/27 00:35:02 mas Exp $
 
 ;;{{{ GPL
 
@@ -319,12 +319,14 @@ which is set here as well.  See 
`mmm-save-local-variables'."
                          (not (memq major-mode (cdr font-lock-global-modes)))
                        (memq major-mode font-lock-global-modes)))
                  ;; Don't actually fontify, but note that we should.
+                 (make-local-variable 'font-lock-mode)
                  (setq font-lock-mode t)))
           ;; Get the font-lock variables
           (font-lock-set-defaults)
           ;; These can't be in the local variables list, because we
           ;; replace their actual values, but we want to use their
           ;; original values elsewhere.
+          (put mode 'mmm-font-lock-mode font-lock-mode)
           (put mode 'mmm-fontify-region-function
                font-lock-fontify-region-function)
           (put mode 'mmm-beginning-of-syntax-function
@@ -393,7 +395,7 @@ different keymaps, syntax tables, local variables, etc. for 
submodes."
       (mmm-update-mode-info mode)
       (mmm-set-local-variables mode)
 ;       (and (featurep 'font-lock)
-;            (mmm-get-saved-local mode 'font-lock-mode)
+;            (get mode 'mmm-font-lock-mode)
 ;            (font-lock-mode 1))
       )
     (if mmm-current-submode
@@ -407,8 +409,8 @@ different keymaps, syntax tables, local variables, etc. for 
submodes."
     (force-mode-line-update)))
 
 (defun mmm-add-hooks ()
-  (make-local-hook 'change-major-mode-hook)
-  (add-hook 'change-major-mode-hook 'mmm-mode-off nil 'local)
+;  (make-local-hook 'change-major-mode-hook)
+;  (add-hook 'change-major-mode-hook 'mmm-mode-off nil 'local)
   (make-local-hook 'post-command-hook)
   (add-hook 'post-command-hook 'mmm-update-submode-region nil 'local))
 
@@ -567,7 +569,7 @@ of the REGIONS covers START to STOP."
   ;; I don't know why it does this, but let's undo it here.
   (let ((font-lock-beginning-of-syntax-function 'mmm-beginning-of-syntax))
     (mapcar #'(lambda (elt)
-                (when (mmm-get-saved-local (car elt) 'font-lock-mode)
+                (when (get (car elt) 'mmm-font-lock-mode)
                   (mmm-fontify-region-list (car elt) (cdr elt))))
             (mmm-regions-alist start stop)))
   (mmm-update-submode-region)
diff --git a/mmm-vars.el b/mmm-vars.el
index 1e2b370..eadd05d 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.7 2000/06/26 22:19:40 mas Exp $
+;; Version: $Id: mmm-vars.el,v 1.8 2000/06/27 00:35:02 mas Exp $
 
 ;;{{{ GPL
 
@@ -80,7 +80,7 @@
 ;;{{{ Save Local Variables
 
 (defcustom mmm-save-local-variables 
-  '(
+  '(;; Don't use `function' (#') here!!  We're already inside `quote'!
     mode-name
     comment-start 
     comment-end
@@ -96,8 +96,6 @@
     font-lock-syntax-table
     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
     (c-basic-offset buffer (cc-mode))
     skeleton-transformation



reply via email to

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