all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* emacsclient and reverseVideo in Xresources
@ 2018-09-18  9:47 Dimitrios Apostolou
  2018-09-18 14:16 ` Eli Zaretskii
  0 siblings, 1 reply; 9+ messages in thread
From: Dimitrios Apostolou @ 2018-09-18  9:47 UTC (permalink / raw)
  To: help-gnu-emacs

Hello list,

I've had the following line in my Xresources and has served me well for 
several years, getting all native X applications, including emacs, with 
dark background:

*reverseVideo: true


- "emacs" launches a window with dark background
- "emacsclient -c" launches a window with dark background
- "emacs -nw" launches emacs with dark background in the terminal
- "emacsclient -nw" launches emacsclient in the terminal with WHITE background!

Why is the last one happening? What can I do to alleviate the problem? I 
tried setting the global variable "inverse-video" to t, but didn't change 
anything.


Thanks in advance,
Dimitris




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

* Re: emacsclient and reverseVideo in Xresources
  2018-09-18  9:47 emacsclient and reverseVideo in Xresources Dimitrios Apostolou
@ 2018-09-18 14:16 ` Eli Zaretskii
  2018-09-18 16:02   ` Dimitrios Apostolou
  0 siblings, 1 reply; 9+ messages in thread
From: Eli Zaretskii @ 2018-09-18 14:16 UTC (permalink / raw)
  To: help-gnu-emacs

> Date: Tue, 18 Sep 2018 11:47:04 +0200 (CEST)
> From: Dimitrios Apostolou <jimis@gmx.net>
> 
> - "emacs" launches a window with dark background
> - "emacsclient -c" launches a window with dark background
> - "emacs -nw" launches emacs with dark background in the terminal
> - "emacsclient -nw" launches emacsclient in the terminal with WHITE background!
> 
> Why is the last one happening?

Because text-mode frames aren't sensitive to X resources: they don't
use X services to display text.



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

* Re: emacsclient and reverseVideo in Xresources
  2018-09-18 14:16 ` Eli Zaretskii
@ 2018-09-18 16:02   ` Dimitrios Apostolou
  2018-09-18 16:51     ` Eli Zaretskii
  0 siblings, 1 reply; 9+ messages in thread
From: Dimitrios Apostolou @ 2018-09-18 16:02 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: help-gnu-emacs

On Tue, 18 Sep 2018, Eli Zaretskii wrote:

>> Date: Tue, 18 Sep 2018 11:47:04 +0200 (CEST)
>> From: Dimitrios Apostolou <jimis@gmx.net>
>>
>> - "emacs" launches a window with dark background
>> - "emacsclient -c" launches a window with dark background
>> - "emacs -nw" launches emacs with dark background in the terminal
>> - "emacsclient -nw" launches emacsclient in the terminal with WHITE background!
>>
>> Why is the last one happening?
>
> Because text-mode frames aren't sensitive to X resources: they don't
> use X services to display text.

Thanks. But "emacs -nw" is a text-mode frame, and it has dark background. 
It's only "emacsclient -nw" that has light background. Furthermore setting 
the emacs global variable "inverse-video" to t does not change any 
behaviour, so it must be unrelated to the Xresources.

I am assuming that emacsclient is just a thin C program that manages the 
console itself in the "nw" case, but in the X case it communicates to 
emacs server and does not manage anything by itself. This could explain 
the different behaviour but still sounds like a bug to me.


Dimitris




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

* Re: emacsclient and reverseVideo in Xresources
  2018-09-18 16:02   ` Dimitrios Apostolou
@ 2018-09-18 16:51     ` Eli Zaretskii
  2018-09-18 18:37       ` Dimitrios Apostolou
  0 siblings, 1 reply; 9+ messages in thread
From: Eli Zaretskii @ 2018-09-18 16:51 UTC (permalink / raw)
  To: help-gnu-emacs

> Date: Tue, 18 Sep 2018 18:02:53 +0200 (CEST)
> From: Dimitrios Apostolou <jimis@gmx.net>
> cc: help-gnu-emacs@gnu.org
> 
> >> Why is the last one happening?
> >
> > Because text-mode frames aren't sensitive to X resources: they don't
> > use X services to display text.
> 
> Thanks. But "emacs -nw" is a text-mode frame, and it has dark background. 

Your "emacs -nw" is in an xterm, no?  I think it's xterm that heeds to
the X resources, not Emacs in that case.

> I am assuming that emacsclient is just a thin C program that manages the 
> console itself in the "nw" case, but in the X case it communicates to 
> emacs server and does not manage anything by itself. This could explain 
> the different behaviour but still sounds like a bug to me.

Could be.  Please submit a bug report about that, and thanks.



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

* Re: emacsclient and reverseVideo in Xresources
  2018-09-18 16:51     ` Eli Zaretskii
