diff options
| author | Dmitry Gutov | 2019-12-10 02:11:15 +0200 |
|---|---|---|
| committer | Dmitry Gutov | 2019-12-10 02:16:44 +0200 |
| commit | 58fb4c3e68a4a42ad491d0fa2c084e5c39942e2b (patch) | |
| tree | efe7a9e6a1b8f76cee65ecd59eb00d9d1e0d1838 /lisp | |
| parent | d8d537e17349c02d981eabd92c78f60f73354798 (diff) | |
| download | emacs-58fb4c3e68a4a42ad491d0fa2c084e5c39942e2b.tar.gz emacs-58fb4c3e68a4a42ad491d0fa2c084e5c39942e2b.zip | |
Make ':extend' inherited from default spec unless overridden
* 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.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/faces.el | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/lisp/faces.el b/lisp/faces.el index dc5bcca7609..0f31628f5f9 100644 --- a/lisp/faces.el +++ b/lisp/faces.el | |||
| @@ -1669,7 +1669,7 @@ The following sources are applied in this order: | |||
| 1669 | ;; `theme-face' records. | 1669 | ;; `theme-face' records. |
| 1670 | (let ((theme-faces (get face 'theme-face)) | 1670 | (let ((theme-faces (get face 'theme-face)) |
| 1671 | (no-match-found 0) | 1671 | (no-match-found 0) |
| 1672 | face-attrs theme-face-applied) | 1672 | default-attrs face-attrs theme-face-applied) |
| 1673 | (if theme-faces | 1673 | (if theme-faces |
| 1674 | (dolist (elt (reverse theme-faces)) | 1674 | (dolist (elt (reverse theme-faces)) |
| 1675 | (setq face-attrs (face-spec-choose (cadr elt) frame no-match-found)) | 1675 | (setq face-attrs (face-spec-choose (cadr elt) frame no-match-found)) |
| @@ -1677,13 +1677,20 @@ The following sources are applied in this order: | |||
| 1677 | (face-spec-set-2 face frame face-attrs) | 1677 | (face-spec-set-2 face frame face-attrs) |
| 1678 | (setq theme-face-applied t)))) | 1678 | (setq theme-face-applied t)))) |
| 1679 | ;; If there was a spec applicable to FRAME, that overrides the | 1679 | ;; If there was a spec applicable to FRAME, that overrides the |
| 1680 | ;; defface spec entirely (rather than inheriting from it). If | 1680 | ;; defface spec entirely rather than inheriting from it, with the |
| 1681 | ;; there was no spec applicable to FRAME, apply the defface spec | 1681 | ;; exception of the :extend attribute (which is inherited). |
| 1682 | ;; as well as any applicable X resources. | 1682 | ;; |
| 1683 | ;; If there was no spec applicable to FRAME, apply the defface | ||
| 1684 | ;; spec as well as any applicable X resources. | ||
| 1685 | (setq default-attrs (face-spec-choose (face-default-spec face) frame)) | ||
| 1683 | (unless theme-face-applied | 1686 | (unless theme-face-applied |
| 1684 | (setq face-attrs (face-spec-choose (face-default-spec face) frame)) | 1687 | (face-spec-set-2 face frame default-attrs) |
| 1685 | (face-spec-set-2 face frame face-attrs) | ||
| 1686 | (make-face-x-resource-internal face frame)) | 1688 | (make-face-x-resource-internal face frame)) |
| 1689 | (when (and theme-face-applied | ||
| 1690 | (eq 'unspecified (face-attribute face :extend frame t))) | ||
| 1691 | (let ((tail (plist-member default-attrs :extend))) | ||
| 1692 | (and tail (face-spec-set-2 face frame | ||
| 1693 | (list :extend (cadr tail)))))) | ||
| 1687 | (setq face-attrs (face-spec-choose (get face 'face-override-spec) frame)) | 1694 | (setq face-attrs (face-spec-choose (get face 'face-override-spec) frame)) |
| 1688 | (face-spec-set-2 face frame face-attrs))) | 1695 | (face-spec-set-2 face frame face-attrs))) |
| 1689 | 1696 | ||