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

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

Re: Adjusting string font-locking to not span multiple lines


From: David Hansen
Subject: Re: Adjusting string font-locking to not span multiple lines
Date: Fri, 16 May 2008 17:03:19 +0200
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.60 (gnu/linux)

On Fri, 16 May 2008 06:39:22 -0700 (PDT) Nordlöw wrote:

> On 16 Maj, 13:09, David Hansen <david.han...@gmx.net> wrote:
>> On Fri, 16 May 2008 03:35:48 -0700 (PDT) Nordlöw wrote:
>>
>> > I would like to override the behaviour for string highlighting in
>> > lines such as the following.
>>
>> > 0  string  \xad6" AMGC archive data
>>
>> > such that the the whole pattern
>> >                    \xad6"
>> > is highlighted in the font-lock-constant-face
>>
>> If double quotes aren't used as string delimiters at all, just change
>> the syntax of the double quote character.  Otherwise you have to use
>> font-lock-syntactic-keywords to overwrite the syntax-table.
>
> How do I "just change the syntax of the double quote character"?

This is a very good tutorial on writing an emacs major mode.  Check the
paragraph "Syntax table modifications":

http://two-wugs.net/emacs/mode-tutorial.html

Note that modifying the syntax-table also affects other parts of emacs
behavior (e.g. forward/backward-sexp).  But from above example this is
probably what you want.

David





reply via email to

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