[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: generic-mode: Keywords also highlight with an underscore
From: |
rgb |
Subject: |
Re: generic-mode: Keywords also highlight with an underscore |
Date: |
25 Aug 2005 10:55:34 -0700 |
User-agent: |
G2/0.2 |
> > (modify-syntax-entry ?\_ "w" st)
>
> Great, that works.
> Since I didn't know what to put in for st, I defined
>
> (defun syntax-table-for-fnord() (modify-syntax-entry ?\_ "w"))
>
I believe that you would use this to modify a modes table
from a mode hook.
(modify-syntax-entry ?\_ "w" (syntax-table))
When writing a mode I usually see it done like this:
(defvar tal-mode-syntax-table
(let ((st (make-syntax-table)))
(modify-syntax-entry ?\n ">" st)
... <zillion other lines snipped>
(modify-syntax-entry ?\_ "w" st)
(modify-syntax-entry ?\{ "." st)
(modify-syntax-entry ?\| "." st)
(modify-syntax-entry ?\} "." st)
st)
"Syntax table for `tal-mode'.")
Then this is in the tal-mode function:
(set-syntax-table tal-mode-syntax-table)
> However, I'd rather have this fix globally. Is there
> a global syntax table that I can use for st in my .emacs?
>
I've never tried to modify the global map so I'm not
sure this is correct but looks to me like it should be.
(modify-syntax-entry ?\_ "w" (standard-syntax-table))