unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#2234: 23.0.90; custom-set-faces inhibits faces differences between X11 and console clients
@ 2009-02-08 10:52 ` Stefano Zacchiroli
  2009-02-15 17:35   ` bug#2234: marked as done (23.0.90; custom-set-faces inhibits faces differences between X11 and console clients) Emacs bug Tracking System
  0 siblings, 1 reply; 4+ messages in thread
From: Stefano Zacchiroli @ 2009-02-08 10:52 UTC (permalink / raw)
  To: emacs-pretest-bug; +Cc: rfrancoise

I use a main X11 emacs with clients (sometime X11, sometime console)
which attach to it. I want to have "black on white" X11 clients and
"white on black" console clients. (Actually, I don't care what Emacs
does with console colors, I just want it to preserves my terminal
defaults and I do use black background terminals.)

If I have *no* custom-set-faces section in my .emacs the default
configuration just does what I want.
- I start main X11 emacs (which is white on black)
- I start console clients (which are black on white, respecting the
  terminal)

... but I do need to customize faces, because I want the font in X11
to be smaller than the default. As soon as I add a
(custom-set-faces...) to my ~/.emacs, no matter _what_ I write into
it, the above doesn't work anymore. More precisely it seems that the
first kind of emacs which gets launched (X11 vs console) fixes once
and for all foreground and background colors. Hence:

- if I start the first emacs on X11, I'll the have "black on white"
  console clients
- if I start the first emacs on console, everything is fine again

My feeling is that there is a quite profund issue here of separation
of the initialization code, which looks like to be centralized while
it should be (to some extent) split and partly executed by clients.

... but more practically I'm also looking for workarounds :-)

TIA,
Cheers.


In GNU Emacs 23.0.90.1 (x86_64-pc-linux-gnu, GTK+ Version 2.12.11)
 of 2009-02-07 on elegiac, modified by Debian
 (emacs-snapshot package, version 1:20090207-1)
Windowing system distributor `The X.Org Foundation', version 11.0.10402000
configured using `configure  '--build' 'x86_64-linux-gnu' '--host' 'x86_64-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs-snapshot:/etc/emacs:/usr/local/share/emacs/23.0.90/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/23.0.90/site-lisp:/usr/share/emacs/site-lisp' '--with-x=yes' '--with-x-toolkit=gtk' 'build_alias=x86_64-linux-gnu' 'host_alias=x86_64-linux-gnu' 'CFLAGS=-DDEBIAN -DSITELOAD_PURESIZE_EXTRA=5000 -g -O2' 'LDFLAGS=-g -Wl,--as-needed' 'CPPFLAGS=''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: en_US.UTF-8
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: it_IT.UTF-8
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8-unix
  default-enable-multibyte-characters: t

Major mode: Conf[Xdefaults]

Minor modes in effect:
  iswitchb-mode: t
  show-paren-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  global-auto-composition-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