@ 2018-09-18 18:37       ` Dimitrios Apostolou
  2018-09-20 23:51         ` Bob Proulx
  0 siblings, 1 reply; 9+ messages in thread
From: Dimitrios Apostolou @ 2018-09-18 18:37 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: help-gnu-emacs

On Tue, 18 Sep 2018, Eli Zaretskii wrote:

> Could be.  Please submit a bug report about that, and thanks.

Thanks, will do after I see where this thread leads to. I'm still hoping 
that somebody will mention how to use emacsclient correctly in the 
console, or point me to some mistake in my setup.


Dimitris




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

* Re: emacsclient and reverseVideo in Xresources
  2018-09-18 18:37       ` Dimitrios Apostolou
@ 2018-09-20 23:51         ` Bob Proulx
  2018-09-24 12:51           ` Dimitrios Apostolou
       [not found]           ` <mailman.1222.1537793531.1284.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 9+ messages in thread
From: Bob Proulx @ 2018-09-20 23:51 UTC (permalink / raw)
  To: help-gnu-emacs

Dimitrios Apostolou wrote:
> - "emacs -nw" launches emacs with dark background in the terminal
> - "emacsclient -nw" launches emacsclient in the terminal with WHITE background!

Both of those should be terminal clients.  But you are not saying what
terminal emulator you are using, nor how that terminal emulator is
configured.  This makes it difficult help.

If you are doing things normally by running the commands from the
command line in an existing terminal then the colors should not change
from what you have when you launched it.  They don't for me.  For
example if I am at a terminal prompt and use emacsclient in the
following then I get the same colors during the emacs run that I had
running before I invoked emacsclient.  Works for me.

  rwp@angst:~$ emacsclient -nw /tmp

When you say "launches" do you mean that it starts up *another*
terminal window in addition to the one you used to run that command?
That would be really quite bizarre from my perspective.  However I
acknowledge that everyone has a different opinion about such things.

Are you somehow running that command by some way that doesn't use a
terminal, such as a window manager menu pick or something, and that
*it* is launching a terminal emulator with that command running in it?
If so then that is where your problem exists.  For example if you are
using a window manager menu pick and it is doing something like this:

  x-terminal-emulator -e emacsclient -nw

Then that is where you need to focus your efforts to make it open a)
the terminal type you want and b) using the X resources you want it to
use.  You will probably need to set X resources to control the color
of the terminal emulator that you are launching.  Or you will need to
change the terminal emulator to one that you have already configured.

Please say a little more about your environment so that we can help
further.

Bob



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

* Re: emacsclient and reverseVideo in Xresources
  2018-09-20 23:51         ` Bob Proulx
@ 2018-09-24 12:51           ` Dimitrios Apostolou
       [not found]           ` <mailman.1222.1537793531.1284.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 9+ messages in thread
From: Dimitrios Apostolou @ 2018-09-24 12:51 UTC (permalink / raw)
  To: Bob Proulx; +Cc: help-gnu-emacs

Thanks for your response. Here are the answers to your questions and some 
extra details:

- I am launching emacs from within a dark xterm, all commands are manual
- "emacs -nw" launches emacs with the same (dark) background *in the same terminal*
- "emacs -Q -nw" behaves the same (-Q explicitly skips processing of Xresources)
- "emacsclient -nw" launches emacs with white background *in the same terminal*, i.e. it reverses the colours!
- My .Xresources instructs all X applications to reverse colours with this line: "*reverseVideo: true"
- The same colour reversals mentioned above happen also when I start emacs from a white-background xterm (using "xterm +rv")

My findings so far indicate that emacs-server loads my Xresources file and 
sets some internal state that instructs all new emacsclient instances to 
reverse colours. I believe that this should happen only if emacsclient is 
not opening the new frame as a console application.


Dimitris




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

* Re: emacsclient and reverseVideo in Xresources
       [not found]           ` <mailman.1222.1537793531.1284.help-gnu-emacs@gnu.org>
