[plug] global-font-lock-mode not activating colourisation when executed from .emacs

David Buddrige dbuddrige at wasp.net.au
Tue Feb 1 17:14:19 WST 2005


Hi all, 

I am currently writing a perl program.  I am using the one-true-editor 
"emacs" to do this. ;-) 

I like to have my source code colourised for ease of reading, so after 
loading my perl file, I do an "alt-x", to allow me to execute a command, and 
then run the command: 

global-font-lock-mode 

which turns on the font-lock-mode, and nicely colours my source-code. 

However, being a lazy sort, I really would prefer it if emacs would activate 
this feature for me, rather than my having to type it every time I load my 
perl source code, so I edited my .emacs file, and added the line: 

(setq global-font-lock-mode t) 

I then exited emacs, and opened up a source file, by typing: 

emacs mysource.pl 

Emacs then loads the source file, but to my irritation, the source code is 
all a single colour. 

However if I do an "alt-x", to allow me to execute a command, and then run 
the command: 

global-font-lock-mode 

A message is displayed saying 

"Global font lock mode disabled". 

Repeating the process, by pressing "alt-x" and then the command 
"global-font-lock-mode" then re-activates the global font lock mode and 
colourises my source code. 

This tells me that emacs had infact activated the global-font-lock-mode as 
per my instructions in the .emacs file, but had failed to apply the 
colourisation. 

Can anyone tell me why colourisation is activated if I perform the command 
"global-font-lock-mode" manually, but not when it is activated via my .emacs 
file? 

thanks heaps guys 

David. 



More information about the plug mailing list