unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@jurta.org>
To: karl@freefriends.org (Karl Berry)
Cc: emacs-devel@gnu.org
Subject: Re: can't turn off font-lock
Date: Tue, 14 Aug 2007 02:27:47 +0300	[thread overview]
Message-ID: <87vebj2ex8.fsf@jurta.org> (raw)
In-Reply-To: <200708132214.l7DMEq616365@f7.net> (Karl Berry's message of "Mon\, 13 Aug 2007 17\:14\:52 -0500")

>       (mapc (lambda (face) (modify-face face)) (face-list))
>
> Thanks Juri, that's very helpful.  I discovered I don't really want mode
> line faces disabled :), so I'm playing with some conditions, but that's
> a detail.  And it has to be run after packages get loaded, since of
> course it can't disable faces that don't exist yet.  Another detail.  At
> least now I know how to shut them off.

I use the following trick to post-process faces immediately after they
get created.  I also modified this code to not reset mode line faces:

(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 (memq face '(mode-line mode-line-highlight mode-line-inactive))
        ;; 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)

-- 
Juri Linkov
http://www.jurta.org/emacs/

  reply	other threads:[~2007-08-13 23:27 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200708112124.l7BLOgG19369@f7.net>
2007-08-12 17:56 ` can't turn off font-lock Richard Stallman
2007-08-12 19:53   ` Stefan Monnier
2007-08-12 21:48     ` Karl Berry
2007-08-12 22:11       ` Stefan Monnier
2007-08-12 22:54         ` Karl Berry
2007-08-12 23:15           ` Andreas Schwab
2007-08-13  2:38             ` Eli Zaretskii
2007-08-12 23:24           ` Juri Linkov
2007-08-13 22:14             ` Karl Berry
2007-08-13 23:27               ` Juri Linkov [this message]
2007-08-13  2:37           ` Eli Zaretskii
2007-08-13  5:00           ` Richard Stallman
2007-08-13 19:56           ` Eli Zaretskii
2007-08-12 22:44       ` Alfred M. Szmidt
2007-08-13  5:01     ` Richard Stallman
2007-08-12 21:48   ` Karl Berry
2007-08-13  5:00     ` Richard Stallman
2007-08-12 22:54   ` Karl Berry
2007-08-13  2:31     ` Eli Zaretskii
2007-08-13  5:00     ` Richard Stallman
2007-08-13 23:31       ` Karl Berry
2007-08-14  3:26         ` Eli Zaretskii
2007-08-14 16:06         ` Richard Stallman
2007-08-13 23:31       ` Karl Berry
2007-08-13 23:51         ` Stefan Monnier
2007-08-14 16:06           ` Richard Stallman
2007-08-14 16:06         ` Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87vebj2ex8.fsf@jurta.org \
    --to=juri@jurta.org \
    --cc=emacs-devel@gnu.org \
    --cc=karl@freefriends.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).