LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > General
User Name
Password
General This forum is for non-technical general discussion which can include both Linux and non-Linux topics. Have fun!

Notices


Reply
  Search this Thread
Old 12-02-2010, 10:51 AM   #1
jnojr
Member
 
Registered: Sep 2007
Location: Chandler, AZ
Posts: 227

Rep: Reputation: 20
Enable color coding in Emacs?


I want to get Emacs (GNU Emacs 23.2 for Windows, to be precise, but I'm hoping it'd be the same answer for Linux!) to display colors. Googling turns up a lot of responses that see to involve writing code, downloading stuff from strange websites, etc. Maybe I'm searching for the wrong thing / don't know the correct term.
 
Old 12-02-2010, 11:10 AM   #2
mlangdn
Senior Member
 
Registered: Mar 2005
Location: Kentucky
Distribution: Slackware64-current
Posts: 1,844

Rep: Reputation: 452Reputation: 452Reputation: 452Reputation: 452Reputation: 452
See if this site helps:

http://geosoft.no/development/emacs.html

It has tips for Windows and unix-like systems.
 
Old 12-02-2010, 11:15 AM   #3
Bertical
Member
 
Registered: Oct 2008
Location: Kingdom of Mercia
Distribution: Slackware
Posts: 83

Rep: Reputation: 14
You need this in your .emacs config file
Code:
(setq global-font-lock-mode t)
(setq font-lock-maximum-decoration t)

Last edited by Bertical; 12-02-2010 at 11:15 AM. Reason: comfig :D
 
Old 12-02-2010, 11:36 AM   #4
jnojr
Member
 
Registered: Sep 2007
Location: Chandler, AZ
Posts: 227

Original Poster
Rep: Reputation: 20
Quote:
Originally Posted by Bertical View Post
You need this in your .emacs config file
Code:
(setq global-font-lock-mode t)
(setq font-lock-maximum-decoration t)
That didn't work.

FWIW... %HOME% is H: My .emacs file is in H:\ and contains nothing but the above two lines. Emacs is able to create .emacs.d/ in H:\

What am I missing?

Thanks.
 
Old 12-02-2010, 12:33 PM   #5
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,780

Rep: Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081
I just downloaded Emacs 23.2 (for Windows) and colours are on by default. Where did get your copy, and how are you running it?

Last edited by ntubski; 12-02-2010 at 12:33 PM. Reason: add (for Windows)
 
Old 12-02-2010, 12:51 PM   #6
jnojr
Member
 
Registered: Sep 2007
Location: Chandler, AZ
Posts: 227

Original Poster
Rep: Reputation: 20
Quote:
Originally Posted by ntubski View Post
I just downloaded Emacs 23.2 (for Windows) and colours are on by default. Where did get your copy, and how are you running it?
I downloaded it from GNU and ran it. Since there's no install, no DLLs, no registry settings... I don't see how I could have screwed anything up. But it does not show colors. Text is all dark on a white background.
 
Old 12-02-2010, 01:04 PM   #7
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,780

Rep: Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081
Do you not see something like http://www.gnu.org/software/emacs/to...ges/splash.png when you open Emacs?
 
Old 12-02-2010, 01:14 PM   #8
jnojr
Member
 
Registered: Sep 2007
Location: Chandler, AZ
Posts: 227

Original Poster
Rep: Reputation: 20
Quote:
Originally Posted by ntubski View Post
Do you not see something like http://www.gnu.org/software/emacs/to...ges/splash.png when you open Emacs?
That's exactly what I see. I then open a file... and see no colors.
 
Old 12-02-2010, 01:23 PM   #9
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,780

Rep: Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081
Emacs chooses syntax colouring based on the filename extension, so what is the extension of the file you opened?
 
Old 12-02-2010, 01:29 PM   #10
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
This site's good for everything to do with Emacs:
http://www.emacswiki.org/

There's a few available for Windows, but I think the ntemacs (CVS) is the best:
http://www.emacswiki.org/emacs/CategoryWThirtyTwo
 
Old 12-02-2010, 02:06 PM   #11
jnojr
Member
 
Registered: Sep 2007
Location: Chandler, AZ
Posts: 227

Original Poster
Rep: Reputation: 20
Quote:
Originally Posted by ntubski View Post
Emacs chooses syntax colouring based on the filename extension, so what is the extension of the file you opened?
Ahh, now that's useful to know!

At the moment, a .VBS (VBScript) I believe we also want a .BAT (perl script) to be in color, too. Preferably, any script.
 
Old 12-03-2010, 07:30 AM   #12
jnojr
Member
 
Registered: Sep 2007
Location: Chandler, AZ
Posts: 227

Original Poster
Rep: Reputation: 20
How do I get Emacs to recognize .VBS files as something that should be color-coded?
 
Old 12-03-2010, 07:33 AM   #13
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,836
Blog Entries: 1

Rep: Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251
This might be helpful.
http://www.emacswiki.org/emacs/ColorTheme

It's a set of colour themes for emacs.
 
Old 12-03-2010, 07:35 AM   #14
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,836
Blog Entries: 1

Rep: Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251
Quote:
Originally Posted by jnojr View Post
How do I get Emacs to recognize .VBS files as something that should be color-coded?
You need to install this extension:
http://xahlee.org/visual_basic/emacs...asic_mode.html
 
Old 12-03-2010, 09:42 AM   #15
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,780

Rep: Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081
Quote:
Originally Posted by jnojr View Post
Ahh, now that's useful to know!

At the moment, a .VBS (VBScript)
Emacs doesn't know about VBScript out of the box, so you will need to download to get that. See VisualBasicMode.

Quote:
I believe we also want a .BAT (perl script) to be in color, too. Preferably, any script.
Is that a DOS batch script or a perl script? Emacs comes with a perl-mode but it's associated with .pl, .pm or .perl files by default, if your .bat files are perl scripts (kind of strange) you should add this to your .emacs file:
Code:
(add-to-list 'auto-mode-alist '("\\.bat" . perl-mode))
Or use .pl as your file extension.
 
  


Reply

Tags
emacs, visual basic



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
vi or vim doesn't have color coding (highlighting) for c?? knockout_artist Linux - Newbie 4 02-06-2008 08:36 PM
Yast/You Color coding linda SUSE / openSUSE 1 08-22-2005 06:07 PM
Emacs module for better perl coding rose_bud4201 Linux - Software 3 04-27-2005 02:39 PM
vim php color coding? Longinus Linux - Software 4 04-11-2004 05:56 AM
Shell and file/directory color coding? l0f33t Linux - General 9 08-07-2003 10:19 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > General

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

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