<help-echo> ESC [ > 1 ; 1 6 1 4 ; 0 c C-x C-c M-x r 
e p o <tab> r <tab> <return> C-g C-x C-f , e <backspace> 
<backspace> . X r <tab> <return> C-n C-n C-n i E a 
<backspace> m a c s . f o n t : SPC m o n o s p a c 
e <escape> C-/ M-x r e p o <tab> r t - e m <tab> <return> 
ESC [ > 1 ; 1 6 1 4 ; 0 c <switch-frame> C-x <switch-frame> 
C-g j n C-n C-n C-n C-n <switch-frame> C-c <switch-frame> 
C-c C-l C-x C-c ESC [ > 1 ; 1 6 1 4 ; 0 c C-x C-c k 
k k k ESC [ > 1 ; 1 6 1 4 ; 0 c <switch-frame> M-x 
r e p o r t <tab> <return>

Recent messages:
When done with a buffer, type C-x #
viper-find-char: Viper bell [2 times]
viper-prefix-arg-com: Viper bell
Quit
viper-search-next: No previous search string
(No files need saving)
When done with a buffer, type C-x #
(No files need saving)
line-move-1: Beginning of buffer
When done with a buffer, type C-x #






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

* bug#2234: 23.0.90; custom-set-faces inhibits faces differences between X11 and console clients
@ 2009-02-08 16:01 Chong Yidong
  2009-02-08 20:19 ` Stefan Monnier
  0 siblings, 1 reply; 4+ messages in thread
From: Chong Yidong @ 2009-02-08 16:01 UTC (permalink / raw)
  To: Stefano Zacchiroli; +Cc: 2234

This is, indeed, a problem.  Tthe customize-face facility ought to allow
you to specify terminal-dependent face settings.  Hopefully, someone
will write such an enhancement, but this will probably not happen before
the upcoming 23.1 release.

One workaround that I can suggest is to reset the defface spec of the
face within your .emacs file, like this:

 (put 'font-lock-comment-face 'face-defface-spec nil)
 (defface font-lock-comment-face
   '((((class color) (background light))
      (:foreground "green"))
     (((class color) (background dark))
      (:foreground "yellow"))
     (t (:weight bold :slant italic)))
   "Font Lock mode face used to highlight comments."
   :group 'font-lock-faces)

The changes that you make this way will not apply to the first frame,
but they will apply to subsequent frames.






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

* bug#2234: 23.0.90; custom-set-faces inhibits faces differences between X11 and console clients
  2009-02-08 16:01 bug#2234: 23.0.90; custom-set-faces inhibits faces differences between X11 and console clients Chong Yidong
@ 2009-02-08 20:19 ` Stefan Monnier
  0 siblings, 0 replies; 4+ messages in thread
From: Stefan Monnier @ 2009-02-08 20:19 UTC (permalink / raw)
  To: Chong Yidong; +Cc: 2234, Stefano Zacchiroli

> This is, indeed, a problem.  Tthe customize-face facility ought to allow
> you to specify terminal-dependent face settings.  Hopefully, someone
> will write such an enhancement, but this will probably not happen before
> the upcoming 23.1 release.

Do M-x customize-face RET font-lock-comment-face RET
Then middle-click on "state" and select "for all kinds of displays": you
can then give distinct settings for different circumstances.


        Stefan






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

* bug#2234: marked as done (23.0.90; custom-set-faces inhibits  faces differences between X11 and console clients)
  2009-02-08 10:52 ` bug#2234: 23.0.90; custom-set-faces inhibits faces differences between X11 and console clients Stefano Zacchiroli
@ 2009-02-15 17:35   ` Emacs bug Tracking System
  0 siblings, 0 replies; 4+ messages in thread
From: Emacs bug Tracking System @ 2009-02-15 17:35 UTC (permalink / raw)
  To: Stefano Zacchiroli

[-- Attachment #1: Type: text/plain, Size: 982 bytes --]


Your message dated Sun, 15 Feb 2009 16:09:43 +0100
with message-id <20090215150943.GE31901@usha.takhisis.invalid>
and subject line Re: bug#2234: 23.0.90; custom-set-faces inhibits faces differences between X11 and console clients
has caused the Emacs bug report #2234,
regarding 23.0.90; custom-set-faces inhibits faces differences between X11 and console clients
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@emacsbugs.donarmstrong.com
immediately.)


-- 
2234: http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=2234
Emacs Bug Tracking System
Contact owner@emacsbugs.donarmstrong.com with problems

[-- Attachment #2: Type: message/rfc822, Size: 5872 bytes --]

From: zack@upsilon.cc (Stefano Zacchiroli)
To: emacs-pretest-bug@gnu.org
Cc: rfrancoise@debian.org
Subject: 23.0.90; custom-set-faces inhibits faces differences between X11 and console clients
Date: Sun,  8 Feb 2009 11:52:19 +0100 (CET)
Message-ID: <20090208105219.8F70061AA@usha.takhisis.invalid>

I use a main X11 emacs with clients (sometime X11, sometime console)
which attach to it. I want to have "black on white" X11 clients and
"white on black" console clients. (Actually, I don't care what Emacs
does with console colors, I just want it to preserves my terminal
defaults and I do use black background terminals.)

If I have *no* custom-set-faces section in my .emacs the default
configuration just does what I want.
- I start main X11 emacs (which is white on black)
- I start console clients (which are black on white, respecting the
  terminal)

... but I do need to customize faces, because I want the font in X11
to be smaller than the default. As soon as I add a
(custom-set-faces...) to my ~/.emacs, no matter _what_ I write into
it, the above doesn't work anymore. More precisely it seems that the
first kind of emacs which gets launched (X11 vs console) fixes once
and for all foreground and background colors. Hence:

- if I start the first emacs on X11, I'll the have "black on white"
  console clients
- if I start the first emacs on console, everything is fine again

My feeling is that there is a quite profund issue here of separation
of the initialization code, which looks like to be centralized while
it should be (to some extent) split and partly executed by clients.

... but more practically I'm also looking for workarounds :-)

TIA,
Cheers.


In GNU Emacs 23.0.90.1 (x86_64-pc-linux-gnu, GTK+ Version 2.12.11)
 of 2009-02-07 on elegiac, modified by Debian
 (emacs-snapshot package, version 1:20090207-1)
Windowing system distributor `The X.Org Foundation', version 11.0.10402000
configured using `configure  '--build' 'x86_64-linux-gnu' '--host' 'x86_64-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs-snapshot:/etc/emacs:/usr/local/share/emacs/23.0.90/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/23.0.90/site-lisp:/usr/share/emacs/site-lisp' '--with-x=yes' '--with-x-toolkit=gtk' 'build_alias=x86_64-linux-gnu' 'host_alias=x86_64-linux-gnu' 'CFLAGS=-DDEBIAN -DSITELOAD_PURESIZE_EXTRA=5000 -g -O2' 'LDFLAGS=-g -Wl,--as-needed' 'CPPFLAGS=''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: en_US.UTF-8
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: it_IT.UTF-8
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8-unix
  default-enable-multibyte-characters: t

Major mode: Conf[Xdefaults]

Minor modes in effect:
  iswitchb-mode: t
  show-paren-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  global-auto-composition-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
<help-echo> ESC [ > 1 ; 1 6 1 4 ; 0 c C-x C-c M-x r 
e p o <tab> r <tab> <return> C-g C-x C-f , e <backspace> 
<backspace> . X r <tab> <return> C-n C-n C-n i E a 
<backspace> m a c s . f o n t : SPC m o n o s p a c 
e <escape> C-/ M-x r e p o <tab> r t - e m <tab> <return> 
ESC [ > 1 ; 1 6 1 4 ; 0 c <switch-frame> C-x <switch-frame> 
C-g j n C-n C-n C-n C-n <switch-frame> C-c <switch-frame> 
C-c C-l C-x C-c ESC [ > 1 ; 1 6 1 4 ; 0 c C-x C-c k 
k k k ESC [ > 1 ; 1 6 1 4 ; 0 c <switch-frame> M-x 
r e p o r t <tab> <return>

Recent messages:
When done with a buffer, type C-x #
viper-find-char: Viper bell [2 times]
viper-prefix-arg-com: Viper bell
Quit
viper-search-next: No previous search string
(No files need saving)
When done with a buffer, type C-x #
(No files need saving)
line-move-1: Beginning of buffer
When done with a buffer, type C-x #



[-- Attachment #3: Type: message/rfc822, Size: 2902 bytes --]

From: Stefano Zacchiroli <zack@upsilon.cc>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 2234-done@emacsbugs.donarmstrong.com
Subject: Re: bug#2234: 23.0.90; custom-set-faces inhibits faces differences between X11 and console clients
Date: Sun, 15 Feb 2009 16:09:43 +0100
Message-ID: <20090215150943.GE31901@usha.takhisis.invalid>

On Sun, Feb 08, 2009 at 03:19:49PM -0500, Stefan Monnier wrote:
> > This is, indeed, a problem.  Tthe customize-face facility ought to allow
> > you to specify terminal-dependent face settings.  Hopefully, someone
> > will write such an enhancement, but this will probably not happen before
> > the upcoming 23.1 release.
> 
> Do M-x customize-face RET font-lock-comment-face RET
> Then middle-click on "state" and select "for all kinds of displays": you
> can then give distinct settings for different circumstances.

Many thanks, starting from this tip I indeed found the correct
solution.

Actually, what I needed is to override *all* faces for console mode,
with respect to what happens in the X11 world. I just followed your
suggestion, using "'default" as the font face instead of
"'font-lock-comment-face".

So, in the end, it was not a bug, I'm therefore closing the bug with
this post.

Cheers.

-- 
Stefano Zacchiroli -o- PhD in Computer Science \ PostDoc @ Univ. Paris 7
zack@{upsilon.cc,pps.jussieu.fr,debian.org} -<>- http://upsilon.cc/zack/
Dietro un grande uomo c'è ..|  .  |. Et ne m'en veux pas si je te tutoie
sempre uno zaino ...........| ..: |.... Je dis tu à tous ceux que j'aime


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

end of thread, other threads:[~2009-02-15 17:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20090215150943.GE31901@usha.takhisis.invalid>
2009-02-08 10:52 ` bug#2234: 23.0.90; custom-set-faces inhibits faces differences between X11 and console clients Stefano Zacchiroli
2009-02-15 17:35   ` bug#2234: marked as done (23.0.90; custom-set-faces inhibits faces differences between X11 and console clients) Emacs bug Tracking System
2009-02-08 16:01 bug#2234: 23.0.90; custom-set-faces inhibits faces differences between X11 and console clients Chong Yidong
2009-02-08 20:19 ` Stefan Monnier

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).