help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: .emacs poser


From: Emanuel Berg
Subject: Re: .emacs poser
Date: Wed, 18 Dec 2013 22:23:48 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Yuri Khan <yuri.v.khan@gmail.com> writes:

> Writing keywords in all caps used to be popular in
> case-insensitive languages until syntax highlighting
> editors became the norm. Nowadays, it’s not quite as
> frequent.

Is the preprocessor in C case-*in*sensitive? Because C
isn't.

> If/when there comes a day when most editors (IDEs?)
> can reliably detect preprocessor macros and highlight
> them with a dangerous-looking shade of red, the
> all-caps convention for #defines can also be dropped.

This sounds like something that would be possible to do
with Emacs today. As for the definitions, that would be
a regular expression (very easy). But how to make it
consistent in the rest of the buffer (i.e., where the
constant is used), I don't know.

In c-mode:

#ifndef DEF_H
#define FINGERS 10

The faces are:

#ifndef, #define: font-lock-preprocessor-face
FINGERS: font-lock-variable-name-face

-- 
Emanuel Berg, programmer-for-rent. CV, projects, etc at uXu
underground experts united:  http://user.it.uu.se/~embe8573


reply via email to

[Prev in Thread] Current Thread [Next in Thread]