unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: bojohan+news@dd.chalmers.se (Johan Bockgård)
To: emacs-devel@gnu.org
Subject: Re: 23.0.50; face-problems with multy-tty
Date: Thu, 13 Sep 2007 18:05:04 +0200	[thread overview]
Message-ID: <yoij7imuk0un.fsf@gamma02.me.chalmers.se> (raw)
In-Reply-To: E1IU6HX-0002Sj-VZ@fencepost.gnu.org

Richard Stallman <rms@gnu.org> writes:

>     > face-spec-set is supposed to operate on all frames
>     > when the FRAME argument is nil.  If it doesn't,
>     > then either its code or its documentation needs to be changed.
>
>     It does "operate on all frames". The problem is that it sets the same
>     attributes everywhere.
>
> Is that a bug in face-spec-set?  It sounds like one.

I can't answer that question.

> If it is, the thing to do is fix it, not work around it.
> Would you like to look for the right fix?

The old code boiled down to calling `set-face-attribute' with a null
FRAME argument. This sets a new frame default that is the same for all
frames (via face-new-frame-defaults). That is not what we want.

The new code calls set-face-attribute locally for each frame. It does
not set a default in face-new-frame-defaults. This DTRT unless a default
exists in face-new-frame-defaults (or an X resource exists for the
face).

What is needed is something like what `C-M-x' does on `defface' forms.
It removes the global default (in face-new-frame-defaults) before
setting the specs. But it doesn't do the right thing if a face has been
set via X resources (cf. Re: can't set both mode-line color and default
frame font?).

(E.g the X resource setting "Emacs.foo.attributeForeground: blue" can't
be overridden by <C-M-x> on

    (defface foo
      '((t :foreground "red"))
      "")
)



I think it comes down to this code in face-set-after-frame-default

    ;; Initialize faces from face specs and X resources.  The
    ;; condition-case prevents invalid specs from causing frame
    ;; creation to fail.
    (dolist (face (delq 'default (face-list)))
      (condition-case ()
          (progn
            (face-spec-set face (face-user-default-spec face) frame) ; (1)
            (if (memq (window-system frame) '(x w32 mac))
                (make-face-x-resource-internal face frame))          ; (2)
            (internal-merge-in-global-face face frame))              ; (3)
        (error nil)))

We want `custom-set-faces' to use frame local specs (1).

This requires clearing the global definition (3) (in
face-new-frame-defaults, using face-spec-reset-face)

But we also need to override the X resource definition for new frames
(2), without using the same global definition everywhere (which is what
(3) does). What would be a good way to do that?

-- 
Johan Bockgård

  parent reply	other threads:[~2007-09-13 16:05 UTC|newest]

Thread overview: 80+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-06  6:49 23.0.50; face-problems with multy-tty Tassilo Horn
2007-09-06 16:54 ` Dan Nicolaescu
2007-09-06 17:55   ` Tassilo Horn
2007-09-06 21:16 ` Dan Nicolaescu
2007-09-07  0:59   ` Johan Bockgård
2007-09-07 10:46     ` Tassilo Horn
2007-09-07 11:19       ` Johan Bockgård
2007-09-07 13:34         ` Tassilo Horn
2007-09-07 14:26           ` Johan Bockgård
2007-09-07 15:06             ` Tassilo Horn
2007-09-07 15:23     ` Romain Francoise
2007-09-07 15:56       ` Johan Bockgård
2007-09-07 16:50         ` Romain Francoise
2007-09-08  7:01           ` Richard Stallman
2007-09-08  8:06             ` Tassilo Horn
2007-09-07 19:53     ` Richard Stallman
2007-09-07 21:34       ` Johan Bockgård
2007-09-08 19:47         ` Richard Stallman
2007-09-08 20:09           ` Tassilo Horn
2007-09-13 16:05           ` Johan Bockgård [this message]
2007-09-09 18:14             ` can't set both mode-line color and default frame font? Chris Moore
2007-09-09 18:34               ` Chris Moore
2007-09-10  1:13                 ` Richard Stallman
2007-09-10 18:21                   ` Jan Djärv
2007-09-13 16:23             ` 23.0.50; face-problems with multy-tty Drew Adams
2007-09-14  7:04               ` Richard Stallman
2007-09-30 23:53                 ` overriding a face [was: 23.0.50; face-problems with multy-tty] Drew Adams
2007-10-01 17:40                   ` Richard Stallman
2007-10-01 18:20                     ` Drew Adams
2007-10-02  3:32                       ` Richard Stallman
2007-10-02 14:22                         ` Drew Adams
2007-10-02 21:59                           ` Richard Stallman
2007-09-17  3:59             ` 23.0.50; face-problems with multy-tty Richard Stallman
2007-09-18 13:55               ` Johan Bockgård
2007-09-23 21:55                 ` Richard Stallman
2007-09-24  0:00                   ` Johan Bockgård
2007-09-24  4:15                     ` Eli Zaretskii
2007-09-24 13:06                       ` Johan Bockgård
2007-09-24 21:27                         ` Eli Zaretskii
2007-09-26 16:35                           ` Johan Bockgård
2007-09-25 10:44                     ` Richard Stallman
2007-09-26 16:40                       ` Johan Bockgård
2007-09-27 17:59                         ` Richard Stallman
2007-09-27 22:57                           ` Johan Bockgård
2007-09-28 19:04                             ` Richard Stallman
2007-09-24  0:22                   ` Drew Adams
2007-09-24  4:09                   ` Eli Zaretskii
2007-09-24  7:10                   ` Glenn Morris
2007-09-25 10:44                     ` Richard Stallman
2007-10-09  1:19                       ` Glenn Morris
2007-10-10 13:02                         ` Richard Stallman
2007-09-24 17:09                   ` Davis Herring
2007-09-25 10:44                     ` Richard Stallman
2007-09-25 20:27                       ` Juri Linkov
     [not found]             ` <E1IX7lU-0007oJ-Fl@fencepost.gnu.org>
2007-09-17  6:18               ` can't set both mode-line color and default frame font? Jan Djärv
2007-09-17 22:24                 ` Richard Stallman
2007-09-18  6:21                   ` Jan Djärv
2007-09-18 19:34                     ` Richard Stallman
2007-09-18 20:08                       ` Drew Adams
2007-09-18 20:43                         ` Jason Rumney
2007-09-18 21:18                           ` Drew Adams
2007-09-18 21:38                             ` Drew Adams
2007-09-18 21:43                             ` Davis Herring
2007-09-18 21:58                               ` Drew Adams
2007-09-18 22:06                                 ` Davis Herring
2007-09-18 22:22                                   ` Drew Adams
2007-09-19  1:37                                     ` Davis Herring
2007-09-19  3:57                                       ` Drew Adams
2007-09-19 13:49                                         ` Stefan Monnier
2007-09-19 14:37                                           ` Drew Adams
2007-09-19 16:14                                         ` Davis Herring
2007-09-19 15:48                                     ` Richard Stallman
2007-09-19  6:16                           ` Jan Djärv
2007-09-18 21:54                         ` Stefan Monnier
2007-09-18 22:03                           ` Drew Adams
2007-09-19  6:12                         ` Jan Djärv
2007-09-19  6:08                       ` Jan Djärv
2007-09-17 14:00               ` Stefan Monnier
2007-09-17 22:24                 ` Richard Stallman
2007-09-07 22:33 ` 23.0.50; face-problems with multy-tty Tassilo Horn

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=yoij7imuk0un.fsf@gamma02.me.chalmers.se \
    --to=bojohan+news@dd.chalmers.se \
    --cc=emacs-devel@gnu.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).