summaryrefslogtreecommitdiff
path: root/lisp/font-core.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2002-09-09 23:22:49 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2002-09-09 23:22:49 +0000
commit40e2bbe904fe004d0ff6e6239ece8a4f568688db (patch)
treeaa5cdfad5ae44f90783dcfe84e92c628e9171062 /lisp/font-core.el
parent08be15d860a2ca6da0275f0ff2b3ee12218542ed (diff)
downloademacs-40e2bbe904fe004d0ff6e6239ece8a4f568688db.tar.gz
(font-lock-change-mode): Just turn off font-lock-mode.
(font-lock-default-function): Change arg name.
Diffstat (limited to 'lisp/font-core.el')
-rw-r--r--lisp/font-core.el25
1 files changed, 5 insertions, 20 deletions
diff --git a/lisp/font-core.el b/lisp/font-core.el
index e394be7dba2..39d8daad1ec 100644
--- a/lisp/font-core.el
+++ b/lisp/font-core.el
@@ -218,26 +218,11 @@ your own function which is called when `font-lock-mode' is toggled via
;; Get rid of fontification for the old major mode.
;; We do this when changing major modes.
(defun font-lock-change-mode ()
- (let ((inhibit-read-only t)
- (inhibit-point-motion-hooks t)
- (inhibit-modification-hooks t)
- (deactivate-mark nil)
- (buffer-file-name nil)
- (buffer-file-truename nil)
- (buffer-undo-list t)
- (modified (buffer-modified-p)))
- (save-restriction
- (widen)
- (remove-list-of-text-properties
- (point-min) (point-max) '(font-lock-face)))
- (unless modified
- (restore-buffer-modified-p nil)))
- (when font-lock-defaults
- (font-lock-unfontify-buffer)))
-
-(defun font-lock-default-function (font-lock-mode)
+ (font-lock-mode -1))
+
+(defun font-lock-default-function (mode)
;; Turn on Font Lock mode.
- (when font-lock-mode
+ (when mode
(font-lock-set-defaults)
(set (make-local-variable 'char-property-alias-alist)
(copy-tree char-property-alias-alist))
@@ -262,7 +247,7 @@ your own function which is called when `font-lock-mode' is toggled via
(message "Fontifying %s...buffer size greater than font-lock-maximum-size"
(buffer-name)))))))
;; Turn off Font Lock mode.
- (unless font-lock-mode
+ (unless mode
;; Remove `font-lock-face' as an alias for the `face' property.
(set (make-local-variable 'char-property-alias-alist)
(copy-tree char-property-alias-alist))