unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Same 'face' spec initialized to different values for x and terminal
@ 2007-06-03 20:56 Leo
  2007-06-03 21:05 ` Eli Zaretskii
  0 siblings, 1 reply; 10+ messages in thread
From: Leo @ 2007-06-03 20:56 UTC (permalink / raw)
  To: emacs-devel

Hi Emacs developers,

The following 'face' is extracted from 'dictem.el¹'

(defface dictem-database-description-face
  '((((background light)) (:bold t :foreground "darkblue"))
    (((background dark))  (:bold t :foreground "white")))

  "The face that is used for displaying a database description"
  :group 'dictem-faces)

In X, start 'emacs -q -l dictem.el':

dictem-database-description-face is initialized to:
               ......
        Weight: bold
         Slant: unspecified
    Foreground: darkblue
               ......

In Xterm, start 'emacs -nw -q -l dictem.el':
               ......
        Weight: bold
         Slant: unspecified
    Foreground: white
               ......

*NB*: emacs has a light background in both x and xterm. Thus it looks
 very weird the aforementioned face is initialized to the dark
 background value.

Tested in GNU Emacs 23.0.0.6 (i686-pc-linux-gnu, X toolkit) of
2007-05-31.

Footnotes: 
¹  http://mova.org/~cheusov/pub/dictem
-- 
Leo <sdl.web AT gmail.com>                         (GPG Key: 9283AA3F)

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Same 'face' spec initialized to different values for x and terminal
  2007-06-03 20:56 Same 'face' spec initialized to different values for x and terminal Leo
@ 2007-06-03 21:05 ` Eli Zaretskii
  2007-06-03 21:20   ` Leo
                     ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Eli Zaretskii @ 2007-06-03 21:05 UTC (permalink / raw)
  To: Leo; +Cc: emacs-devel

> From: Leo <sdl.web@gmail.com>
> Date: Sun, 03 Jun 2007 21:56:18 +0100
> 
> *NB*: emacs has a light background in both x and xterm. Thus it looks
>  very weird the aforementioned face is initialized to the dark
>  background value.

Emacs cannot determine the background color on a text terminal, so it
assumes something.  Without -nw, Emacs queries the window system about
the default color, so it can adjust its background mode.

Try setting frame-background-mode to 'light in the xterm case, and I
think you will have the colors that you want.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Same 'face' spec initialized to different values for x and terminal
  2007-06-03 21:05 ` Eli Zaretskii
@ 2007-06-03 21:20   ` Leo
  2007-06-03 21:23   ` Juri Linkov
  2007-06-04 15:40   ` Leo
  2 siblings, 0 replies; 10+ messages in thread
From: Leo @ 2007-06-03 21:20 UTC (permalink / raw)
  To: emacs-devel

----- Eli Zaretskii (2007-06-03) wrote:-----

>> From: Leo <sdl.web@gmail.com>
>> Date: Sun, 03 Jun 2007 21:56:18 +0100
>> 
>> *NB*: emacs has a light background in both x and xterm. Thus it looks
>>  very weird the aforementioned face is initialized to the dark
>>  background value.
>
> Emacs cannot determine the background color on a text terminal, so it
> assumes something.  Without -nw, Emacs queries the window system about
> the default color, so it can adjust its background mode.

I understand this.

But all other faces are correctly set for example, those in org.el. If I
set the spec to:

(defface dictem-database-description-face
  '((((background light)) (:weight bold :foreground "darkblue"))
    (((background dark))  (:weight bold :foreground "white")))

  "The face that is used for displaying a database description"
  :group 'dictem-faces)

It will initialize correctly in both xterm and X.

Seems there is a bug in Emacs.

> Try setting frame-background-mode to 'light in the xterm case, and I
> think you will have the colors that you want.

-- 
Leo <sdl.web AT gmail.com>                         (GPG Key: 9283AA3F)

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Same 'face' spec initialized to different values for x and terminal
  2007-06-03 21:05 ` Eli Zaretskii
  2007-06-03 21:20   ` Leo
@ 2007-06-03 21:23   ` Juri Linkov
  2007-06-03 21:34     ` Andreas Schwab
  2007-06-04 15:40   ` Leo
  2 siblings, 1 reply; 10+ messages in thread
From: Juri Linkov @ 2007-06-03 21:23 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Leo, emacs-devel

