LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   emacs: minor mode font-mode-lock not on by default?! (http://www.linuxquestions.org/questions/linux-newbie-8/emacs-minor-mode-font-mode-lock-not-on-by-default-813234/)

hewsonism 06-09-2010 05: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
Code:

(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
Code:

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 --
Code:

(modify-frame-parameters nil '((wait-for-wm . nil)))
;;(require 'color-theme)
;;(color-theme-arjen)
(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 11:37 AM

Try
Code:

(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
Code:

font-lock-mode
(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 01:32 PM

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


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