]> git.eshelyaron.com Git - emacs.git/commitdiff
Make ':extend' inherited from default spec unless overridden
authorDmitry Gutov <dgutov@yandex.ru>
Tue, 10 Dec 2019 00:11:15 +0000 (02:11 +0200)
committerDmitry Gutov <dgutov@yandex.ru>
Tue, 10 Dec 2019 00:16:44 +0000 (02:16 +0200)
* lisp/faces.el (face-spec-recalc): Handle the :extend attribute
specially and always inherit it from the default spec unless
overwritten in a theme (bug#37774).

* test/lisp/faces-tests.el (faces--test-data-dir): New variable.
(faces--test-extend-with-themes): Use test themes instead of ones
from etc/themes.  Update expected values.

* test/data/themes/faces-test-dark-theme.el: New file.

* test/data/themes/faces-test-light-theme.el: New file.

* doc/lispref/display.texi (Face Attributes):
Update the description of ':extend'.

* etc/NEWS: Update the entry for ':extend'.

* etc/themes/adwaita-theme.el:
* etc/themes/deeper-blue-theme.el:
* etc/themes/dichromacy-theme.el:
* etc/themes/leuven-theme.el:
* etc/themes/light-blue-theme.el:
* etc/themes/manoj-dark-theme.el:
* etc/themes/misterioso-theme.el:
* etc/themes/tango-dark-theme.el:
* etc/themes/tango-theme.el:
* etc/themes/tsdh-dark-theme.el:
* etc/themes/tsdh-light-theme.el:
* etc/themes/wheatgrass-theme.el:
* etc/themes/wombat-theme.el: Remove the now-redundant ':extend'
attribute in all the themes.

19 files changed:
doc/lispref/display.texi
etc/NEWS
etc/themes/adwaita-theme.el
etc/themes/deeper-blue-theme.el
etc/themes/dichromacy-theme.el
etc/themes/leuven-theme.el
etc/themes/light-blue-theme.el
etc/themes/manoj-dark-theme.el
etc/themes/misterioso-theme.el
etc/themes/tango-dark-theme.el
etc/themes/tango-theme.el
etc/themes/tsdh-dark-theme.el
etc/themes/tsdh-light-theme.el
etc/themes/wheatgrass-theme.el
etc/themes/wombat-theme.el
lisp/faces.el
test/data/themes/faces-test-dark-theme.el [new file with mode: 0644]
test/data/themes/faces-test-light-theme.el [new file with mode: 0644]
test/lisp/faces-tests.el

index ea3fa6f9b11592b8e02c1363a6a26ba85c1e69a7..48a41f5367746d5db75b34a7551148289cc7cae2 100644 (file)
@@ -2499,9 +2499,12 @@ space between end of line and edge of the window using this face, or
 @code{nil} to not use this face for the space between the end of the
 line and the edge of the window.  When Emacs merges several faces for
 displaying the empty space beyond end of line, only those faces with
-@code{:extend} non-@code{nil} will be merged.  By default, only
-@code{region} and @code{hl-line} faces have this attribute set to
-@code{t}.
+@code{:extend} non-@code{nil} will be merged.  By default, only a
+small number of faces, notably, @code{region}, have this attribute
+set.  This attribute is different from the others in that when a theme
+doesn't specify an explicit value for a face, the value from the
+original face definition by @code{defface} is inherited
+(@pxref{Defining Faces}).
 
 @end table
 
index ade9fca79082875bf69500a95ce8475261bf87d9..16b5176c24b42f60287dce4ad4cc26ca8b1dc944 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -437,19 +437,20 @@ to 'completion-styles' or 'completion-category-overrides' to use it.
 ** The 'completion-common-part' face is now visible by default.
 
 +++
-** New face attribute ':extend' to control face extension at EOL.
-The new face attribute ':extend' controls whether to use the face for
+** New face attribute ':extend' to control face extension at EOL.  The
+new face attribute ':extend' controls whether to use the face for
 displaying the empty space beyond end of line (EOL) till the edge of
-the window.  By default, this attribute is non-nil only for 'region',
-'secondary-selection', 'hl-line' and some faces of Diff and Ediff
-modes; any other face that crosses end of line will not affect the
-display of the empty space at EOL.  This is to make Emacs behave more
-like other GUI applications with respect to displaying faces that
-cross line boundaries.
-
-Themes that redefine faces should add a non-nil ':extend' attribute to
-the above-mentioned faces, to keep the behavior of the default face
-definitions.
+the window.  By default, this attribute is non-nil only for a small
+number of faces, notably, 'region'; any other face that crosses end of
+line will not affect the display of the empty space at EOL.  This is
+to make Emacs behave more like other GUI applications with respect to
+displaying faces that cross line boundaries.
+
+This attribute behaves specially when theme definitions are applied:
+if the theme doesn't specify an explicit value for a face, the value
+from the original face definition is inherited.  Consequently, a theme
+generally shouldn't specify this attribute unless it has a good reason
+to do so.
 
 ** Connection-local variables
 
index 3f29b9f061f9155fac33fc2196f03cce69679493..73ef7b6e9ee1ace53b77a22779b2d6a7bbc01647 100644 (file)
@@ -39,7 +39,7 @@ default look of the Gnome 3 desktop.")
    `(header-line ((,class (:foreground "#CCCCCC" :background "black"))))
 
    `(minibuffer-prompt ((,class (:foreground "#0084C8" :bold t))))
-   `(region ((,class (:foreground unspecified :background "#C2D5E9" :extend t))))
+   `(region ((,class (:foreground unspecified :background "#C2D5E9"))))
    `(dired-header ((,class (:bold t :foreground "#0084C8"))))
    `(widget-button ((,class (:bold t :foreground "#0084C8"))))
 
@@ -96,7 +96,7 @@ default look of the Gnome 3 desktop.")
    `(gnus-cite-1 ((,class (:foreground "#00578E"))))
    `(gnus-cite-2 ((,class (:foreground "#0084C8"))))
 
-   `(diff-added ((,class (:bold t :foreground "#4E9A06" :extend t))))
-   `(diff-removed ((,class (:bold t :foreground "#F5666D" :extend t))))))
+   `(diff-added ((,class (:bold t :foreground "#4E9A06"))))
+   `(diff-removed ((,class (:bold t :foreground "#F5666D"))))))
 
 ;;; adwaita-theme.el  ends here
