emacs-devel
[Top][All Lists]
Advanced

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

Re: Color-theme problems in Emacs 22+ (Ubuntu, Windows)


From: Chong Yidong
Subject: Re: Color-theme problems in Emacs 22+ (Ubuntu, Windows)
Date: Wed, 31 Jan 2007 10:23:30 -0500
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.93 (gnu/linux)

The problematic customization is in your .emacs file:

(defface my-font-lock-tab-face
  '((t (:background "Gold")))
  "Face for highlighting tab characters.")

(defface my-font-lock-trailing-space-face
  '((t (:background "LemonChiffon")))
  "Face for highlighting trailing spaces.")

;; warning font lock (80 columns, tabs, trailing spaces)
(defvar font-lock-keywords nil)
(add-hook 'font-lock-mode-hook
          '(lambda ()
             (setq font-lock-keywords
                   (append font-lock-keywords
                           '(("\t+"
                              (0 'my-font-lock-tab-face t))
                             ("[ \t]+$"
                              (0 'my-font-lock-trailing-space-face t)))))))

When you munge font-lock-keywords manually, unpredicatable things can
occur.  In this case, it seems like font-lock-mode is taking over
highlighting in buffers that normally specify face properties
manually, causing the normal text highlighting to disappear.

The proper way to do what you want is to use the function
`font-lock-add-keywords'.  See also hi-lock.el, which may do what you
want.




reply via email to

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