LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 09-27-2009, 06:13 PM   #1
Fabio Paolini
Member
 
Registered: Dec 2008
Location: Brazil
Distribution: Slackware 12 Debian 5
Posts: 52

Rep: Reputation: 17
How to activate the emacs highlight mode for .conf files?


Hello, I use GNU Emacs 21.4.2 in SlackWare 12.0 and after some search I was able to activate the highligh mode for some languages: bash, latex, C and others (even the .emacs file comes with highlight mode). However some files like squid.conf, resolv.conf among others linux config files come with no color mode, although my Debian installation has color mode to these files, which shows that it is possible!

Someone knows what can be done to activate the color mode in these files?

Many thanks

Last edited by Fabio Paolini; 09-27-2009 at 09:50 PM. Reason: Just to make it clear that it is a question
 
Old 09-28-2009, 03:50 AM   #2
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware64 15; SlackwareARM-current (aarch64); Debian 12
Posts: 8,298
Blog Entries: 61

Rep: Reputation: Disabled
Put this in your .emacs file:
Code:
(require 'font-lock)
(global-font-lock-mode t)
See here for all sorts of information about emacs (customising,etc):

http://www.emacswiki.org/
 
Old 09-28-2009, 09:02 PM   #3
Fabio Paolini
Member
 
Registered: Dec 2008
Location: Brazil
Distribution: Slackware 12 Debian 5
Posts: 52

Original Poster
Rep: Reputation: 17
Thanks for your reply brianL, but even if I put this text in my .emacs file
the .conf files do not come with highlights. Many others kind of files come with colors, like /bin/sh, *.tex files, among others. I tried even to put just the lines you suggested (removing the others), but it does not work too.

I saw the link you have shown, but there is a lot of things there. If you could point a more specific address where it is shown how to edit the .emacs I would appreciate. I will keep reading that link any way.
 
Old 09-29-2009, 04:15 AM   #4
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware64 15; SlackwareARM-current (aarch64); Debian 12
Posts: 8,298
Blog Entries: 61

Rep: Reputation: Disabled
Here's the page regarding .emacs files, easy enough to find.
http://www.emacswiki.org/emacs/CategoryDotEmacs

I've opened several .conf and .cfg files in emacs, with the above lines in my .emacs file, and get syntax highlighting on them all.

Last edited by brianL; 09-29-2009 at 04:23 AM.
 
Old 09-30-2009, 10:41 AM   #5
Fabio Paolini
Member
 
Registered: Dec 2008
Location: Brazil
Distribution: Slackware 12 Debian 5
Posts: 52

Original Poster
Rep: Reputation: 17
Thanks, it is really easy to find, but I had not realized that dotemacs means .emacs.

About the highlights of .conf files, maybe there is some other problem in my emacs installation, some files missing for example.

Recently I found a way to add colors to the nano editor, where it is need to add some files in the /usr/share/nano directory. So I thought something like that may be lacking in my emacs, I don't know.

Last edited by Fabio Paolini; 09-30-2009 at 10:42 AM.
 
Old 09-30-2009, 11:34 AM   #6
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware64 15; SlackwareARM-current (aarch64); Debian 12
Posts: 8,298
Blog Entries: 61

Rep: Reputation: Disabled
Files like that, .emacs and .nanorc, are usually put in your home directory.
 
  


Reply



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
How do I activate limits.conf davidstvz Linux - Newbie 2 09-18-2009 12:46 PM
Automatic hs-minor-mode in Emacs for PHP mode? CoderMan Programming 1 06-12-2009 09:38 AM
getting emacs to highlight code willyweedle Linux - Newbie 1 03-30-2007 10:28 AM
Emacs Syntax highlight UltraSoul Linux - Software 1 07-11-2005 09:19 AM
how make emacs highlight ? black Linux - Software 2 09-29-2002 01:11 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

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

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration