[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Case insensitive font-lock
From: |
Bert Geens |
Subject: |
Re: Case insensitive font-lock |
Date: |
Sat, 27 Aug 2005 20:23:06 +0200 |
User-agent: |
Pan/0.14.2.91 (As She Crawled Across the Table) |
On Mon, 22 Aug 2005 13:09:24 -0600, Kevin Rodgers wrote:
> Bert Geens wrote:
> > Thanks a lot, i had looked at font-lock-defaults but apparently not hard
> > enough...
> >
> > So I tried this:
> > (set (make-local-variable 'font-lock-defaults) '(fvwm-font-lock-keywords
> > nil fvwm-keywords-ignore-case))
> > But that apparently didn't work, I wonder why?
>
> Because the CASE-FOLD entry is not like the KEYWORDS entry. To cite the
> doc string again:
>
> KEYWORDS may be a symbol (a variable or function whose value is
> the keywords to use for fontification) or a list of symbols.
>
> But no similar statement is made about CASE-FOLD, so you want the actual
> value of fvwm-keywords-ignore-case:
>
> (set (make-local-variable 'font-lock-defaults)
> (list 'fvwm-font-lock-keywords nil fvwm-keywords-ignore-case))
>
> or:
>
> (set (make-local-variable 'font-lock-defaults)
> `(fvwm-font-lock-keywords nil ,fvwm-keywords-ignore-case))
>
> That being said, using any non-nil object for CASE-FOLD (such as the
> fvwm-keywords-ignore-case symbol) should result in case-insensitive
> font-locking.
>
> > I now use this, which does work though, but the above solution would be
> > cleaner imho...
> >
> > (if fvwm-keywords-ignore-case
> > (set (make-local-variable 'font-lock-defaults)
> '(fvwm-font-lock-keywords))
> > (set (make-local-variable 'font-lock-defaults)
> > '(fvwm-font-lock-keywords nil t)))
>
> That looks backwards. If fvwm-keywords-ignore-case is set, I'd expect
> you to specify CASE-FOLD as non-nil. But you are specifying CASE-FOLD
> as t when fvwm-keywords-ignore-case is nil.
I'm in the middle of my exams, so that's why I'm replying a bit slow, and
why I'm sleeping too little, thanks for the explanation, I'll get that
fixed before I release a new version :)
Cheers
Bert