>>  emacs has a light background in both x and xterm. Thus it looks
>>  very weird the aforementioned face is initialized to the dark
>>  background value.
>
> Emacs cannot determine the background color on a text terminal, so it
> assumes something.  Without -nw, Emacs queries the window system about
> the default color, so it can adjust its background mode.
>
> Try setting frame-background-mode to 'light in the xterm case, and I
> think you will have the colors that you want.

Interesting.  I use dictem.el on both X and xterm and don't have the
reported problem.  On xterm, Emacs correctly determines the background
color of this face.

On closer investigation, I discovered that Emacs doesn't determine
the background mode only when dictem.el is loaded from the command line
with `-nw -l dictem.el', as Leo did according to his report.

Really, when started only with `-nw' and without `-l dictem.el',
and later loading dictem.el with (load "dictem.el"),
default-frame-background-mode is 'light.

But

emacs --batch --eval '(message "mode: %s" default-frame-background-mode)'

prints

mode: nil

-- 
Juri Linkov
http://www.jurta.org/emacs/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Same 'face' spec initialized to different values for x and terminal
  2007-06-03 21:23   ` Juri Linkov
@ 2007-06-03 21:34     ` Andreas Schwab
  2007-06-03 21:57       ` Juri Linkov
  0 siblings, 1 reply; 10+ messages in thread
From: Andreas Schwab @ 2007-06-03 21:34 UTC (permalink / raw)
  To: Juri Linkov; +Cc: Eli Zaretskii, Leo, emacs-devel

Juri Linkov <juri@jurta.org> writes:

> But
>
> emacs --batch --eval '(message "mode: %s" default-frame-background-mode)'
>
> prints
>
> mode: nil

The background mode is only initialized in non-batch mode (in
normal-top-level or in the terminal init file).

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Same 'face' spec initialized to different values for x and terminal
  2007-06-03 21:34     ` Andreas Schwab
@ 2007-06-03 21:57       ` Juri Linkov
  2007-06-03 22:35         ` Andreas Schwab
  0 siblings, 1 reply; 10+ messages in thread
From: Juri Linkov @ 2007-06-03 21:57 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: eliz, sdl.web, emacs-devel

>> emacs --batch --eval '(message "mode: %s" default-frame-background-mode)'
>>
>> prints
>>
>> mode: nil
>
> The background mode is only initialized in non-batch mode (in
> normal-top-level or in the terminal init file).

It doesn't determine the background mode even in non-batch mode:

emacs -q -nw --eval '(message "mode: %s" default-frame-background-mode)'

displays in the echo area just after start on the text terminal:

mode: nil

whereas evaluating it in Emacs displays:

mode: light

-- 
Juri Linkov
http://www.jurta.org/emacs/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Same 'face' spec initialized to different values for x and terminal
  2007-06-03 21:57       ` Juri Linkov
@ 2007-06-03 22:35         ` Andreas Schwab
  0 siblings, 0 replies; 10+ messages in thread
From: Andreas Schwab @ 2007-06-03 22:35 UTC (permalink / raw)
  To: Juri Linkov; +Cc: eliz, sdl.web, emacs-devel

Juri Linkov <juri@jurta.org> writes:

> It doesn't determine the background mode even in non-batch mode:
>
> emacs -q -nw --eval '(message "mode: %s" default-frame-background-mode)'

command-line is called first.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Same 'face' spec initialized to different values for x and terminal
  2007-06-03 21:05 ` Eli Zaretskii
  2007-06-03 21:20   ` Leo
  2007-06-03 21:23   ` Juri Linkov
@ 2007-06-04 15:40   ` Leo
  2007-06-04 16:16     ` Dan Nicolaescu
  2 siblings, 1 reply; 10+ messages in thread
From: Leo @ 2007-06-04 15:40 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

Dear Eli,

----- Eli Zaretskii (2007-06-03) wrote:-----

>> From: Leo <sdl.web@gmail.com>
>> Date: Sun, 03 Jun 2007 21:56:18 +0100
>> 
>> *NB*: emacs has a light background in both x and xterm. Thus it looks
>>  very weird the aforementioned face is initialized to the dark
>>  background value.
>
> Emacs cannot determine the background color on a text terminal, so it
> assumes something.  Without -nw, Emacs queries the window system about
> the default color, so it can adjust its background mode.
>
> Try setting frame-background-mode to 'light in the xterm case, and I
> think you will have the colors that you want.

There are altogether 5 faces defined in dictem.el.

With "emacs -nw -q -l dictem.el" in xterm, two of them initialize to
light background values and three of them to dark background values:

              .----------------------------------+-------.
              | dictem-reference-definition-face | light |
              |----------------------------------+-------|
              | dictem-reference-m1-face         | light |
              |----------------------------------+-------|
              | dictem-reference-m2-face         | dark  |
              |----------------------------------+-------|
              | dictem-reference-dbname-face     | dark  |
              |----------------------------------+-------|
              | dictem-database-description-face | dark  |
              `----------------------------------+-------'