index d50a641930afb4bfaa044515dcccbe4ea7a4b355..d04a270ba5eb3888b688899277f3f7e658ac84be 100644 (file)
@@ -43,9 +43,9 @@
    ;; `(diff-added ((,class (nil))))
    ;; `(diff-changed ((,class (nil))))
    `(diff-context ((,class (:foreground "seashell4"))))
-   `(diff-file-header ((,class (:background "grey60" :extend t))))
+   `(diff-file-header ((,class (:background "grey60"))))
    `(diff-function ((,class (:inherit diff-header))))
-   `(diff-header ((,class (:background "grey45" :extend t))))
+   `(diff-header ((,class (:background "grey45"))))
    `(diff-hunk-header ((,class (:inherit diff-header))))
    `(diff-index ((,class (:inherit diff-file-header))))
    `(diff-indicator-added ((,class (:foreground "white" :background "darkolivegreen"))))
    `(diff-refine-change ((,class (:background "skyblue4"))))
    ;; `(diff-removed ((,class (nil))))
    `(dired-marked ((,class (:background "dodgerblue3" :foreground "white"))))
-   `(ediff-current-diff-A ((,class (:background "green4" :foreground "white" :extend t))))
-   `(ediff-current-diff-B ((,class (:background "darkorange3" :foreground "white" :extend t))))
-   `(ediff-even-diff-B ((,class (:background "Grey50" :foreground "White" :extend t))))
+   `(ediff-current-diff-A ((,class (:background "green4" :foreground "white"))))
+   `(ediff-current-diff-B ((,class (:background "darkorange3" :foreground "white"))))
+   `(ediff-even-diff-B ((,class (:background "Grey50" :foreground "White"))))
    `(ediff-fine-diff-A ((,class (:background "skyblue4" :foreground "white"))))
    `(ediff-fine-diff-B ((,class (:background "cyan4" :foreground "white"))))
-   `(ediff-odd-diff-A ((,class (:background "Grey50" :foreground "White" :extend t))))
+   `(ediff-odd-diff-A ((,class (:background "Grey50" :foreground "White"))))
    `(error ((,class (:foreground "red"))))
    `(flymake-errline ((,class (:background nil :underline "red"))))
    `(flymake-warnline ((,class (:background nil :underline "magenta3"))))
    `(outline-4 ((,class (:foreground "turquoise2"))))
    `(outline-5 ((,class (:foreground "aquamarine1"))))
    `(primary-selection ((,class (:background "blue3"))))
-   `(region ((,class (:background "#103050" :extend t))))
+   `(region ((,class (:background "#103050"))))
    `(show-paren-match-face ((,class (:background "dodgerblue1" :foreground "white"))))
    `(show-paren-mismatch-face ((,class (:background "red1" :foreground "white"))))
    `(success ((,class (:foreground "SeaGreen2"))))
index d585752ea4cbcfc325f404f53ce5213f2aee7d0b..b361fe5c509f0652eecc8e92d60ad52fd79c2dd6 100644 (file)
@@ -46,8 +46,8 @@ Ansi-Color faces are included.")
    ;; Highlighting faces
    `(fringe ((,class (:background "#f7f7f7"))))
    `(highlight ((,class (:foreground ,blue :background "#e5e5e5"))))
-   `(region ((,class (:foreground unspecified :background ,yellow :extend t))))
-   `(secondary-selection ((,class (:background "#e5e5e5" :extend t))))
+   `(region ((,class (:foreground unspecified :background ,yellow))))
+   `(secondary-selection ((,class (:background "#e5e5e5"))))
    `(isearch ((,class (:foreground "white" :background ,vermillion))))
    `(lazy-highlight ((,class (:foreground "white" :background ,redpurple))))
    `(trailing-whitespace ((,class (:background ,vermillion))))
