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: gerald . jean
Subject: RE: Font-lock-faces in Emacs 23.2
Date: Thu, 16 Dec 2010 16:17:20 -0500


"Drew Adams" <drew.adams@oracle.com> a écrit sur 2010/12/16 11:16:52 :

> > 1.- M-x customize-group <enter>
> > 2.- font-lock-faces <enter>
> > 3.- Then move down to the "Font Lock Type Face"...
> > 4.- Then change the Foreground entry... to OrangeRed...
> > 5.- ...click the <Set for current session> button
> >     and the <Save for future sessions button>, reply <yes>...
>
> No need do `Set', since you're doing `Save' (but it doesn't hurt).

I'll remember this one.

>
> > 6.- Exit customize
> ...
> > Customize has written the following code to my <.emac> file,
> > and this is the last statement in my <.emacs> file:
> >
> > (custom-set-faces...
> >  '(dired-header ((t (:inherit default :foreground "OrangeRed"))))
> >  '(font-lock-type-face ((t (:foreground "OrangeRed"))))...
>
> Does your .emacs get loaded that far, so that the `customize-set-
> faces' actually
> gets eval'd?  E.g., does the `dired-header' face show up OK?

Yes it does, in OrangeRed as specified.

>
> Font lock is sometimes a bit special. What happens if you customize
> a different
> font-lock face, e.g. `font-lock-doc-face'?  Does that work (for
subsequent
> sessions)?

For reasons I don't understand I couldn't customize "font-lock-doc-face",
everything I tried to do in there emacs told me I couldn't edit this part
of the field, I tried every where in the "Foreground" field, this field was
not ticked though?  Hence I tried a different font-lock-face,
"font-lock-keyword-face", I setted it to "Red" and accordingly Customize
wrote the following line in my .emacs.

 '(font-lock-keyword-face ((t (:foreground "Red"))))

Didn't stay for future sessions?

>
> Are you sure that the face wasn't in fact customized for future sessions,
but
> that perhaps font-lock-mode wasn't turned on?  Which color is indicated
as the
> foreground setting after you start up the second time, if you do
> `customize-face
> RET font-lock-type-face RET' then?

Goldenrod, as it always indicates upon a new startup?

>
> Try (after backing up your .emacs) using a different .emacs that hasonly
this
> in it:
>
> (custom-set-faces
>   '(font-lock-type-face ((t (:foreground "OrangeRed")))))
>
> If that works, then try commenting out half of your original .emacs
> (leaving the
> `custom-set-faces'), then comment-out 3/4, 7/8, 15/16,... until you find
which
> part of your init file is interfering.
>
> In sum, play around a little, 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.

I went to "ess-font-lock.el" and found:

(defun ess-font-lock-db ()
  "Set font-lock colors (leave fore-/back-ground alone) courtesy David
Brahm <David.Brahm@fmr.com>"
  (interactive)
  (set-face-foreground 'font-lock-comment-face       "Firebrick")  ; #...
%...
  (set-face-foreground 'font-lock-string-face        "SeaGreen")   ; "..."
"..."
  (set-face-foreground 'font-lock-keyword-face       "MediumBlue") ; if
\end
  (set-face-foreground 'font-lock-function-name-face "VioletRed")  ; talk<-
{center}
  (set-face-foreground 'font-lock-variable-name-face "Blue")         ; xv
  (set-face-foreground 'font-lock-type-face          "Goldenrod")  ; T,F
?
  (set-face-foreground 'font-lock-constant-face      "Magenta")    ; <-
{eq1}
)

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!

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?

Thanks again to Drew Adams, this was annoying me for a while,

Gérald Jean
Conseiller senior en statistiques,
VP Actuariat et Solutions d'assurances,
Desjardins Groupe d'Assurances Générales
télephone            : (418) 835-4900 poste (7639)
télecopieur          : (418) 835-6657
courrier électronique: gerald.jean@dgag.ca

"We believe in God, others must bring Data."

W. Edwards Deming




reply via email to

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