GNU bug report logs - #40336
default face spec doesn't get overriden

Previous Next

Package: emacs;

Reported by: Bad Blue Bull <ibmbull <at> yandex.ru>

Date: Mon, 30 Mar 2020 22:39:01 UTC

Severity: normal

Merged with 18074

Found in version 24.3.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 40336 in the body.
You can then email your comments to 40336 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#40336; Package emacs. (Mon, 30 Mar 2020 22:39:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Bad Blue Bull <ibmbull <at> yandex.ru>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 30 Mar 2020 22:39:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Bad Blue Bull <ibmbull <at> yandex.ru>
To: "bug-gnu-emacs <at> gnu.org" <bug-gnu-emacs <at> gnu.org>
Subject: default face spec doesn't get overriden
Date: Tue, 31 Mar 2020 01:38:40 +0300
Maybe I'm getting something wrong.

> ‘default’
> This element of SPEC doesn’t match any terminal; instead, it
> specifies defaults that apply to all terminals. This element,
> if used, must be the first element of SPEC. Each of the
> following elements can override any or all of these defaults.


(progn
  (face-spec-set 'zzz
		 '((default  :background "red")
		   (((background dark)) :weight bold :background "black" :foreground "White"  )
		   (((background light)) :weight bold :background "yellow" :foreground "Black"  )
		   ))

  (insert (propertize "XXX" 'face 'zzz)))


Eval it and see default background gets applied despite it should be overriden by a spec line that matches terminal's background.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#40336; Package emacs. (Thu, 02 Apr 2020 19:37:02 GMT) Full text and rfc822 format available.

Message #8 received at 40336 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Bad Blue Bull <ibmbull <at> yandex.ru>
Cc: 40336 <at> debbugs.gnu.org
Subject: Re: bug#40336: default face spec doesn't get overriden
Date: Thu, 02 Apr 2020 22:36:08 +0300
> From: Bad Blue Bull <ibmbull <at> yandex.ru>
> Date: Tue, 31 Mar 2020 01:38:40 +0300
> 
> (progn
>   (face-spec-set 'zzz
> 		 '((default  :background "red")
> 		   (((background dark)) :weight bold :background "black" :foreground "White"  )
> 		   (((background light)) :weight bold :background "yellow" :foreground "Black"  )
> 		   ))
> 
>   (insert (propertize "XXX" 'face 'zzz)))
> 
> 
> Eval it and see default background gets applied despite it should be overriden by a spec line that matches terminal's background.

Thanks.  Does the patch below fix that?

diff --git a/lisp/faces.el b/lisp/faces.el
index 9a49ea8..e707f6f 100644
--- a/lisp/faces.el
+++ b/lisp/faces.el
@@ -1560,7 +1560,7 @@ face-spec-choose
     ;; return it to the caller. Since there will most definitely be something to
     ;; return in this case, there's no need to know/check if a match was found.
     (if defaults
-	(append result defaults)
+	(append defaults result)
       (if match-found
 	  result
 	no-match-retval))))




Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Sat, 04 Apr 2020 07:02:01 GMT) Full text and rfc822 format available.

Notification sent to Bad Blue Bull <ibmbull <at> yandex.ru>:
bug acknowledged by developer. (Sat, 04 Apr 2020 07:02:02 GMT) Full text and rfc822 format available.

Message #13 received at 40336-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Bad Blue Bull <ibmbull <at> yandex.ru>
Cc: 40336-done <at> debbugs.gnu.org
Subject: Re: bug#40336: default face spec doesn't get overriden
Date: Sat, 04 Apr 2020 10:00:57 +0300
> From: Bad Blue Bull <ibmbull <at> yandex.ru>
> Date: Sat, 04 Apr 2020 01:27:16 +0300
> 
> Yes, well done.

Thanks, installed on the master branch.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 02 May 2020 11:24:05 GMT) Full text and rfc822 format available.

bug unarchived. Request was from Mauro Aranda <maurooaranda <at> gmail.com> to control <at> debbugs.gnu.org. (Wed, 26 Aug 2020 13:52:02 GMT) Full text and rfc822 format available.

Forcibly Merged 18074 40336. Request was from Mauro Aranda <maurooaranda <at> gmail.com> to control <at> debbugs.gnu.org. (Wed, 26 Aug 2020 13:52:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 24 Sep 2020 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 204 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.