index 677d91c5b747a78b3721be5714e36547b6da2526..d544f28da79919987014129d20e9d215db0dbc5c 100644 (file)
@@ -48,12 +48,12 @@ Semantic, and Ansi-Color faces are included -- and much more...")
       (code-block '(:foreground "#000088" :background "#FFFFE0"))
       (code-inline '(:foreground "#006400" :background "#FDFFF7"))
       (column '(:height 1.0 :weight normal :slant normal :underline nil :strike-through nil :foreground "#E6AD4F" :background "#FFF2DE"))
-      (diff-added '(:foreground "#008000" :background "#DDFFDD" :extend t))
+      (diff-added '(:foreground "#008000" :background "#DDFFDD"))
       (diff-changed '(:foreground "#0000FF" :background "#DDDDFF"))
-      (diff-header '(:foreground "#800000" :background "#FFFFAF" :extend t))
+      (diff-header '(:foreground "#800000" :background "#FFFFAF"))
       (diff-hunk-header '(:foreground "#990099" :background "#FFEEFF"))
       (diff-none '(:foreground "gray33"))
-      (diff-removed '(:foreground "#A60000" :background "#FFDDDD" :extend t))
+      (diff-removed '(:foreground "#A60000" :background "#FFDDDD"))
       (directory '(:weight bold :foreground "blue" :background "#FFFFD2"))
       (highlight-line '(:background "#FFFFD7")) ; #F5F5F5
       (highlight-line-gnus '(:background "#DAEAFC")) ; defined in `gnus-leuven.el'
@@ -76,7 +76,7 @@ Semantic, and Ansi-Color faces are included -- and much more...")
       (ol8 '(:height 1.0 :weight bold :slant italic :foreground "#FD8008"))
       (paren-matched '(:background "#99CCFF"))
       (paren-unmatched '(:underline "red" :foreground nil :background "#FFDCDC"))
-      (region '(:background "#ABDFFA" :extend t))
+      (region '(:background "#ABDFFA"))
       (shadow '(:foreground "#7F7F7F"))
       (string '(:foreground "#008000")) ; or #D0372D
       (subject '(:family "Sans Serif" :weight bold :foreground "black"))
@@ -243,15 +243,15 @@ Semantic, and Ansi-Color faces are included -- and much more...")
    `(smerge-refined-change ((,class (:background "#AAAAFF"))))
 
    ;; Ediff
-   `(ediff-current-diff-A ((,class (:foreground "gray33" :background "#FFDDDD" :extend t))))
-   `(ediff-current-diff-B ((,class (:foreground "gray33" :background "#DDFFDD" :extend t))))
-   `(ediff-current-diff-C ((,class (:foreground "black" :background "cyan" :extend t))))
-   `(ediff-even-diff-A ((,class (:foreground "black" :background "light grey" :extend t))))
-   `(ediff-even-diff-B ((,class (:foreground "black" :background "light grey" :extend t))))
+   `(ediff-current-diff-A ((,class (:foreground "gray33" :background "#FFDDDD"))))
+   `(ediff-current-diff-B ((,class (:foreground "gray33" :background "#DDFFDD"))))
+   `(ediff-current-diff-C ((,class (:foreground "black" :background "cyan"))))
+   `(ediff-even-diff-A ((,class (:foreground "black" :background "light grey"))))
+   `(ediff-even-diff-B ((,class (:foreground "black" :background "light grey"))))
    `(ediff-fine-diff-A ((,class (:foreground "#A60000" :background "#FFAAAA"))))
    `(ediff-fine-diff-B ((,class (:foreground "#008000" :background "#55FF55"))))
-   `(ediff-odd-diff-A ((,class (:foreground "black" :background "light grey" :extend t))))
-   `(ediff-odd-diff-B ((,class (:foreground "black" :background "light grey" :extend t))))
+   `(ediff-odd-diff-A ((,class (:foreground "black" :background "light grey"))))
+   `(ediff-odd-diff-B ((,class (:foreground "black" :background "light grey"))))
 
    ;; Flyspell
 ;; (when (version< emacs-version "24.XXX")
@@ -462,7 +462,7 @@ Semantic, and Ansi-Color faces are included -- and much more...")
    `(info-xref-visited ((,class (:underline t :foreground "magenta4")))) ; previously visited cross-references
    `(light-symbol-face ((,class (:background "#FFFFA0"))))
    `(linum ((,class (:inherit (default shadow) :foreground "#9A9A9A" :background "#EDEDED"))))
-   `(log-view-file ((,class (:foreground "#0000CC" :background "#EAF2F5" :extend t))))
+   `(log-view-file ((,class (:foreground "#0000CC" :background "#EAF2F5"))))
    `(lui-button-face ((,class ,link)))
    `(lui-highlight-face ((,class (:box '(:line-width 1 :color "#CC0000") :foreground "#CC0000" :background "#FFFF88")))) ; my nickname
    `(lui-time-stamp-face ((,class (:foreground "purple"))))
index e6d4a3a4b576dad3136d3e48acdc4be94ad0eb08..3060dcf09c724df40f4b6f5f98f57ff4dc0c0965 100644 (file)
@@ -36,8 +36,8 @@
    `(fringe ((,class (:background "gray85"))))
    ;; Highlighting faces
    `(highlight ((,class (:background "cyan"))))
-   `(region ((,class (:background "MediumAquamarine" :extend t))))
-   `(secondary-selection ((,class (:background "white" :foreground "black" :extend t))))
+   `(region ((,class (:background "MediumAquamarine"))))
+   `(secondary-selection ((,class (:background "white" :foreground "black"))))
    `(isearch ((,class (:background "green" :foreground "Black"))))
    `(lazy-highlight ((,class (:background "dark turquoise"))))
    `(query-replace ((,class (:inherit isearch :background "white" :foreground "black"))))
index 1313caa3c6e94c936bb58f4eb826ef1973568bb3..20e04cb7543948e8456ae1edb1dd63273daf12be 100644 (file)
@@ -435,11 +435,11 @@ jarring angry fruit salad look to reduce eye fatigue.")
  '(diary-button ((t (:background "lightgrey" :foreground "black"  :box (:line-width 2 :style released-button)))))
  '(diary-face ((t (:foreground "IndianRed"))))
  '(diary-time ((t (:foreground "LightGoldenrod"))))
- '(diff-added ((t (:foreground "Green" :extend t))))
+ '(diff-added ((t (:foreground "Green"))))
  '(diff-added-face ((t (:foreground "Green"))))
  '(diff-changed-face ((t (:foreground "Khaki"))))
  '(diff-context-face ((t (:foreground "grey70"))))
- '(diff-file-header ((t (:bold t :background "grey20"  :foreground "ivory1" :weight bold :extend t))))
+ '(diff-file-header ((t (:bold t :background "grey20"  :foreground "ivory1" :weight bold))))
  '(diff-file-header-face ((t (:bold t :background "grey20" :foreground "ivory1" :weight bold))))
  '(diff-function-face ((t (:foreground "SpringGreen1"))))
  '(diff-header-face ((t (:background "SlateBlue4"))))
@@ -448,7 +448,7 @@ jarring angry fruit salad look to reduce eye fatigue.")
  '(diff-index-face ((t (:bold t :weight bold :background "SteelBlue4" :foreground "linen" ))))
  '(diff-nonexistent ((t (:bold t :weight bold :background "Black" :foreground "Wheat1"))))
  '(diff-nonexistent-face ((t (:bold t :weight bold :background "Black" :foreground "Wheat1"))))
- '(diff-removed ((t (:foreground "salmon1" :extend t))))
+ '(diff-removed ((t (:foreground "salmon1"))))
  '(diff-removed-face ((t (:foreground "salmon1"))))
  '(diff-refine-change-face ((t (:background "MidnightBlue"))))
  '(diff-refine-change      ((t (:background "MidnightBlue"))))
@@ -511,7 +511,7 @@ jarring angry fruit salad look to reduce eye fatigue.")
  '(header-line ((t (:box (:line-width -1 :color "grey20" :style released-button) :background "grey20" :foreground "grey90"  :height 0.9))))
  '(help-argument-name ((t (:italic t :slant italic))))
  '(highlight ((t (:background "gray10" :foreground "Old Lace"))))
- '(hl-line  ((t (:background "grey10" :foreground "Old Lace" :extend t))))
+ '(hl-line  ((t (:background "grey10" :foreground "Old Lace"))))
  '(gnus-mouse-face ((t (:background "darkseagreen2" :foreground "blue"))))
  '(erc-button-mouse-face ((t (:background "darkseagreen2" :foreground "blue"))))
  '(align-highlight-change-face  ((t (:background "darkseagreen2" :foreground "blue"))))
@@ -601,7 +601,7 @@ jarring angry fruit salad look to reduce eye fatigue.")
  '(paren-mismatch-face ((t (:bold t :background "white" :foreground "red"))))
  '(paren-no-match-face ((t (:bold t :background "white" :foreground "red"))))
  '(query-replace ((t (:foreground "brown4" :background "palevioletred2"))))
- '(region ((t (:background "blue3" :extend t))))
+ '(region ((t (:background "blue3"))))
  '(realgud-overlay-arrow1        ((t (:foreground "medium sea green"))))
  '(realgud-overlay-arrow2        ((t (:foreground "white"))))
  '(realgud-overlay-arrow3        ((t (:foreground "indian red"))))
@@ -613,7 +613,7 @@ jarring angry fruit salad look to reduce eye fatigue.")
  '(realgud-line-number           ((t (:foreground "yellow"))))
  '(realgud-backtrace-number      ((t (:foreground "yellow" :weight bold))))
  '(scroll-bar ((t (:background "grey75" :foreground "WhiteSmoke"))))
- '(secondary-selection ((t (:background "SkyBlue4" :extend t))))
+ '(secondary-selection ((t (:background "SkyBlue4"))))
  '(semantic-dirty-token-face ((t (:background "lightyellow"))))
  '(semantic-highlight-edits-face ((t (:background "gray20"))))
  '(semantic-unmatched-syntax-face ((t (:underline "red"))))
@@ -631,10 +631,10 @@ jarring angry fruit salad look to reduce eye fatigue.")
  '(show-paren-match ((t (:background "steelblue3"))))
  '(show-paren-match-face ((t (:background "steelblue3"))))
  '(show-paren-mismatch ((t (:background "purple" :foreground "white"))))
- '(smerge-base ((t (:foreground "orange" :extend t))))
- '(smerge-markers ((t (:background "grey30" :extend t))))
- '(smerge-mine ((t (:foreground "cyan" :extend t))))
- '(smerge-other ((t (:foreground "lightgreen" :extend t))))
+ '(smerge-base ((t (:foreground "orange"))))
+ '(smerge-markers ((t (:background "grey30"))))
+ '(smerge-mine ((t (:foreground "cyan"))))
+ '(smerge-other ((t (:foreground "lightgreen"))))
  '(smerge-refined-change ((t (:background "blue4"))))
  '(speedbar-button-face ((t (:foreground "green3"))))
  '(speedbar-directory-face ((t (:foreground "light blue"))))
index c7e1dc983fb7491425388e68ecc765b0aac4f23d..727270c27f51ea6821bbfe6f134ec36bce6907b2 100644 (file)
@@ -37,7 +37,7 @@
    ;; Highlighting faces
    `(fringe ((,class (:background "#2e3748"))))
    `(highlight ((,class (:background "#338f86" :foreground "#e1e1e0"))))
-   `(region ((,class (:background "#2d4948" :foreground "#e1e1e0" :extend t))))
+   `(region ((,class (:background "#2d4948" :foreground "#e1e1e0"))))
    `(isearch ((,class (:background "#fcffad" :foreground "#000000"))))
    `(lazy-highlight ((,class (:background "#338f86"))))
    `(trailing-whitespace ((,class (:background "#ff4242"))))
index d2fdff8e091ad3ad37af8b65f6ccdfb94ec7030a..91256208a3f09c4f6bd05cd35d1f14e00d2fadb0 100644 (file)
@@ -61,8 +61,8 @@ Semantic, and Ansi-Color faces are included.")
    ;; Highlighting faces
    `(fringe ((,class (:background ,alum-7))))
    `(highlight ((,class (:foreground ,alum-6 :background "#c0c000"))))
-   `(region ((,class (:background ,alum-5 :extend t))))
-   `(secondary-selection ((,class (:background ,blue-3 :extend t))))
+   `(region ((,class (:background ,alum-5))))
+   `(secondary-selection ((,class (:background ,blue-3))))
    `(isearch ((,class (:foreground ,alum-1 :background ,orange-3))))
    `(lazy-highlight ((,class (:background ,choc-3))))
    `(trailing-whitespace ((,class (:background ,red-3))))
@@ -130,14 +130,14 @@ Semantic, and Ansi-Color faces are included.")
    ;; SMerge faces
    `(smerge-refined-change ((,class (:background ,blue-3))))
    ;; Ediff faces
-   `(ediff-current-diff-A ((,class (:background ,alum-5 :extend t))))
+   `(ediff-current-diff-A ((,class (:background ,alum-5))))
    `(ediff-fine-diff-A ((,class (:background ,blue-3))))
-   `(ediff-even-diff-A ((,class (:background ,alum-5.5 :extend t))))
-   `(ediff-odd-diff-A ((,class (:background ,alum-5.5 :extend t))))
-   `(ediff-current-diff-B ((,class (:background ,alum-5 :extend t))))
+   `(ediff-even-diff-A ((,class (:background ,alum-5.5))))
+   `(ediff-odd-diff-A ((,class (:background ,alum-5.5))))
+   `(ediff-current-diff-B ((,class (:background ,alum-5))))
    `(ediff-fine-diff-B ((,class (:background ,choc-3))))
-   `(ediff-even-diff-B ((,class (:background ,alum-5.5 :extend t))))
-   `(ediff-odd-diff-B ((,class (:background ,alum-5.5 :extend t))))
+   `(ediff-even-diff-B ((,class (:background ,alum-5.5))))
+   `(ediff-odd-diff-B ((,class (:background ,alum-5.5))))
    ;; Flyspell faces
    `(flyspell-duplicate ((,class (:underline ,orange-1))))
    `(flyspell-incorrect ((,class (:underline ,red-1))))
index c832192968a6d2dd0b35cf26250ae9a0ae9463b8..12d4db3fe7c5c480f84da9729ada9a6ac013e80f 100644 (file)
@@ -53,8 +53,8 @@ Semantic, and Ansi-Color faces are included.")
    ;; Highlighting faces
    `(fringe ((,class (:background ,alum-2))))
    `(highlight ((,class (:background ,alum-3))))
-   `(region ((,class (:background ,alum-3 :extend t))))
-   `(secondary-selection ((,class (:background ,blue-0 :extend t))))
+   `(region ((,class (:background ,alum-3))))
+   `(secondary-selection ((,class (:background ,blue-0))))
    `(isearch ((,class (:foreground "#ffffff" :background ,orange-3))))
    `(lazy-highlight ((,class (:background ,choc-1))))
    `(trailing-whitespace ((,class (:background ,red-1))))
@@ -117,9 +117,9 @@ Semantic, and Ansi-Color faces are included.")
    ;; SMerge
    `(smerge-refined-change ((,class (:background ,plum-1))))
    ;; Ediff
-   `(ediff-current-diff-A ((,class (:background ,blue-1 :extend t))))
+   `(ediff-current-diff-A ((,class (:background ,blue-1))))
    `(ediff-fine-diff-A ((,class (:background ,plum-1))))
-   `(ediff-current-diff-B ((,class (:background ,butter-1 :extend t))))
+   `(ediff-current-diff-B ((,class (:background ,butter-1))))
    `(ediff-fine-diff-B ((,class (:background ,orange-1))))
    ;; Flyspell
    `(flyspell-duplicate ((,class (:underline ,orange-1))))
index bd0564a21dcc2fec3148721a3d50ff3300c71d75..5482ced6b296a960ad7646a847a694eebd65f1f3 100644 (file)
  'tsdh-dark
  '(aw-leading-char-face ((t (:background "gray30" :foreground "red" :weight bold))))
  '(default ((t (:background "gray20" :foreground "white smoke"))))
- '(diff-added ((t (:inherit diff-changed :background "dark green" :extend t))) t)
+ '(diff-added ((t (:inherit diff-changed :background "dark green"))) t)
  '(diff-changed ((t (:background "midnight blue"))) t)
  '(diff-indicator-added ((t (:inherit diff-indicator-changed))) t)
  '(diff-indicator-changed ((t (:weight bold))) t)
  '(diff-indicator-removed ((t (:inherit diff-indicator-changed))) t)
- '(diff-removed ((t (:inherit diff-changed :background "dark red" :extend t))) t)
+ '(diff-removed ((t (:inherit diff-changed :background "dark red"))) t)
  '(dired-directory ((t (:foreground "DodgerBlue" :weight bold))))
  '(error ((t (:foreground "deep pink" :weight bold))))
  '(eshell-prompt ((t (:inherit font-lock-function-name-face :weight bold))))
@@ -69,7 +69,7 @@
  '(header-line ((t (:inverse-video t :box (:line-width -1 :color "red" :style released-button)))))
  '(helm-header ((t (:background "DeepSkyBlue4" :weight bold))))
  '(highlight ((t (:background "sea green"))))
- '(hl-line ((t (:background "grey25" :extend t))))
+ '(hl-line ((t (:background "grey25"))))
  '(hl-paren-face ((t (:weight bold))) t)
  '(icomplete-first-match ((t (:foreground "deep sky blue" :weight bold))))
  '(ido-first-match ((t (:foreground "turquoise" :weight bold))))
  '(rcirc-other-nick ((t (:foreground "dodger blue"))) t)
  '(rcirc-track-keyword ((t (:foreground "DodgerBlue" :weight bold))) t)
  '(rcirc-track-nick ((t (:background "yellow" :foreground "DodgerBlue" :weight bold))) t)
- '(region ((t (:background "SeaGreen4" :extend t))))
+ '(region ((t (:background "SeaGreen4"))))
  '(scroll-bar ((t (:background "gray20" :foreground "dark turquoise"))))
- '(secondary-selection ((t (:background "#333366" :foreground "#f6f3e8" :extend t))))
+ '(secondary-selection ((t (:background "#333366" :foreground "#f6f3e8"))))
  '(show-paren-match ((t (:background "DeepSkyBlue4"))))
  '(show-paren-mismatch ((t (:background "dark magenta"))))
  '(swiper-match-face-1 ((t (:background "gray35"))))
index efc49c1a2169ef4845eafc91e8d2b1d40412c538..8e6a79f8e36818accbcf7c15ad368928c6c356a8 100644 (file)
@@ -29,12 +29,12 @@ Used and created by Tassilo Horn.")
  '(Info-quoted ((t (:underline "gray40" :weight bold))))
  '(aw-leading-char-face ((t (:background "red" :foreground "white" :weight bold))))
  '(default ((t (:background "white" :foreground "black"))))
- '(diff-added ((t (:inherit diff-changed :background "light green" :extend t))))
+ '(diff-added ((t (:inherit diff-changed :background "light green"))))
  '(diff-changed ((t (:background "light steel blue"))))
  '(diff-indicator-added ((t (:inherit diff-indicator-changed))))
  '(diff-indicator-changed ((t (:weight bold))))
  '(diff-indicator-removed ((t (:inherit diff-indicator-changed))))
- '(diff-removed ((t (:inherit diff-changed :background "sandy brown" :extend t))))
+ '(diff-removed ((t (:inherit diff-changed :background "sandy brown"))))
  '(dired-directory ((t (:inherit font-lock-function-name-face :weight bold))))
  '(font-lock-builtin-face ((t (:foreground "#e44649"))))
  '(font-lock-comment-delimiter-face ((t (:inherit font-lock-comment-face :weight bold))))
@@ -62,7 +62,7 @@ Used and created by Tassilo Horn.")
  '(gnus-group-news-2-empty ((t (:foreground "tomato3"))))
  '(gnus-group-news-3 ((t (:inherit gnus-group-news-3-empty :weight bold))))
  '(gnus-group-news-3-empty ((t (:foreground "tomato2")))) '(header-line ((t (:inherit mode-line :inverse-video t))))
- '(hl-line ((t (:background "#f0f0f1" :extend t))))
+ '(hl-line ((t (:background "#f0f0f1"))))
  '(hl-paren-face ((t (:weight bold))) t)
  '(minibuffer-prompt ((t (:foreground "#0184bc" :box (:line-width -1 :style released-button) :weight bold))))
  '(mode-line ((t (:background "#f0f0f1" :box (:line-width 1 :color "#383a42")))))
index 2628b68ff06009879645e98a15d5252009d533e2..640343a33bc9974e3007b2b6a0ff643decaa8945 100644 (file)
@@ -40,8 +40,8 @@ of green, brown, and blue.")
    `(compilation-info ((,class (:foreground "ForestGreen"))))
    ;; Highlighting faces
    `(highlight ((,class (:foreground "white" :background "dark green"))))
-   `(region ((,class (:foreground "white" :background "dark green" :extend t))))
-   `(secondary-selection ((,class (:background "dark slate gray" :extend t))))
+   `(region ((,class (:foreground "white" :background "dark green"))))
+   `(secondary-selection ((,class (:background "dark slate gray"))))
    `(isearch ((,class (:foreground "white" :background "dark goldenrod"))))
    `(lazy-highlight ((,class (:background "gray25"))))
    ;; Font lock faces
index 0a5e87ac5855dbc940419df855344aac1da13ab5..c56700ffd9a37e8c0ce20d97cc86095290259d6e 100644 (file)
@@ -36,8 +36,8 @@ are included.")
    `(fringe ((,class (:background "#303030"))))
    `(highlight ((,class (:background "#454545" :foreground "#ffffff"
                         :underline t))))
-   `(region ((,class (:background "#444444" :foreground "#f6f3e8" :extend t))))
-   `(secondary-selection ((,class (:background "#333366" :foreground "#f6f3e8" :extend t))))
+   `(region ((,class (:background "#444444" :foreground "#f6f3e8"))))
+   `(secondary-selection ((,class (:background "#333366" :foreground "#f6f3e8"))))
    `(isearch ((,class (:background "#343434" :foreground "#857b6f"))))
    `(lazy-highlight ((,class (:background "#384048" :foreground "#a0a8b0"))))
    ;; Mode line faces
index dc5bcca7609617165a925adc8686418b79f50af9..0f31628f5f94c30a1bcb37de88f47ef8270b563a 100644 (file)
@@ -1669,7 +1669,7 @@ The following sources are applied in this order:
   ;; `theme-face' records.
   (let ((theme-faces (get face 'theme-face))
        (no-match-found 0)
-       face-attrs theme-face-applied)
+        default-attrs face-attrs theme-face-applied)
     (if theme-faces
        (dolist (elt (reverse theme-faces))
          (setq face-attrs (face-spec-choose (cadr elt) frame no-match-found))
@@ -1677,13 +1677,20 @@ The following sources are applied in this order:
            (face-spec-set-2 face frame face-attrs)
            (setq theme-face-applied t))))
     ;; If there was a spec applicable to FRAME, that overrides the
-    ;; defface spec entirely (rather than inheriting from it).  If
-    ;; there was no spec applicable to FRAME, apply the defface spec
-    ;; as well as any applicable X resources.
+    ;; defface spec entirely rather than inheriting from it, with the
+    ;; exception of the :extend attribute (which is inherited).
+    ;;
+    ;; If there was no spec applicable to FRAME, apply the defface
+    ;; spec as well as any applicable X resources.
+    (setq default-attrs (face-spec-choose (face-default-spec face) frame))
     (unless theme-face-applied
-      (setq face-attrs (face-spec-choose (face-default-spec face) frame))
-      (face-spec-set-2 face frame face-attrs)
+      (face-spec-set-2 face frame default-attrs)
       (make-face-x-resource-internal face frame))
+    (when (and theme-face-applied
+               (eq 'unspecified (face-attribute face :extend frame t)))
+      (let ((tail (plist-member default-attrs :extend)))
+        (and tail (face-spec-set-2 face frame
+                                   (list :extend (cadr tail))))))
     (setq face-attrs (face-spec-choose (get face 'face-override-spec) frame))
     (face-spec-set-2 face frame face-attrs)))
 
diff --git a/test/data/themes/faces-test-dark-theme.el b/test/data/themes/faces-test-dark-theme.el
new file mode 100644 (file)
index 0000000..2c11406
--- /dev/null
@@ -0,0 +1,33 @@
+;;; faces-test-dark-theme.el --- A dark theme from tests ;;; -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2019 Free Software Foundation, Inc.
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program.  If not, see <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;;; Code:
+
+(deftheme faces-test-dark
+  "")
+
+(custom-theme-set-faces
+ 'faces-test-dark
+ '(diff-added ((t (:foreground "Green" :extend t))))
+ '(diff-changed-face ((t (:foreground "Khaki"))))
+ '(diff-file-header-face ((t (:background "grey20" :foreground "ivory1")))))
+
+(provide-theme 'faces-test-dark)
+
+;;; faces-test-dark-theme.el ends here
diff --git a/test/data/themes/faces-test-light-theme.el b/test/data/themes/faces-test-light-theme.el
new file mode 100644 (file)
index 0000000..fc22d47
--- /dev/null
@@ -0,0 +1,32 @@
+;;; faces-test-light-theme.el --- A dark theme from tests ;;; -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2019 Free Software Foundation, Inc.
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program.  If not, see <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;;; Code:
+
+(deftheme faces-test-light
+  "")
+
+(custom-theme-set-faces
+ 'faces-test-light
+ '(diff-added ((t (:inherit diff-changed :background "light green" :extend t))))
+ '(diff-changed ((t (:background "light steel blue")))))
+
+(provide-theme 'faces-test-light)
+
+;;; faces-test-light-theme.el ends here
index 7cba4b26ebe8420717c7863f2235d8c96b86406a..eb8c533b8e63f37105af157a5fbadc7f019b6acc 100644 (file)
 (require 'ert)
 (require 'faces)
 
+(defvar faces--test-data-dir
+  (expand-file-name "../data/"
+                    (file-name-directory (or load-file-name
+                                             buffer-file-name))))
+
 (defgroup faces--test nil ""
   :group 'faces--test)
 
   (should (equal (face-attribute 'diff-changed-face :extend) t))
   (should (equal (face-attribute 'diff-added :extend) 'unspecified))
   (should (equal (face-attribute 'diff-file-header-face :extend) nil))
-  (load-theme 'manoj-dark t t)
-  (load-theme 'tsdh-light t t)
+  (add-to-list 'custom-theme-load-path (concat faces--test-data-dir "themes"))
+  (load-theme 'faces-test-dark t t)
+  (load-theme 'faces-test-light t t)
   (should (equal (face-attribute 'faces--test-inherit-extend :extend)
                  'unspecified))
   (should (equal (face-attribute 'faces--test-inherit-extend :extend nil t) t))
   (should (equal (face-attribute 'diff-changed-face :extend) t))
   (should (equal (face-attribute 'diff-added :extend) 'unspecified))
   (should (equal (face-attribute 'diff-file-header-face :extend) nil))
-  (enable-theme 'manoj-dark)
+  (enable-theme 'faces-test-dark)
   (should (equal (face-attribute 'faces--test-inherit-extend :extend)
                  'unspecified))
   (should (equal (face-attribute 'faces--test-inherit-extend :extend nil t) t))
                  'unspecified))
   (should (equal (face-attribute 'faces--test-inherit-no-extend :extend nil t)
                  nil))
-  (should (equal (face-attribute 'diff-changed-face :extend) 'unspecified)) ; should be t
+  (should (equal (face-attribute 'diff-changed-face :extend) t))
   (should (equal (face-attribute 'diff-added :extend) t))
-  (should (equal (face-attribute 'diff-file-header-face :extend) 'unspecified)) ; should be nil
+  (should (equal (face-attribute 'diff-file-header-face :extend) nil))
   (defface faces--test-face3
     '((t :inherit diff-added :weight bold))
     "")
   (should (equal (face-attribute 'faces--test-face3 :extend nil t) t))
-  (disable-theme 'manoj-dark)
+  (disable-theme 'faces-test-dark)
   (should (equal (face-attribute 'faces--test-inherit-extend :extend)
                  'unspecified))
   (should (equal (face-attribute 'faces--test-inherit-extend :extend nil t) t))
   (defface diff-indicator-changed
     '((t (:weight bold :extend t)))
     "")
-  (enable-theme 'tsdh-light)
+  (enable-theme 'faces-test-light)
   (should (equal (face-attribute 'faces--test-inherit-extend :extend)
                  'unspecified))
   (should (equal (face-attribute 'faces--test-inherit-extend :extend nil t) t))
   (should (equal (face-attribute 'diff-changed-face :extend) t))
   (should (equal (face-attribute 'diff-added :extend) t))
   (should (equal (face-attribute 'diff-file-header-face :extend) nil))
-  (should (equal (face-attribute 'diff-indicator-changed :extend) 'unspecified)) ; should be t
+  (should (equal (face-attribute 'diff-indicator-changed :extend) t))
   (should (equal (face-attribute 'faces--test-face3 :extend nil t) t))
   (frame-set-background-mode (selected-frame) 'dark)
   (should (equal (face-attribute 'faces--test-inherit-extend :extend)
   (should (equal (face-attribute 'diff-changed-face :extend) t))
   (should (equal (face-attribute 'diff-added :extend) t))
   (should (equal (face-attribute 'diff-file-header-face :extend) nil))
-  (should (equal (face-attribute 'diff-indicator-changed :extend) 'unspecified)) ; should be t
+  (should (equal (face-attribute 'diff-indicator-changed :extend) t))
   (should (equal (face-attribute 'faces--test-face3 :extend nil t) t))
   (or noninteractive
       (let ((fr (make-frame)))
         (should (equal (face-attribute 'diff-changed-face :extend fr) t))
         (should (equal (face-attribute 'diff-added :extend fr) t))
         (should (equal (face-attribute 'diff-file-header-face :extend fr) nil))
-        (should (equal (face-attribute 'diff-indicator-changed :extend fr)
-                       'unspecified)) ; should be t
+        (should (equal (face-attribute 'diff-indicator-changed :extend fr) t))
         (should (equal (face-attribute 'faces--test-face3 :extend nil t) t))
         ))
-  (disable-theme 'tsdh-light)
+  (disable-theme 'faces-test-light)
   (should (equal (face-attribute 'diff-indicator-changed :extend) t))
   (should (equal (face-attribute 'faces--test-face3 :extend nil t) 'unspecified))
   (or noninteractive