comparison lisp/startup.el @ 2756:f441e940eed8

[xemacs-hg @ 2005-05-05 16:55:39 by aidan] Make *scratch* honour user's font lock settings.
author aidan
date Thu, 05 May 2005 16:55:41 +0000
parents 96036853a107
children 316fddbf58e2
comparison
equal deleted inserted replaced
2755:84e58d54ba89 2756:f441e940eed8
753 (with-current-buffer (get-buffer "*scratch*") 753 (with-current-buffer (get-buffer "*scratch*")
754 (erase-buffer) 754 (erase-buffer)
755 ;; (insert initial-scratch-message) 755 ;; (insert initial-scratch-message)
756 (set-buffer-modified-p nil) 756 (set-buffer-modified-p nil)
757 (when (eq major-mode 'fundamental-mode) 757 (when (eq major-mode 'fundamental-mode)
758 (funcall initial-major-mode))) 758 (funcall initial-major-mode))
759 ;; The docstring for font-lock-set-defaults says that major modes that
760 ;; have any font-lock defaults specified should call the function
761 ;; after initialising the `major-mode' variable. None of them do,
762 ;; however, and any font locking that is ever put in place is done as
763 ;; a result of `font-lock-set-defaults' being in find-file-hook and
764 ;; various other places. We could make *scratch* honour the user's
765 ;; choice of whether font-locking is in place by adding a call to
766 ;; font-lock-set-defaults in `lisp-interaction-mode'; but that'll
767 ;; break if `intial-major-mode' is anything else.
768 ;;
769 ;; So, despite what `font-lock-set-defaults'' docstring says, this
770 ;; *is* where we should call it to have the user's choice of font-lock
771 ;; level take effect in *scratch*. If the modes are rewritten to do
772 ;; the right then, we're okay too, the function is idempotent.
773 (font-lock-set-defaults))
759 774
760 ;; Load library for our terminal type. 775 ;; Load library for our terminal type.
761 ;; User init file can set term-file-prefix to nil to prevent this. 776 ;; User init file can set term-file-prefix to nil to prevent this.
762 ;; Note that for any TTY's opened subsequently, the TTY init 777 ;; Note that for any TTY's opened subsequently, the TTY init
763 ;; code will run this. 778 ;; code will run this.