unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Erik Charlebois <erikcharlebois@gmail.com>
To: Glenn Morris <rgm@gnu.org>
Cc: 4381@emacsbugs.donarmstrong.com
Subject: bug#4381: 23.1.50; Cocoa Emacs: face background for 'region set in ns-win.el after .emacs
Date: Sun, 13 Sep 2009 23:07:19 -0700	[thread overview]
Message-ID: <B76ACD34-0536-462B-85DD-02720A3F54BB@gmail.com> (raw)
In-Reply-To: <9263bmtjqr.fsf@fencepost.gnu.org>

I did a deep dive and figured out exactly what is going on.

The (set-face-background 'region "ns_selection_color") that gets run  
in ns-win.el adds an entry to face-new-frame-defaults for 'region with  
"ns_selection_color" in the background slot. This gets persisted to  
the temacs-generated image.

In startup.el after (command-line) (and therefore, after .emacs runs),  
there's a call to frame-notice-user-settings. Because the background- 
color has been changed, a call to face-set-after-frame-default is  
made. This is turn calls internal-merge-in-global-face. This function  
overrides local settings with the global ones in face-new-frame- 
defaults, which clobbers the face setting.

The reason using set-face-attribute in .emacs works and custom-set- 
faces doesn't is because set-face-attribute (with nil frame) sets the  
value in face-new-frame-defaults.

Those are the gory details. I'm not sure what the right fix is.

Erik Charlebois
erikcharlebois@gmail.com

On 2009-09-13, at 6:09 PM, Glenn Morris wrote:

> Erik Charlebois wrote:
>
>> The minimal .emacs that shows the problem (extracted by digging into
>> the color-themes package):
>>
>> (setq default-frame-alist '((background-color . "white")))
>> (custom-set-faces '(region ((t (:background "red")))))
>>
>> The face setting is not honoured (reverts to ns_selection_color).
>>
>> If I do...
>> (set-face-attribute 'region nil :background "red")
>> instead of custom-set-faces, it works fine (but color-theme uses
>> custom-set-faces).
>
> Your problem sounds like this one:
>
> http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=2868
>
> (which unfortunately split into many different bugs rather than being
> all in the same one)
>
> I think the underlying problem is that ns-win is doing a slightly odd
> thing by calling set-face-background, and it does not play well with
> customize. See also bug #3408.
>
> The solution may be to change ns-win to use a more customize-friendly
> method of changing the face, if it really needs to do that.






  reply	other threads:[~2009-09-14  6:07 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <72AE156F-90CA-4D0A-B93C-F3E3B3253B57@gmail.com>
2009-09-09  7:23 ` bug#4381: 23.1.50; Cocoa Emacs: face background for 'region set in ns-win.el after .emacs Erik Charlebois
2009-09-10  6:27   ` Glenn Morris
2009-09-10  6:35     ` Processed: " Emacs bug Tracking System
2009-09-13 21:56     ` Erik Charlebois
2009-09-14  1:09       ` Glenn Morris
2009-09-14  6:07         ` Erik Charlebois [this message]
2009-09-27 16:20   ` bug#4381: marked as done (23.1.50; Cocoa Emacs: face background for 'region set in ns-win.el after .emacs) Emacs bug Tracking System
2009-09-18 23:57 bug#4381: 23.1.50; Cocoa Emacs: face background for 'region set in ns-win.el after .emacs Adrian Robert
2009-09-19  4:19 ` Erik Charlebois
2009-09-20 13:37   ` Stefan Monnier
2009-09-22 23:19     ` Adrian Robert
2009-09-23 22:44       ` Stefan Monnier
2009-09-24  3:19         ` Adrian Robert
2009-09-24 15:14           ` Stefan Monnier
2009-09-24 16:15             ` Adrian Robert
2009-09-24 17:35               ` Stefan Monnier

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=B76ACD34-0536-462B-85DD-02720A3F54BB@gmail.com \
    --to=erikcharlebois@gmail.com \
    --cc=4381@emacsbugs.donarmstrong.com \
    --cc=rgm@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).