From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Erik Charlebois Newsgroups: gmane.emacs.bugs 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 Message-ID: References: <1AAD906B-FB98-45B1-897A-C42427404493@gmail.com> <63104FCA-1605-4369-B4D6-D6C4A5D24952@gmail.com> <9263bmtjqr.fsf@fencepost.gnu.org> Reply-To: Erik Charlebois , 4381@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v1076) Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1252909733 24710 80.91.229.12 (14 Sep 2009 06:28:53 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 14 Sep 2009 06:28:53 +0000 (UTC) Cc: 4381@emacsbugs.donarmstrong.com To: Glenn Morris Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Sep 14 08:28:46 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Mn53N-0003TS-AK for geb-bug-gnu-emacs@m.gmane.org; Mon, 14 Sep 2009 08:28:45 +0200 Original-Received: from localhost ([127.0.0.1]:34340 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mn53M-0006rU-KB for geb-bug-gnu-emacs@m.gmane.org; Mon, 14 Sep 2009 02:28:44 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mn51q-00056F-NC for bug-gnu-emacs@gnu.org; Mon, 14 Sep 2009 02:27:10 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mn51j-0004xz-MX for bug-gnu-emacs@gnu.org; Mon, 14 Sep 2009 02:27:08 -0400 Original-Received: from [199.232.76.173] (port=35779 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mn51j-0004xP-8D for bug-gnu-emacs@gnu.org; Mon, 14 Sep 2009 02:27:03 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:56235) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Mn51i-0007LH-Me for bug-gnu-emacs@gnu.org; Mon, 14 Sep 2009 02:27:03 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n8E6R0Tn013878; Sun, 13 Sep 2009 23:27:00 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id n8E6F4Zb011801; Sun, 13 Sep 2009 23:15:04 -0700 Resent-Date: Sun, 13 Sep 2009 23:15:04 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Erik Charlebois Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs , owner@emacsbugs.donarmstrong.com 2Resent-Date: Mon, 14 Sep 2009 06:15:04 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 4381 X-Emacs-PR-Package: emacs,ns X-Emacs-PR-Keywords: Original-Received: via spool by 4381-submit@emacsbugs.donarmstrong.com id=B4381.125290844910731 (code B ref 4381); Mon, 14 Sep 2009 06:15:04 +0000 Original-Received: (at 4381) by emacsbugs.donarmstrong.com; 14 Sep 2009 06:07:29 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from mail-pz0-f184.google.com (mail-pz0-f184.google.com [209.85.222.184]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n8E67SA1010724 for <4381@emacsbugs.donarmstrong.com>; Sun, 13 Sep 2009 23:07:29 -0700 Original-Received: by pzk14 with SMTP id 14so2371915pzk.1 for <4381@emacsbugs.donarmstrong.com>; Sun, 13 Sep 2009 23:07:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:mime-version :content-type:from:in-reply-to:date:cc:content-transfer-encoding :message-id:references:to:x-mailer; bh=B3HcP5amQwpMZSzqQlvySdIVHimMTsd8XEtQoFufmZM=; b=TA8l3yDcMJVtSP5RgjpQvMLGPCFZG+p12wJoMdRJaKUvB3tMk0PmqsHH1n9WepFqa/ nzfYHojiSGX1p5rYNnFCz1Fg1N9zRHCi8Y2mRJU5T1Ft/BphZkRgdu47d5Qb23bcPAdW XLoAMpwJySIojuA34SH3cLYq+qWT9UYC28AFw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; b=QkS1MPBH1DBYKc49KkkIUg4w/etiemhQCVAWQUrWVpbIvbRwi9u/MzzCWptP3Pq//O OlQpbdBz6HELBmDDcSz/jfCT4/q7F8NPGtV7+L22xdoMD1Cvb74uZpx6NKxW8w2yvCWq mYkx/3nI5GhvqMbXz1uov6Sejxe9fFR64xHaM= Original-Received: by 10.115.65.5 with SMTP id s5mr10646486wak.41.1252908442817; Sun, 13 Sep 2009 23:07:22 -0700 (PDT) Original-Received: from ?192.168.123.51? (64-46-22-205.dyn.novuscom.net [64.46.22.205]) by mx.google.com with ESMTPS id 21sm2918779pzk.7.2009.09.13.23.07.21 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 13 Sep 2009 23:07:22 -0700 (PDT) In-Reply-To: <9263bmtjqr.fsf@fencepost.gnu.org> X-Mailer: Apple Mail (2.1076) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Mon, 14 Sep 2009 02:27:08 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:31079 Archived-At: 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.