emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 23.0.50; DISPLAY env var bug on w32?


From: Lennart Borgman (gmail)
Subject: Re: 23.0.50; DISPLAY env var bug on w32?
Date: Mon, 07 Jan 2008 22:32:06 +0100
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.666

Eli Zaretskii wrote:
Date: Mon, 07 Jan 2008 19:45:42 +0100
From: "Lennart Borgman (gmail)" <address@hidden>
Cc:
PS: I do not know if DISPLAY is normally set on a w32 system

It isn't.  DISPLAY is standard on X, but not on other windowing
systems.

Thanks, Eli, I suspected that is why this/these bugs have not been discovered before.

I got some problems sending to Emacs bugs earlier today so I am resending what I tried to send then. (I sent it to devel but it seems better to have it all here.) In this message I looked through the code to try to understand what happens on w32.

-------- Original Message --------
Subject: Mail delivery failed: returning message to sender
Date: Mon, 07 Jan 2008 15:23:02 -0500
From: Mail Delivery System <address@hidden>

A message that you sent could not be delivered to one or more of its
recipients. This is a permanent error. The following address(es) failed:

  address@hidden
SMTP error from remote mail server after RCPT TO:<address@hidden>:
    host fencepost.gnu.org [140.186.70.10]: 550 unknown user

============================
Lennart Borgman (gmail) wrote:
> I can not use emacsclient to open files unless I delete the environmental variable DISPLAY.
>
> To reproduce the problem do
>
>   emacs -Q
>   M-x server-mode
>
> Then from the command line try to open a file, for example
>
>   emacsclient.exe COPYING
>
> This fails with the message
>
>   C:\emacs\u\080104\emacs\bin>emacsclient.exe COPYING
>   Waiting for Emacs...
>   *ERROR*: Don't know how to create a frame on window system x

It looks like several possible bugs to me. A call from emacsclient leads to

   server-process-filter

and since tty-name is nil this calls

   server-select-display

In this function there is a check

    (equal (frame-parameter (selected-frame) 'display) display))

This fails since (frame-parameter (selected-frame) 'display) returns "".
  I would expect it to return "localhost:0.0" in my case. The reason for
this is explained further below.

Now this leads to a call to

   make-frame-on-display

which finishes with a line at the bottom saying

   (make-frame `((window-system . x) (display . ,display) .
     ,parameters)))

The correct window-system seems to be 'w32 in my case, since that is
what works inf make-frame. The variable frame-creation-function-alist
used there is

   ((w32 . x-create-frame-with-faces)
    (nil . tty-create-frame-with-faces))

If I use this then the frame actually get the display property
"localhost:0.0" and that is why I believe that this is what it should
have from the beginning. So this is bug 1 here I believe.

But 2 is the hard coded value in the last line of make-frame-on-display.
It looks like window-system should be something different there.

When I try to find out what I see in server-process-filter some lines saying

         ;; -window-system:  Open a new X frame.
         ((equal "-window-system" arg)
                   (setq dontkill t)
                   (setq tty-name 'window-system))

Those are a bit surprising to me since I expect an analogous use of
something called "window-system" throughout the code. Obviously that is
not the case here.

And here I stop speculating because there might be some mistake in the
structure here. Someone who understands this code better than I do can
perhaps see more clearly what is needed.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]