LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices

Reply
 
Search this Thread
Old 06-09-2010, 05:53 PM   #1
hewsonism
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
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)
 
Old 06-10-2010, 11:37 AM   #2
rikijpn
Member
 
Registered: Jun 2007
Location: Japan
Distribution: Debian lenny, DSL, Solaris 10
Posts: 157

Rep: Reputation: 33
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).
 
Old 06-10-2010, 01:32 PM   #3
hewsonism
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!
 
  


Reply


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 - changing default font size and font type? neilcpp Linux - Software 16 05-20-2013 11:29 AM
Automatic hs-minor-mode in Emacs for PHP mode? CoderMan Programming 1 06-12-2009 09:38 AM
Emacs: Enable minor mode in all buffers nb85 Programming 2 04-13-2009 03:56 PM
default font for text-mode artificialGekko Slackware 9 03-19-2005 12:55 AM
emacs: continuous newline (minor mode?) tek1024 Linux - Software 1 08-11-2004 02:09 PM


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

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