> Say I did:
>
> (define-generic-mode 'fnord-mode
>    nil
>    (list "fnord" "foobar")
>    nil
>    (list "\\.fnord")
>    (list 'turn-on-font-lock))
>
> This mode will then highlight the keywords fnord and foobar.
>
> However, it will also highlight _fnord, foobar_ and so on.
>
> I do not want the keyword to highlight if it has an
> underscore attached to it.
>
> How can I get rid of this behaviour?
>

By far the easiest way is to give the underscore character
word syntax.  Which is exactly how I avoid the problem in
tacl-mode.

    (modify-syntax-entry ?\_ "w" st)

Other than that you probably need to use font-lock-list
rather than keyword-list so you can build your own
regexp that excludes the characters that shouldn't
be allowed to touch the keywords.

_______________________________________________
Help-gnu-emacs mailing list
Help-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs

Reply via email to