Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 06-09-2010, 06:53 PM   #1
LQ Newbie
Registered: Dec 2003
Location: San Jose, CA
Distribution: Fedora
Posts: 10

Rep: Reputation: 0
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)
Old 06-10-2010, 12:37 PM   #2
Registered: Jun 2007
Location: Japan
Distribution: Debian lenny, DSL, Solaris 10
Posts: 157

Rep: Reputation: 33
(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).
Old 06-10-2010, 02:32 PM   #3
LQ Newbie
Registered: Dec 2003
Location: San Jose, CA
Distribution: Fedora
Posts: 10

Original Poster
Rep: Reputation: 0
w00t! yes global-font-lock-mode, not font-lock-mode. Thanks!


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Emacs: Enable minor mode in all buffers nb85 Programming 4 12-18-2014 11:32 AM
Emacs - changing default font size and font type? neilcpp Linux - Software 16 05-20-2013 12:29 PM
Automatic hs-minor-mode in Emacs for PHP mode? CoderMan Programming 1 06-12-2009 10:38 AM
default font for text-mode artificialGekko Slackware 9 03-19-2005 01:55 AM
emacs: continuous newline (minor mode?) tek1024 Linux - Software 1 08-11-2004 03:09 PM

All times are GMT -5. The time now is 09:09 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration