diff options
| author | Eli Zaretskii | 2015-02-08 20:09:19 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2015-02-08 20:09:19 +0200 |
| commit | a7b1c2f88f06bbeda16117c0aa1caffac1b4ebe1 (patch) | |
| tree | cb8bff6f88201dbd1c0e54735039eb6fbced0225 | |
| parent | 20c817d3657ec67792edafd75f34d829144e8590 (diff) | |
| download | emacs-a7b1c2f88f06bbeda16117c0aa1caffac1b4ebe1.tar.gz emacs-a7b1c2f88f06bbeda16117c0aa1caffac1b4ebe1.zip | |
Don't lose frame's background color when setting foreground (Bug#19802)
lisp/frame.el ((set-background-color, set-foreground-color): Pass the
other color, if defined, to face-set-after-frame-default.
| -rw-r--r-- | lisp/ChangeLog | 4 | ||||
| -rw-r--r-- | lisp/frame.el | 16 |
2 files changed, 16 insertions, 4 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 79e3378b2e8..728b9833c9f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -4,8 +4,8 @@ | |||
| 4 | frame parameters after calling tty-handle-reverse-video. Call | 4 | frame parameters after calling tty-handle-reverse-video. Call |
| 5 | face-set-after-frame-default with the actual parameters, to avoid | 5 | face-set-after-frame-default with the actual parameters, to avoid |
| 6 | resetting colors back to unspecified. | 6 | resetting colors back to unspecified. |
| 7 | (set-background-color, set-foreground-color): Pass the selected | 7 | (set-background-color, set-foreground-color): Pass the foreground |
| 8 | color to face-set-after-frame-default. (Bug#19802) | 8 | and background colors to face-set-after-frame-default. (Bug#19802) |
| 9 | 9 | ||
| 10 | 2015-02-06 Wolfgang Jenkner <wjenkner@inode.at> | 10 | 2015-02-06 Wolfgang Jenkner <wjenkner@inode.at> |
| 11 | 11 | ||
diff --git a/lisp/frame.el b/lisp/frame.el index eea5c24a82d..1a584fa0e2c 100644 --- a/lisp/frame.el +++ b/lisp/frame.el | |||
| @@ -1191,7 +1191,13 @@ To get the frame's current background color, use `frame-parameters'." | |||
| 1191 | (or window-system | 1191 | (or window-system |
| 1192 | (face-set-after-frame-default (selected-frame) | 1192 | (face-set-after-frame-default (selected-frame) |
| 1193 | (list | 1193 | (list |
| 1194 | (cons 'background-color color-name))))) | 1194 | (cons 'background-color color-name) |
| 1195 | ;; Pass the foreground-color as | ||
| 1196 | ;; well, if defined, to avoid | ||
| 1197 | ;; losing it when faces are reset | ||
| 1198 | ;; to their defaults. | ||
| 1199 | (assq 'foreground-color | ||
| 1200 | (frame-parameters)))))) | ||
| 1195 | 1201 | ||
| 1196 | (defun set-foreground-color (color-name) | 1202 | (defun set-foreground-color (color-name) |
| 1197 | "Set the foreground color of the selected frame to COLOR-NAME. | 1203 | "Set the foreground color of the selected frame to COLOR-NAME. |
| @@ -1203,7 +1209,13 @@ To get the frame's current foreground color, use `frame-parameters'." | |||
| 1203 | (or window-system | 1209 | (or window-system |
| 1204 | (face-set-after-frame-default (selected-frame) | 1210 | (face-set-after-frame-default (selected-frame) |
| 1205 | (list | 1211 | (list |
| 1206 | (cons 'foreground-color color-name))))) | 1212 | (cons 'foreground-color color-name) |
| 1213 | ;; Pass the background-color as | ||
| 1214 | ;; well, if defined, to avoid | ||
| 1215 | ;; losing it when faces are reset | ||
| 1216 | ;; to their defaults. | ||
| 1217 | (assq 'background-color | ||
| 1218 | (frame-parameters)))))) | ||
| 1207 | 1219 | ||
| 1208 | (defun set-cursor-color (color-name) | 1220 | (defun set-cursor-color (color-name) |
| 1209 | "Set the text cursor color of the selected frame to COLOR-NAME. | 1221 | "Set the text cursor color of the selected frame to COLOR-NAME. |