Whatever emacs assumes for its background mode, something is wrong. I
hope someone can see this problem and fix it.

regards,
-- 
Leo <sdl.web AT gmail.com>                         (GPG Key: 9283AA3F)

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Same 'face' spec initialized to different values for x and terminal
  2007-06-04 15:40   ` Leo
@ 2007-06-04 16:16     ` Dan Nicolaescu
  2007-09-13 16:43       ` Leo
  0 siblings, 1 reply; 10+ messages in thread
From: Dan Nicolaescu @ 2007-06-04 16:16 UTC (permalink / raw)
  To: Leo; +Cc: Eli Zaretskii, emacs-devel

Leo <sdl.web@gmail.com> writes:

  > Dear Eli,
  > 
  > ----- Eli Zaretskii (2007-06-03) wrote:-----
  > 
  > >> From: Leo <sdl.web@gmail.com>
  > >> Date: Sun, 03 Jun 2007 21:56:18 +0100
  > >> 
  > >> *NB*: emacs has a light background in both x and xterm. Thus it looks
  > >>  very weird the aforementioned face is initialized to the dark
  > >>  background value.
  > >
  > > Emacs cannot determine the background color on a text terminal, so it
  > > assumes something.  Without -nw, Emacs queries the window system about
  > > the default color, so it can adjust its background mode.
  > >
  > > Try setting frame-background-mode to 'light in the xterm case, and I
  > > think you will have the colors that you want.
  > 
  > There are altogether 5 faces defined in dictem.el.
  > 
  > With "emacs -nw -q -l dictem.el" in xterm, two of them initialize to
  > light background values and three of them to dark background values:
  > 
  >               .----------------------------------+-------.
  >               | dictem-reference-definition-face | light |
  >               |----------------------------------+-------|
  >               | dictem-reference-m1-face         | light |
  >               |----------------------------------+-------|
  >               | dictem-reference-m2-face         | dark  |
  >               |----------------------------------+-------|
  >               | dictem-reference-dbname-face     | dark  |
  >               |----------------------------------+-------|
  >               | dictem-database-description-face | dark  |
  >               `----------------------------------+-------'
  > 
  > Whatever emacs assumes for its background mode, something is wrong. I
  > hope someone can see this problem and fix it.

This seems to work properly on the multi-tty branch. That branch has
a few changes for initializing faces on different frames. If nobody
looks at this issue now, it will hopefully be fixed when the multi-tty
branch is merged. 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Same 'face' spec initialized to different values for x and terminal
  2007-06-04 16:16     ` Dan Nicolaescu
@ 2007-09-13 16:43       ` Leo
  0 siblings, 0 replies; 10+ messages in thread
From: Leo @ 2007-09-13 16:43 UTC (permalink / raw)
  To: emacs-devel

On 2007-06-04 17:16 +0100, Dan Nicolaescu wrote:
>   > Whatever emacs assumes for its background mode, something is wrong. I
>   > hope someone can see this problem and fix it.
>
> This seems to work properly on the multi-tty branch. That branch has
> a few changes for initializing faces on different frames. If nobody
> looks at this issue now, it will hopefully be fixed when the multi-tty
> branch is merged. 

I think this issue might have been fixed for a patch that normalizes
face definition, which was installed sometime ago.

FWIW,
-- 
.:  Leo  :.  [ sdl.web AT gmail.com ]  .:  [ GPG Key: 9283AA3F ]  :.

=>             "(require 'cl) considered harmful" considered harmful
=>           http://dto.freeshell.org/blog/blog-2007-09-07-2323.html

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2007-09-13 16:43 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-03 20:56 Same 'face' spec initialized to different values for x and terminal Leo
2007-06-03 21:05 ` Eli Zaretskii
2007-06-03 21:20   ` Leo
2007-06-03 21:23   ` Juri Linkov
2007-06-03 21:34     ` Andreas Schwab
2007-06-03 21:57       ` Juri Linkov
2007-06-03 22:35         ` Andreas Schwab
2007-06-04 15:40   ` Leo
2007-06-04 16:16     ` Dan Nicolaescu
2007-09-13 16:43       ` Leo

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).