Makefile syntax coloring

363 views
Skip to first unread message

elklein

unread,
Feb 9, 2009, 12:01:29 PM2/9/09
to BBEdit Talk
Hey all,

I've been wondering a few things related to makefiles:
1) Has anyone coded up a codeless language module for Makefiles
2) Is there a way to do language matching (for the language modules) w/
o a suffix? I know that the docs say there is a way to do it based on
the content, but I'm not sure that's possible for codeless modules.
Any thoughts? (I know there is some sort of tag thing you can do in
comments that XCode recognizes).

I ask because I wind up doing a lot of editing of makefiles, and
syntax coloring would be REALLY nice. Furthermore, my makefiles are
mostly (95%+) named just "Makefile", so I'm not sure if suffix
matching would work (unless I can consider the entire name of
"Makefile" a suffix).

Even more important than syntax coloring, I normally set the tab key
to insert spaces, but in makefiles, I need to have the tab key insert
tabs, so I would need BBEdit to be able to know the difference.

I'm going to try coding up my own codeless LM, but before I do, I was
hoping that someone else out there already had some experience w/
this.

Thanks!

Dennis

unread,
Feb 9, 2009, 12:52:18 PM2/9/09
to bbe...@googlegroups.com
On Feb 9, 2009, at 9:01 AM, elklein wrote:

> 2) Is there a way to do language matching (for the language modules)
> w/
> o a suffix? I know that the docs say there is a way to do it based on
> the content, but I'm not sure that's possible for codeless modules.
> Any thoughts? (I know there is some sort of tag thing you can do in
> comments that XCode recognizes).

There might be better ways to do this in your CLM (there are none that
I know of). But one solution is to simply turn on the Preferences ->
Text Files -> "Honor saved state:" -> "Emacs local variables" setting.
And then add this line to the top of your various makefiles:

-*- mode: name-of-source-language -*-

Where "name-of-source-language" is the name of your CLM as it appears
in BBEdit's Installed Languages list (Preferences -> Languages ->
Installed Languages) but in all lower case and spaces substituted with
dashes.

You can read a bit more about BBEdit's support for Emacs local
variables in the User Manual on page 227.

-Dennis

Reply all
Reply to author
Forward
0 new messages