@ 2018-09-24 17:09             ` Javier
  2018-09-24 20:03               ` Dimitrios Apostolou
  0 siblings, 1 reply; 9+ messages in thread
From: Javier @ 2018-09-24 17:09 UTC (permalink / raw)
  To: help-gnu-emacs

Dimitrios Apostolou <jimis@gmx.net> wrote:
> - I am launching emacs from within a dark xterm, all commands are manual
> - "emacs -nw" launches emacs with the same (dark) background *in the same terminal*
> - "emacs -Q -nw" behaves the same (-Q explicitly skips processing of Xresources)
> - "emacsclient -nw" launches emacs with white background *in the same terminal*, i.e. it reverses the colours!
> - My .Xresources instructs all X applications to reverse colours with this line: "*reverseVideo: true"
> - The same colour reversals mentioned above happen also when I start emacs from a white-background xterm (using "xterm +rv")
> 
> My findings so far indicate that emacs-server loads my Xresources file and 
> sets some internal state that instructs all new emacsclient instances to 
> reverse colours. I believe that this should happen only if emacsclient is 
> not opening the new frame as a console application.

I get the same as you.  To make the thing faster to reproduce:

emacs -xrm 'emacs*reverseVideo: true' --exec \
     '(progn (setq server-name "reverseVideo_TRUE_server")
             (server-start)
             (insert server-name))' &
emacs -xrm 'emacs*reverseVideo: false' --exec \
     '(progn (setq server-name "reverseVideo_FALSE_server")
             (server-start)
             (insert server-name))' &
sleep 2
xterm -e emacsclient -nw -s reverseVideo_TRUE_server  &
xterm -e emacsclient -nw -s reverseVideo_FALSE_server &


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

* Re: emacsclient and reverseVideo in Xresources
  2018-09-24 17:09             ` Javier
@ 2018-09-24 20:03               ` Dimitrios Apostolou
  0 siblings, 0 replies; 9+ messages in thread
From: Dimitrios Apostolou @ 2018-09-24 20:03 UTC (permalink / raw)
  To: help-gnu-emacs

On Mon, 24 Sep 2018, Javier wrote:

> Dimitrios Apostolou <jimis@gmx.net> wrote:
>> - I am launching emacs from within a dark xterm, all commands are manual
>> - "emacs -nw" launches emacs with the same (dark) background *in the same terminal*
>> - "emacs -Q -nw" behaves the same (-Q explicitly skips processing of Xresources)
>> - "emacsclient -nw" launches emacs with white background *in the same terminal*, i.e. it reverses the colours!
>> - My .Xresources instructs all X applications to reverse colours with this line: "*reverseVideo: true"
>> - The same colour reversals mentioned above happen also when I start emacs from a white-background xterm (using "xterm +rv")
>>
>> My findings so far indicate that emacs-server loads my Xresources file and
>> sets some internal state that instructs all new emacsclient instances to
>> reverse colours. I believe that this should happen only if emacsclient is
>> not opening the new frame as a console application.
>
> I get the same as you.  To make the thing faster to reproduce:
>
> emacs -xrm 'emacs*reverseVideo: true' --exec \
>     '(progn (setq server-name "reverseVideo_TRUE_server")
>             (server-start)
>             (insert server-name))' &
> emacs -xrm 'emacs*reverseVideo: false' --exec \
>     '(progn (setq server-name "reverseVideo_FALSE_server")
>             (server-start)
>             (insert server-name))' &
> sleep 2
> xterm -e emacsclient -nw -s reverseVideo_TRUE_server  &
> xterm -e emacsclient -nw -s reverseVideo_FALSE_server &
>

Thanks, this makes it easy to demonstrate the issue.


Dimitris




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

end of thread, other threads:[~2018-09-24 20:03 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-18  9:47 emacsclient and reverseVideo in Xresources Dimitrios Apostolou
2018-09-18 14:16 ` Eli Zaretskii
2018-09-18 16:02   ` Dimitrios Apostolou
2018-09-18 16:51     ` Eli Zaretskii
2018-09-18 18:37       ` Dimitrios Apostolou
2018-09-20 23:51         ` Bob Proulx
2018-09-24 12:51           ` Dimitrios Apostolou
     [not found]           ` <mailman.1222.1537793531.1284.help-gnu-emacs@gnu.org>
2018-09-24 17:09             ` Javier
2018-09-24 20:03               ` Dimitrios Apostolou

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.