diff options
| author | Eli Zaretskii | 2015-02-08 18:17:40 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2015-02-08 18:17:40 +0200 |
| commit | 20c817d3657ec67792edafd75f34d829144e8590 (patch) | |
| tree | da827bd286e203891f0f5b15409d635e24c21195 /lisp | |
| parent | eca7da109248c40963c285417b878a8abcd84049 (diff) | |
| download | emacs-20c817d3657ec67792edafd75f34d829144e8590.tar.gz emacs-20c817d3657ec67792edafd75f34d829144e8590.zip | |
Fix handling of frame color parameters in TTY sessions (Bug#19802)
src/xfaces.c (map_tty_color): Use assoc_no_quit instead of
assq_no_quit to fetch color definition by its string name.
lisp/frame.el (frame-notice-user-settings): Refresh the value of
frame parameters after calling tty-handle-reverse-video. Call
face-set-after-frame-default with the actual parameters, to avoid
resetting colors back to unspecified.
(set-background-color, set-foreground-color): Pass the selected
color to face-set-after-frame-default.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 9 | ||||
| -rw-r--r-- | lisp/frame.el | 14 |
2 files changed, 20 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 17b3d112432..79e3378b2e8 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,12 @@ | |||
| 1 | 2015-02-08 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * frame.el (frame-notice-user-settings): Refresh the value of | ||
| 4 | frame parameters after calling tty-handle-reverse-video. Call | ||
| 5 | face-set-after-frame-default with the actual parameters, to avoid | ||
| 6 | resetting colors back to unspecified. | ||
| 7 | (set-background-color, set-foreground-color): Pass the selected | ||
| 8 | color to face-set-after-frame-default. (Bug#19802) | ||
| 9 | |||
| 1 | 2015-02-06 Wolfgang Jenkner <wjenkner@inode.at> | 10 | 2015-02-06 Wolfgang Jenkner <wjenkner@inode.at> |
| 2 | 11 | ||
| 3 | * net/network-stream.el (network-stream-open-tls): Respect the | 12 | * net/network-stream.el (network-stream-open-tls): Respect the |
diff --git a/lisp/frame.el b/lisp/frame.el index c77df558da8..eea5c24a82d 100644 --- a/lisp/frame.el +++ b/lisp/frame.el | |||
| @@ -251,6 +251,10 @@ there (in decreasing order of priority)." | |||
| 251 | (let ((newparms (frame-parameters)) | 251 | (let ((newparms (frame-parameters)) |
| 252 | (frame (selected-frame))) | 252 | (frame (selected-frame))) |
| 253 | (tty-handle-reverse-video frame newparms) | 253 | (tty-handle-reverse-video frame newparms) |
| 254 | ;; tty-handle-reverse-video might change the frame's | ||
| 255 | ;; color parameters, and we need to use the updated | ||
| 256 | ;; value below. | ||
| 257 | (setq newparms (frame-parameters)) | ||
| 254 | ;; If we changed the background color, we need to update | 258 | ;; If we changed the background color, we need to update |
| 255 | ;; the background-mode parameter, and maybe some faces, | 259 | ;; the background-mode parameter, and maybe some faces, |
| 256 | ;; too. | 260 | ;; too. |
| @@ -258,7 +262,7 @@ there (in decreasing order of priority)." | |||
| 258 | (unless (or (assq 'background-mode initial-frame-alist) | 262 | (unless (or (assq 'background-mode initial-frame-alist) |
| 259 | (assq 'background-mode default-frame-alist)) | 263 | (assq 'background-mode default-frame-alist)) |
| 260 | (frame-set-background-mode frame)) | 264 | (frame-set-background-mode frame)) |
| 261 | (face-set-after-frame-default frame)))))) | 265 | (face-set-after-frame-default frame newparms)))))) |
| 262 | 266 | ||
| 263 | ;; If the initial frame is still around, apply initial-frame-alist | 267 | ;; If the initial frame is still around, apply initial-frame-alist |
| 264 | ;; and default-frame-alist to it. | 268 | ;; and default-frame-alist to it. |
| @@ -1185,7 +1189,9 @@ To get the frame's current background color, use `frame-parameters'." | |||
| 1185 | (modify-frame-parameters (selected-frame) | 1189 | (modify-frame-parameters (selected-frame) |
| 1186 | (list (cons 'background-color color-name))) | 1190 | (list (cons 'background-color color-name))) |
| 1187 | (or window-system | 1191 | (or window-system |
| 1188 | (face-set-after-frame-default (selected-frame)))) | 1192 | (face-set-after-frame-default (selected-frame) |
| 1193 | (list | ||
| 1194 | (cons 'background-color color-name))))) | ||
| 1189 | 1195 | ||
| 1190 | (defun set-foreground-color (color-name) | 1196 | (defun set-foreground-color (color-name) |
| 1191 | "Set the foreground color of the selected frame to COLOR-NAME. | 1197 | "Set the foreground color of the selected frame to COLOR-NAME. |
| @@ -1195,7 +1201,9 @@ To get the frame's current foreground color, use `frame-parameters'." | |||
| 1195 | (modify-frame-parameters (selected-frame) | 1201 | (modify-frame-parameters (selected-frame) |
| 1196 | (list (cons 'foreground-color color-name))) | 1202 | (list (cons 'foreground-color color-name))) |
| 1197 | (or window-system | 1203 | (or window-system |
| 1198 | (face-set-after-frame-default (selected-frame)))) | 1204 | (face-set-after-frame-default (selected-frame) |
| 1205 | (list | ||
| 1206 | (cons 'foreground-color color-name))))) | ||
| 1199 | 1207 | ||
| 1200 | (defun set-cursor-color (color-name) | 1208 | (defun set-cursor-color (color-name) |
| 1201 | "Set the text cursor color of the selected frame to COLOR-NAME. | 1209 | "Set the text cursor color of the selected frame to COLOR-NAME. |