From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alex Kost Newsgroups: gmane.emacs.help Subject: Re: Overriding some face attributes without changing the default(s) one(s) Date: Mon, 09 Jun 2014 10:26:01 +0400 Message-ID: <87lht6ha4m.fsf@gmail.com> References: <871tv05z88.fsf@web.de> <87ppikgcq7.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1402296725 20281 80.91.229.3 (9 Jun 2014 06:52:05 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 9 Jun 2014 06:52:05 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Alexandre LAURENT Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Jun 09 08:52:00 2014 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Wtt2I-0000uk-Rh for geh-help-gnu-emacs@m.gmane.org; Mon, 09 Jun 2014 08:26:27 +0200 Original-Received: from localhost ([::1]:59148 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wtt2I-0000o7-Ak for geh-help-gnu-emacs@m.gmane.org; Mon, 09 Jun 2014 02:26:26 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39840) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wtt1x-0000fx-QG for help-gnu-emacs@gnu.org; Mon, 09 Jun 2014 02:26:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wtt1t-0002u9-7j for help-gnu-emacs@gnu.org; Mon, 09 Jun 2014 02:26:05 -0400 Original-Received: from mail-la0-x235.google.com ([2a00:1450:4010:c03::235]:38095) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wtt1t-0002tw-0J for help-gnu-emacs@gnu.org; Mon, 09 Jun 2014 02:26:01 -0400 Original-Received: by mail-la0-f53.google.com with SMTP id ty20so2782442lab.40 for ; Sun, 08 Jun 2014 23:25:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=7URTLqN0K+aM2vgZxLSpGHujvEF8yM410Gw4/WR721k=; b=ZTHRGH91NIYDbbiw+uYnCA577W7mB3YoKVKtJfOtgEot1ojw3E5MbR2Pa7snE5ZWJ9 mkKd3fTeNutOM7YdFSQnErozoZkEq+Kgc+uJ74Tv/OHsHaDBqdTgT7UUQRubpjCqSE4N Ji5kn7vHTCXAgBvSP+25x6inI2u51vVB5anruHrhLJKBfJl5jtR1iZlrkTBl5smAwVtM YY0OSxLTWHELn4fEABkVkY4KBlSmneUzZYa+VJvn10I32XMCT7SLl/HErP8U/s7TXQyg 9ICPnb4vDlUbMTnbvTAbbz1j7XNKVMwk48JNEJXsjEHNUJHAWJJZz+spu5lHAreXcXZ2 J/bg== X-Received: by 10.152.121.72 with SMTP id li8mr913273lab.45.1402295159247; Sun, 08 Jun 2014 23:25:59 -0700 (PDT) Original-Received: from leviafan (128-70-204-134.broadband.corbina.ru. [128.70.204.134]) by mx.google.com with ESMTPSA id lq20sm17157208lbb.24.2014.06.08.23.25.58 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 08 Jun 2014 23:25:58 -0700 (PDT) In-Reply-To: (Alexandre LAURENT's message of "Sun, 8 Jun 2014 22:23:10 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c03::235 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:98110 Archived-At: Alexandre LAURENT (2014-06-09 00:23 +0400) wrote: > On Sun, Jun 8, 2014 at 8:02 AM, Alex Kost wrote: >> >> The problem is that in emacs 24.3.1 default face specifications are >> merged with the face specifications defined by a theme, so what you see >> is a "bold" defined by your theme and the bits from a default spec. In >> emacs 24.4 (and in the current trunk) your theme would work as expected: >> if a face is themed, then the default spec is ignored completely. >> >> If you want to make emacs 24.3.1 display only themed faces, you have to >> override all the bits of the default spec in your theme (which sounds >> horrible IMO), so for example the following should "free" your > Yes it is horrible, I wanted to avoid that. >> background: >> >> (custom-theme-set-faces >> 'monokai-nox >> ;; ... >> '(whitespace-line ((t (:background unspecified :weight bold)))) > Actually, setting the foreground to unspecified does not work either. > I'm pretty sure it takes the "default" face and this face only, which > is different from the multiple faces applied when opening a source > file (no matter what that source file is). > I also define this default face in both my themes. Oh, now I understand what you want. Actually here you faced with another problem: when you enable whitespace-mode in emacs 24.3.1, "whitespace-line" becomes the only active face in a long line, and in emacs 24.4 it is added to the faces in that line. So let's say, you have the following long line in a buffer with "emacs-lisp-mode" (and "whitespace-mode" is enabled): (defun some-function (arg1 arg2 &rest args) "A very useful function." (interactive) (message "Hello")) If you move your cursor to the "defun" word and press "C-4 C-x =", in the bottom of the "*Help*" buffer you will see: There are text properties here: face whitespace-line fontified t I.e. only "whitespace-line" face is active and you can't see "font-lock-keyword-face" (used for highlighting "defun") no matter how you customized "whitespace-line". As for emacs 24.4, you will see: There are text properties here: face (whitespace-line font-lock-keyword-face) fontified t In this case if some bits of face spec are unspecified in "whitespace-line" face, the ones from "font-lock-keyword-face" are used. So that is not the same problem we were discussing before, but it is also fixed in emacs 24.4. >> ;; ... >> ) >> >> If you are interested, I wrote something about that here: >> >> >> Also there were some related bugs, for example: >> >> >> I hope it was helpful. > Yes it is! > > Since I definitely need emacs24.4 for some other features/fix (ex: the > rectangular region to be visually highlighted), I'll just wait for the > package to be available on my distro. > > Thank you.