From: Juri Linkov <juri@jurta.org>
Cc: emacs-devel@gnu.org, merlyn@stonehenge.com
Subject: Re: Diff mode faces
Date: Sun, 19 Jun 2005 16:09:47 +0300 [thread overview]
Message-ID: <87psuiqzcj.fsf@jurta.org> (raw)
In-Reply-To: <uvf4bzk7l.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 18 Jun 2005 18:46:38 +0200")
>> Cc: Eli Zaretskii <eliz@gnu.org>, emacs-devel@gnu.org
>> From: merlyn@stonehenge.com (Randal L. Schwartz)
>> Date: 18 Jun 2005 08:27:12 -0700
>>
>> Is there no way to switch automatically to a proper set of darker
>> colors when the main text is black instead of white?
>
> Yes, it's called background-mode.
I see there is one problem with background-mode on tty. Unlike X,
on tty Emacs doesn't adjust background-mode after changing the
background color with any of the known methods: `set-background-color'
command, or customizing the background color of the default face.
It seems the correct place to fix this is `modify-frame-parameters'.
The call to Qframe_update_face_colors is duplicated from the function
`update_face_from_frame_parameter' in the patch below. With this change
`frame-set-background-mode' gets called, so it updates background-mode
after every change of the background color on tty.
Index: src/frame.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/frame.c,v
retrieving revision 1.316
diff -u -r1.316 frame.c
--- src/frame.c 10 Jun 2005 02:22:11 -0000 1.316
+++ src/frame.c 19 Jun 2005 11:42:05 -0000
@@ -2313,6 +2313,13 @@
prop = parms[i];
val = values[i];
store_frame_param (f, prop, val);
+
+ if (EQ (prop, Qbackground_color)) {
+ /* Changing the background color might change the background
+ mode, so that we have to load new defface specs. Call
+ frame-update-face-colors to do that. */
+ call1 (Qframe_update_face_colors, frame);
+ }
}
}
Index: src/dispextern.h
===================================================================
RCS file: /cvsroot/emacs/emacs/src/dispextern.h,v
retrieving revision 1.202
diff -u -r1.202 dispextern.h
--- src/dispextern.h 17 Jun 2005 14:02:03 -0000 1.202
+++ src/dispextern.h 19 Jun 2005 11:43:31 -0000
@@ -2793,6 +2793,7 @@
int merge_faces P_ ((struct frame *, Lisp_Object, int, int));
int compute_char_face P_ ((struct frame *, int, Lisp_Object));
void free_all_realized_faces P_ ((Lisp_Object));
+extern Lisp_Object Qframe_update_face_colors;
extern Lisp_Object Qforeground_color, Qbackground_color;
extern char unspecified_fg[], unspecified_bg[];
void free_realized_multibyte_face P_ ((struct frame *, int));
--
Juri Linkov
http://www.jurta.org/emacs/
next prev parent reply other threads:[~2005-06-19 13:09 UTC|newest]
Thread overview: 59+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-06-17 11:47 Diff mode faces Juri Linkov
2005-06-17 13:11 ` Jason Rumney
2005-06-17 14:28 ` Stefan Monnier
2005-06-18 13:54 ` Juri Linkov
2005-06-17 14:34 ` Eli Zaretskii
2005-06-18 13:57 ` Juri Linkov
2005-06-18 15:27 ` Randal L. Schwartz
2005-06-18 16:46 ` Eli Zaretskii
2005-06-19 13:09 ` Juri Linkov [this message]
2005-06-19 19:58 ` Eli Zaretskii
2005-06-20 4:48 ` Juri Linkov
2005-06-20 20:18 ` Eli Zaretskii
2005-06-21 16:28 ` Background mode (was: Diff mode faces) Juri Linkov
2005-06-27 0:03 ` Background mode Juri Linkov
2005-06-27 16:46 ` Richard M. Stallman
2005-06-27 23:52 ` Juri Linkov
2005-06-28 18:47 ` Richard M. Stallman
2005-06-29 3:55 ` Stefan Monnier
2005-06-29 22:21 ` Miles Bader
2005-06-30 17:45 ` Stefan Monnier
2005-07-01 4:03 ` Richard M. Stallman
2005-07-01 15:01 ` Stefan Monnier
2005-06-27 23:55 ` Juri Linkov
2005-06-19 13:05 ` Diff mode faces Juri Linkov
2005-06-19 17:10 ` Luc Teirlinck
2005-06-19 17:34 ` Randal L. Schwartz
2005-06-27 23:55 ` Juri Linkov
2005-06-28 4:57 ` Miles Bader
2005-07-01 23:59 ` Juri Linkov
2005-07-02 3:37 ` Miles Bader
2005-07-05 19:11 ` Richard M. Stallman
2005-07-06 20:53 ` Juri Linkov
2005-07-07 4:05 ` Miles Bader
2005-07-07 6:03 ` Juri Linkov
2005-07-07 4:42 ` Eli Zaretskii
2005-07-09 20:56 ` Juri Linkov
2005-07-10 3:34 ` Eli Zaretskii
2005-07-11 0:06 ` Juri Linkov
2005-07-11 13:43 ` Stefan Monnier
2005-07-11 19:37 ` Eli Zaretskii
2005-07-11 19:46 ` Stefan Monnier
2005-07-12 3:33 ` Eli Zaretskii
2005-07-12 6:51 ` Juri Linkov
2005-07-16 11:17 ` Eli Zaretskii
2005-06-28 13:10 ` Randal L. Schwartz
2005-06-30 21:30 ` Richard M. Stallman
2005-06-30 21:30 ` Richard M. Stallman
2005-07-01 10:13 ` Eli Zaretskii
2005-07-01 23:59 ` Juri Linkov
2005-07-03 18:56 ` xterm colors (was: Diff mode faces) Gaëtan LEURENT
2005-07-04 5:59 ` Eli Zaretskii
2005-07-04 6:17 ` Richard M. Stallman
2005-07-01 23:59 ` Diff mode faces Juri Linkov
2005-06-20 0:25 ` Miles Bader
2005-06-18 2:21 ` Richard Stallman
2005-06-18 13:54 ` Juri Linkov
2005-06-19 3:51 ` Richard Stallman
2005-06-19 14:05 ` Juri Linkov
2005-06-20 3:50 ` Richard Stallman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87psuiqzcj.fsf@jurta.org \
--to=juri@jurta.org \
--cc=emacs-devel@gnu.org \
--cc=merlyn@stonehenge.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.