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

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

RE: Font-lock-faces in Emacs 23.2


From: Drew Adams
Subject: RE: Font-lock-faces in Emacs 23.2
Date: Thu, 16 Dec 2010 13:47:23 -0800

> > varying things, to see what you can discover.
> 
> This is what I did and thanks to Drew I located the problem.  
> I would never have thought of looking there though since the problem 
> originates from an Emacs package I use very heavily, every day, for
> years, ess (Emacs Speaks Statistics), furthermore, the problem
> occurred after the upgrade from 21.3 to 23.2, it was OK before?
> 
> (require 'ess-site)
> (require 'ess-font-lock)
> (ess-font-lock-db)  ;;  This single function caused the problem.

Is that `(ess-font-lock-db)' occurrence at the top level of some file that you
load?  IOW, is it getting eval'd unconditionally whenever you load ESS?

If so, I would recommend that you file an ESS bug.
Merely loading a library should not change user settings this way.

Some reasonable ways for a library to deal with this kind of thing:

a. Just recommend particular settings, in a comment or doc string, without
actually setting them.

b. Provide a command that sets the recommended settings.

c. Provide its own user options or faces with the recommended values as the
default values.  That way, users can customize them.

> I replaced the offending "Goldenrod" by "OrangeRed" and
> everything is fine, the only thing now is that at each
> upgrade I'll have to remember to change this!

That's why it's better to file a bug report.
You should not need to modify source code that way.

> There is something I'd like explained if possible.  Given that I have
>  (custom-set-faces...
>   '(dired-header ((t (:inherit default :foreground "OrangeRed"))))
>   '(font-lock-type-face ((t (:foreground "OrangeRed"))))...
> way later than the call to "ess-font-lock-db" in my .emacs 
> file why didn't my settings override the "ess-font-lock-db" settings?

Dunno. Are you sure `ess-font-lock-db' wasn't called again later?
`custom-set-faces' unconditionally sets the faces each time it is called.  For
example:

(custom-set-faces '(font-lock-comment-face
                  ((t (:foreground "Red")))))
(set-face-foreground 'font-lock-comment-face "DarkBlue")
(custom-set-faces '(font-lock-comment-face
                  ((t (:foreground "DarkGreen")))))

Put your cursor after each of these sexps in turn and hit `C-x C-e' to evaluate
it.

My guess is that something is calling `ess-font-lock-db' again after your .emacs
is loaded.




reply via email to

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