diff options
| author | Matthias Dahl | 2014-04-28 22:14:17 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2014-04-28 22:14:17 +0300 |
| commit | bc6953b32f993be10ff3429af5bacb7e18b08ae7 (patch) | |
| tree | 42748ef8286f9392853416097c8340fa2d1715bd | |
| parent | 4f5fa75591973935b59beb0b66ffbfcbc9ee63cc (diff) | |
| download | emacs-bc6953b32f993be10ff3429af5bacb7e18b08ae7.tar.gz emacs-bc6953b32f993be10ff3429af5bacb7e18b08ae7.zip | |
Fix bug 16694 with applying X resources to faces too early.
lisp/faces.el (face-spec-recalc): Apply X resources only after the
defface spec has been applied. Thus, X resources are no longer
overriden by the defface spec which also fixes issues on win32 where
the toolbar coloring was wrong because it is set through X resources
and was (wrongfully) overriden.
| -rw-r--r-- | lisp/ChangeLog | 8 | ||||
| -rw-r--r-- | lisp/faces.el | 18 |
2 files changed, 20 insertions, 6 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e27d7b1c6a0..26516fd2cd3 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,11 @@ | |||
| 1 | 2014-04-27 Matthias Dahl <matthias.dahl@binary-island.eu> | ||
| 2 | |||
| 3 | * faces.el (face-spec-recalc): Apply X resources only after the | ||
| 4 | the defface spec has been applied. Thus, X resources are no longer | ||
| 5 | overriden by the defface spec which also fixes issues on win32 where | ||
| 6 | the toolbar coloring was wrong because it is set through X resources | ||
| 7 | and was (wrongfully) overriden. (Bug#16694) | ||
| 8 | |||
| 1 | 2014-04-28 Stefan Monnier <monnier@iro.umontreal.ca> | 9 | 2014-04-28 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 10 | ||
| 3 | * textmodes/rst.el (electric-pair-pairs): Declare. | 11 | * textmodes/rst.el (electric-pair-pairs): Declare. |
diff --git a/lisp/faces.el b/lisp/faces.el index 88b87486f7c..df31e0dfbd8 100644 --- a/lisp/faces.el +++ b/lisp/faces.el | |||
| @@ -1641,18 +1641,22 @@ function for its other effects." | |||
| 1641 | 1641 | ||
| 1642 | (defun face-spec-recalc (face frame) | 1642 | (defun face-spec-recalc (face frame) |
| 1643 | "Reset the face attributes of FACE on FRAME according to its specs. | 1643 | "Reset the face attributes of FACE on FRAME according to its specs. |
| 1644 | After the reset, the specs are applied from the following sources in this order: | 1644 | The following sources are applied in this order: |
| 1645 | X resources (if applicable) | 1645 | |
| 1646 | face reset to default values if it's the default face, otherwise set | ||
| 1647 | to unspecifed (through `face-spec-reset-face`) | ||
| 1646 | | | 1648 | | |
| 1647 | (theme and user customization) | 1649 | (theme and user customization) |
| 1648 | or, if nonexistent or does not match the current frame, | 1650 | or: if none of the above exist, do not match the current frame or |
| 1651 | did inherit from the defface spec instead of overwriting it | ||
| 1652 | entirely, the following is applied instead: | ||
| 1649 | (defface default spec) | 1653 | (defface default spec) |
| 1654 | (X resources (if applicable)) | ||
| 1650 | | | 1655 | | |
| 1651 | defface override spec" | 1656 | defface override spec" |
| 1652 | (while (get face 'face-alias) | 1657 | (while (get face 'face-alias) |
| 1653 | (setq face (get face 'face-alias))) | 1658 | (setq face (get face 'face-alias))) |
| 1654 | (face-spec-reset-face face frame) | 1659 | (face-spec-reset-face face frame) |
| 1655 | (make-face-x-resource-internal face frame) | ||
| 1656 | ;; If FACE is customized or themed, set the custom spec from | 1660 | ;; If FACE is customized or themed, set the custom spec from |
| 1657 | ;; `theme-face' records. | 1661 | ;; `theme-face' records. |
| 1658 | (let ((theme-faces (get face 'theme-face)) | 1662 | (let ((theme-faces (get face 'theme-face)) |
| @@ -1666,10 +1670,12 @@ After the reset, the specs are applied from the following sources in this order: | |||
| 1666 | (setq theme-face-applied t)))) | 1670 | (setq theme-face-applied t)))) |
| 1667 | ;; If there was a spec applicable to FRAME, that overrides the | 1671 | ;; If there was a spec applicable to FRAME, that overrides the |
| 1668 | ;; defface spec entirely (rather than inheriting from it). If | 1672 | ;; defface spec entirely (rather than inheriting from it). If |
| 1669 | ;; there was no spec applicable to FRAME, apply the defface spec. | 1673 | ;; there was no spec applicable to FRAME, apply the defface spec |
| 1674 | ;; as well as any applicable X resources. | ||
| 1670 | (unless theme-face-applied | 1675 | (unless theme-face-applied |
| 1671 | (setq spec (face-spec-choose (face-default-spec face) frame)) | 1676 | (setq spec (face-spec-choose (face-default-spec face) frame)) |
| 1672 | (face-spec-set-2 face frame spec)) | 1677 | (face-spec-set-2 face frame spec) |
| 1678 | (make-face-x-resource-internal face frame)) | ||
| 1673 | (setq spec (face-spec-choose (get face 'face-override-spec) frame)) | 1679 | (setq spec (face-spec-choose (get face 'face-override-spec) frame)) |
| 1674 | (face-spec-set-2 face frame spec))) | 1680 | (face-spec-set-2 face frame spec))) |
| 1675 | 1681 | ||