aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2002-09-09 23:22:49 +0000
committerStefan Monnier2002-09-09 23:22:49 +0000
commit40e2bbe904fe004d0ff6e6239ece8a4f568688db (patch)
treeaa5cdfad5ae44f90783dcfe84e92c628e9171062
parent08be15d860a2ca6da0275f0ff2b3ee12218542ed (diff)
downloademacs-40e2bbe904fe004d0ff6e6239ece8a4f568688db.tar.gz
emacs-40e2bbe904fe004d0ff6e6239ece8a4f568688db.zip
(font-lock-change-mode): Just turn off font-lock-mode.
(font-lock-default-function): Change arg name.
-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
218;; Get rid of fontification for the old major mode. 218;; Get rid of fontification for the old major mode.
219;; We do this when changing major modes. 219;; We do this when changing major modes.
220(defun font-lock-change-mode () 220(defun font-lock-change-mode ()
221 (let ((inhibit-read-only t) 221 (font-lock-mode -1))
222 (inhibit-point-motion-hooks t) 222
223 (inhibit-modification-hooks t) 223(defun font-lock-default-function (mode)
224 (deactivate-mark nil)
225 (buffer-file-name nil)
226 (buffer-file-truename nil)
227 (buffer-undo-list t)
228 (modified (buffer-modified-p)))
229 (save-restriction
230 (widen)
231 (remove-list-of-text-properties
232 (point-min) (point-max) '(font-lock-face)))
233 (unless modified
234 (restore-buffer-modified-p nil)))
235 (when font-lock-defaults
236 (font-lock-unfontify-buffer)))
237
238(defun font-lock-default-function (font-lock-mode)
239 ;; Turn on Font Lock mode. 224 ;; Turn on Font Lock mode.
240 (when font-lock-mode 225 (when mode
241 (font-lock-set-defaults) 226 (font-lock-set-defaults)
242 (set (make-local-variable 'char-property-alias-alist) 227 (set (make-local-variable 'char-property-alias-alist)
243 (copy-tree char-property-alias-alist)) 228 (copy-tree char-property-alias-alist))
@@ -262,7 +247,7 @@ your own function which is called when `font-lock-mode' is toggled via
262 (message "Fontifying %s...buffer size greater than font-lock-maximum-size" 247 (message "Fontifying %s...buffer size greater than font-lock-maximum-size"
263 (buffer-name))))))) 248 (buffer-name)))))))
264 ;; Turn off Font Lock mode. 249 ;; Turn off Font Lock mode.
265 (unless font-lock-mode 250 (unless mode
266 ;; Remove `font-lock-face' as an alias for the `face' property. 251 ;; Remove `font-lock-face' as an alias for the `face' property.
267 (set (make-local-variable 'char-property-alias-alist) 252 (set (make-local-variable 'char-property-alias-alist)
268 (copy-tree char-property-alias-alist)) 253 (copy-tree char-property-alias-alist))