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.

--
Kevin Rodgers



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

Reply via email to