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

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

Re: syntax highlighting on the fly


From: lee
Subject: Re: syntax highlighting on the fly
Date: Fri, 07 Mar 2014 14:17:58 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Jambunathan K <kjambunathan@gmail.com> writes:

> (info "(emacs) Font Lock")
>
> (info "(emacs) Highlight Interactively")
>
> Put your cursor after the closing ")" and do C-x C-e.  Hint: Search for
> FIXME in the first node.
>
> lee <lee@yun.yagibdah.de> writes:
>
>> Hi,
>>
>> is something available with emacs to do to syntax highlighting on the
>> fly?
>>
>> "On the fly" means: You have a mode with syntax highlighting which does
>> most of the highlighting.  Now you work on a file (source code for some
>> program) in a buffer with your mode enabled, and you decide that for
>> this particular file, you want "foobar" to be highlighted.
>>
>> You´d have to somehow tell emacs to do this, for example by adding a
>> comment like
>>
>>
>> // highlight: foobar
>>
>>
>> to your file.  You could also do it like
>>
>>
>> #define foobar 25
>>
>>
>> (since you´re using #define anyway) and have all occurances of "foobar"
>> highlighted.
>>
>> It´s probably possible to write something for this, and I wouldn´t even
>> know where to start.  Perhaps it´s already built in and I only don´t
>> know about it?

Thank you for the pointers!  Highlighting interactively (with
hi-lock-mode) is exactly what I´m looking for :)


-- 
Knowledge is volatile and fluid.  Software is power.



reply via email to

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