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

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

e23 inverse video on mode line and nowhere else


From: Karl Berry
Subject: e23 inverse video on mode line and nowhere else
Date: Wed, 13 Jan 2010 01:42:25 GMT

I habitually run Emacs in an xterm window.  For that purpose, I'd like
to have the mode lines be inverse video, and not to have inverse video,
or any other face manipulations (underline, etc.), in buffer contents,
such as *compilation* and *grep*.

Is there any way to do this globally in Emacs 23?

If not ...
A couple years ago Juri Linkov kindly sent me the Elisp below to
disable faces by default, leaving only faces matching ^mode-line
untouched.  This seems to generally give what I want.  (Thanks again, Juri.)

But what I'm finding now is that the compilation status string, such as
":run", ": exit[0]", and so on, is shown as normal text (not inverse
video) in the mode line.

I can get the compilation string in inverse video in the mode line with
this (or by excluding ^compilation in my-faces-fix below):

  (set-face-attribute 'compilation-info nil    :inverse-video t)
  (set-face-attribute 'compilation-warning nil :inverse-video t)
  (set-face-attribute 'compilation-error nil   :inverse-video t)

But then filenames and various other strings show up in inverse video in
the buffer contents.

Short of reverting back to old versions of M-x compile, etc., which I
don't want to do, is there any way to control this?

Perhaps by doing something in the mode line display to force all faces
to inverse video?  (It seems like the same compilation-* faces should
not be used both within the buffer contents and in the mode line, but
anyway.)

Thanks,
Karl


;; Kill all faces except mode lines.  (Juri, 14aug07)
(defun my-faces-fix (&optional frame)
  "Fix defined faces."
  (interactive)
  ;; Check if this function is called by `custom-define-hook' from
  ;; `custom-declare-face' where the variable `face' is bound locally.
  (when (boundp 'face)
    (dolist (face (face-list))
      (unless (string-match "^mode-line" (symbol-name face))
        ;; Reset all face attributes
        (modify-face face)))))
;;
;; 1. Fix existing faces
(let ((face t)) (my-faces-fix))
;;
;; 2. Call `my-faces-fix' every time some new face gets defined
(add-to-list 'custom-define-hook 'my-faces-fix)




reply via email to

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