* bug#40336: default face spec doesn't get overriden
@ 2020-03-30 22:38 Bad Blue Bull
2020-04-02 19:36 ` Eli Zaretskii
0 siblings, 1 reply; 3+ messages in thread
From: Bad Blue Bull @ 2020-03-30 22:38 UTC (permalink / raw)
To: 40336
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.
^ permalink raw reply [flat|nested] 3+ messages in thread
* bug#40336: default face spec doesn't get overriden
2020-03-30 22:38 bug#40336: default face spec doesn't get overriden Bad Blue Bull
@ 2020-04-02 19:36 ` Eli Zaretskii
[not found] ` <4667731585952810@iva8-03ad76494624.qloud-c.yandex.net>
0 siblings, 1 reply; 3+ messages in thread
From: Eli Zaretskii @ 2020-04-02 19:36 UTC (permalink / raw)
To: Bad Blue Bull; +Cc: 40336
> From: Bad Blue Bull <ibmbull@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))))
^ permalink raw reply related [flat|nested] 3+ messages in thread
* bug#40336: default face spec doesn't get overriden
[not found] ` <4667731585952810@iva8-03ad76494624.qloud-c.yandex.net>
@ 2020-04-04 7:00 ` Eli Zaretskii
0 siblings, 0 replies; 3+ messages in thread
From: Eli Zaretskii @ 2020-04-04 7:00 UTC (permalink / raw)
To: Bad Blue Bull; +Cc: 40336-done
> From: Bad Blue Bull <ibmbull@yandex.ru>
> Date: Sat, 04 Apr 2020 01:27:16 +0300
>
> Yes, well done.
Thanks, installed on the master branch.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-04-04 7:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-30 22:38 bug#40336: default face spec doesn't get overriden Bad Blue Bull
2020-04-02 19:36 ` Eli Zaretskii
[not found] ` <4667731585952810@iva8-03ad76494624.qloud-c.yandex.net>
2020-04-04 7:00 ` Eli Zaretskii
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).