-   Linux - Newbie (
-   -   emacs: minor mode font-mode-lock not on by default?! (

hewsonism 06-09-2010 06:53 PM

emacs: minor mode font-mode-lock not on by default?!
Hi all,

I'm very new to emacs. I'd like to have syntax highlighting. This seems to be related to the minor mode font-mode-lock. The emacs manual says its on by default. I've also added

(font-lock-mode 1)
to my ~/.emacs file, yet there is no syntax highlighting when i open files in emacs. If, after opening a file, i do

M-x font-lock-mode
then I get syntax highlighting.

Perhaps some thing else i'm loading is turning this off? Not sure.

my ~/.emacs --

(modify-frame-parameters nil '((wait-for-wm . nil)))
;;(require 'color-theme)
(add-to-list 'auto-mode-alist '("\\.js\\'" . javascript-mode))
(autoload 'javascript-mode "javascript" nil t)
(set-default-font "-adobe-courier-medium-r-normal--18-180-75-75-m-110-iso8859-1")
(font-lock-mode 1)

rikijpn 06-10-2010 12:37 PM


(global-font-lock-mode 1)
I think it depends on the version of emacs you're running too. Old versions weren't on by default +distro settings.
If the above doesn't work, you can check font-lock-mode's status by evaluating

(type that in a new line inside any buffer, and press C-x C-e before the line break)
It should return either "t" (as in true) or nil (false).

hewsonism 06-10-2010 02:32 PM

w00t! yes global-font-lock-mode, not font-lock-mode. Thanks!

All times are GMT -5. The time now is 01:20 PM.