unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#12647: 24.2.50; emacs --daemon broken in tty
@ 2012-10-14 15:44 Toby Cubitt
  2012-10-16  7:00 ` Glenn Morris
  2012-10-18 23:56 ` Ulrich Mueller
  0 siblings, 2 replies; 12+ messages in thread
From: Toby Cubitt @ 2012-10-14 15:44 UTC (permalink / raw)
  To: 12647

"emacsclient -c" throws an error if "emacs --daemon" is started outside
of X windows, . This is on a recent bzr checkout (from today).

Steps to reproduce:

1. switch to a linux virtual tty

2. emacs -Q --daemon

3. switch to X windows

4. emacsclient -c aborts with the following error:

   Waiting for Emacs...
   *ERROR*: Wrong type argument: stringp, nil


(This bug breaks the Gentoo emacs daemon init scripts.)

Note that "emacsclient -nw" does still open tty frames successfully on a
daemon started from a tty. And running "emacs --daemon" from within X
windows allows emacsclient to create both types of frame successfully.


In GNU Emacs 24.2.50.1 (i686-pc-linux-gnu, GTK+ Version 3.4.4)
 of 2012-10-14 on c3po
Bzr revision: handa@gnu.org-20121014080652-4o4ptkifsi2xqtk4
Windowing system distributor `The X.Org Foundation', version 11.0.11202000
Configured using:
 `configure '--prefix=/usr' '--host=i686-pc-linux-gnu'
 '--mandir=/usr/share/man' '--infodir=/usr/share/info'
 '--datadir=/usr/share' '--sysconfdir=/etc' '--localstatedir=/var/lib'
 '--disable-dependency-tracking' '--program-suffix=-emacs-24-vcs'
 '--program-transform-name=s/emacs-[0-9].*/emacs-24-vcs/'
 '--infodir=/usr/share/info/emacs-24-vcs'
 '--enable-locallisppath=/etc/emacs:/usr/share/emacs/site-lisp'
 '--with-crt-dir=/usr/lib/gcc/i686-pc-linux-gnu/4.5.4/../../../../lib'
 '--with-gameuser=games' '--without-compress-info' '--without-hesiod'
 '--without-kerberos' '--without-kerberos5' '--with-gpm' '--with-dbus'
 '--without-gnutls' '--without-xml2' '--without-selinux'
 '--without-wide-int' '--without-sound' '--with-x' '--without-ns'
 '--without-gconf' '--without-gsettings' '--with-toolkit-scroll-bars'
 '--without-gif' '--without-jpeg' '--with-png' '--with-rsvg'
 '--without-tiff' '--with-xpm' '--without-imagemagick' '--with-xft'
 '--without-libotf' '--without-m17n-flt' '--with-x-toolkit=gtk3'
 'GENTOO_PACKAGE=app-editors/emacs-vcs-24.2.9999' 'EBZR_BRANCH=trunk'
 'EBZR_REVNO=110543' '--build=i686-pc-linux-gnu'
 'build_alias=i686-pc-linux-gnu' 'host_alias=i686-pc-linux-gnu'
 'CFLAGS=-march=prescott -O2 -pipe -O2' 'LDFLAGS=-Wl,-O1
 -Wl,--as-needed' 'CPPFLAGS=''

Important settings:
  value of $LANG: en_GB.utf-8
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t


-- 
Dr T. S. Cubitt
Mathematics and Quantum Information group
Department of Mathematics
Complutense University
Madrid, Spain

email: tsc25@cantab.net
web:   www.dr-qubit.org





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

* bug#12647: 24.2.50; emacs --daemon broken in tty
  2012-10-14 15:44 bug#12647: 24.2.50; emacs --daemon broken in tty Toby Cubitt
@ 2012-10-16  7:00 ` Glenn Morris
  2012-10-16 13:20   ` Stefan Monnier
  2012-10-18 23:56 ` Ulrich Mueller
  1 sibling, 1 reply; 12+ messages in thread
From: Glenn Morris @ 2012-10-16  7:00 UTC (permalink / raw)
  To: Toby Cubitt; +Cc: 12647

Toby Cubitt wrote:

> "emacsclient -c" throws an error if "emacs --daemon" is started outside
> of X windows, . This is on a recent bzr checkout (from today).
>
> Steps to reproduce:
>
> 1. switch to a linux virtual tty
>
> 2. emacs -Q --daemon
>
> 3. switch to X windows
>
> 4. emacsclient -c aborts with the following error:
>
>    Waiting for Emacs...
>    *ERROR*: Wrong type argument: stringp, nil

This is due to the various changes related to display handling in
r110444 (cygw32). The specific error is from x-initialize-window-system,
which cannot find a display (don't ask me why getenv DISPLAY doesn't
work here). In the past, frame.el set x-display-name, but it does not do
that any more. Presumably it was doing it for a reason.

The following example frame.el change makes it work again, but someone
should check this area.

--- lisp/frame.el   2012-09-17 12:07:36 +0000
+++ lisp/frame.el   2012-10-16 06:54:40 +0000
@@ -655,6 +655,7 @@
       (error "Don't know how to create a frame on window system %s" w))
 
     (unless (get w 'window-system-initialized)
+      (or x-display-name (setq x-display-name display))
       (funcall (cdr (assq w window-system-initialization-alist)))
       (put w 'window-system-initialized t))
 





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

* bug#12647: 24.2.50; emacs --daemon broken in tty
  2012-10-16  7:00 ` Glenn Morris
@ 2012-10-16 13:20   ` Stefan Monnier
  2012-10-16 15:47     ` Glenn Morris
  0 siblings, 1 reply; 12+ messages in thread
From: Stefan Monnier @ 2012-10-16 13:20 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 12647, Toby Cubitt

> This is due to the various changes related to display handling in
> r110444 (cygw32).  The specific error is from x-initialize-window-system,
> which cannot find a display (don't ask me why getenv DISPLAY doesn't
> work here).

He said he started "emacs --daemon" outside of X windows, so DISPLAY is
not set.

> In the past, frame.el set x-display-name, but it does not do
> that any more.

Where did it do it?

> The following example frame.el change makes it work again, but someone
> should check this area.

To a large extent x-display-name should disappear, replaced by explicit
parameters, since it doesn't make much sense in a multi-display context.
So this part of the code is pretty ugly.  Your patch is probably OK in
the sense that it doesn't seem to make things significantly worse.


        Stefan





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

* bug#12647: 24.2.50; emacs --daemon broken in tty
  2012-10-16 13:20   ` Stefan Monnier
@ 2012-10-16 15:47     ` Glenn Morris
  2012-10-16 21:34       ` Stefan Monnier
  0 siblings, 1 reply; 12+ messages in thread
From: Glenn Morris @ 2012-10-16 15:47 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 12647, Toby Cubitt

Stefan Monnier wrote:

>> In the past, frame.el set x-display-name, but it does not do
>> that any more.
>
> Where did it do it?

In make-frame-on-display, right before calling
x-initialize-window-system. (Look at emacs-24.)

>> The following example frame.el change makes it work again, but someone
>> should check this area.
>
> To a large extent x-display-name should disappear

But not during a feature freeze.

> So this part of the code is pretty ugly.  Your patch is probably OK in
> the sense that it doesn't seem to make things significantly worse.

It was only an example change showing what the problem seems to be.
I'm not saying it is the right fix.





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

* bug#12647: 24.2.50; emacs --daemon broken in tty
  2012-10-16 15:47     ` Glenn Morris
@ 2012-10-16 21:34       ` Stefan Monnier
  2012-10-16 21:42         ` Toby Cubitt
  2012-10-18 23:46         ` Glenn Morris
  0 siblings, 2 replies; 12+ messages in thread
From: Stefan Monnier @ 2012-10-16 21:34 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 12647, Toby Cubitt

>>> In the past, frame.el set x-display-name, but it does not do
>>> that any more.
>> Where did it do it?
> In make-frame-on-display, right before calling
> x-initialize-window-system. (Look at emacs-24.)
>>> The following example frame.el change makes it work again, but someone
>>> should check this area.
>> To a large extent x-display-name should disappear
> But not during a feature freeze.

Agreed.

>> So this part of the code is pretty ugly.  Your patch is probably OK in
>> the sense that it doesn't seem to make things significantly worse.
> It was only an example change showing what the problem seems to be.
> I'm not saying it is the right fix.

We agreed above that we can't afford the right fix for the
feature freeze.


        Stefan





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

* bug#12647: 24.2.50; emacs --daemon broken in tty
  2012-10-16 21:34       ` Stefan Monnier
@ 2012-10-16 21:42         ` Toby Cubitt
  2012-10-18 23:46         ` Glenn Morris
  1 sibling, 0 replies; 12+ messages in thread
From: Toby Cubitt @ 2012-10-16 21:42 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 12647

On Tue, Oct 16, 2012 at 05:34:42PM -0400, Stefan Monnier wrote:
> >>> In the past, frame.el set x-display-name, but it does not do
> >>> that any more.
> >> Where did it do it?
> > In make-frame-on-display, right before calling
> > x-initialize-window-system. (Look at emacs-24.)
> >>> The following example frame.el change makes it work again, but someone
> >>> should check this area.
> >> To a large extent x-display-name should disappear
> > But not during a feature freeze.
> 
> Agreed.
> 
> >> So this part of the code is pretty ugly.  Your patch is probably OK in
> >> the sense that it doesn't seem to make things significantly worse.
> > It was only an example change showing what the problem seems to be.
> > I'm not saying it is the right fix.
> 
> We agreed above that we can't afford the right fix for the
> feature freeze.

I assume you agree that some interim fix is necessary then?

As I mentioned, this bug breaks stuff out there in the real world, such
as the Gentoo emacs init scripts. (These can be used to start emacs
daemons for users at bootup, so they always run emacs --daemon outside of
X, indeed usually before X has even been started).

Toby
-- 
Dr T. S. Cubitt
Mathematics and Quantum Information group
Department of Mathematics
Complutense University
Madrid, Spain

email: tsc25@cantab.net
web:   www.dr-qubit.org





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

* bug#12647: 24.2.50; emacs --daemon broken in tty
  2012-10-16 21:34       ` Stefan Monnier
  2012-10-16 21:42         ` Toby Cubitt
@ 2012-10-18 23:46         ` Glenn Morris
  1 sibling, 0 replies; 12+ messages in thread
From: Glenn Morris @ 2012-10-18 23:46 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 12647, Toby Cubitt

Stefan Monnier wrote:

> We agreed above that we can't afford the right fix for the
> feature freeze.

I was more hoping to get an answer to "why did this code change in the
first place during a feature freeze"? Ie, was it really necessary for
cygw32 that frame handling on all platforms be changed?





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

* bug#12647: 24.2.50; emacs --daemon broken in tty
  2012-10-14 15:44 bug#12647: 24.2.50; emacs --daemon broken in tty Toby Cubitt
  2012-10-16  7:00 ` Glenn Morris
@ 2012-10-18 23:56 ` Ulrich Mueller
  2012-10-19  0:23   ` Daniel Colascione
  1 sibling, 1 reply; 12+ messages in thread
From: Ulrich Mueller @ 2012-10-18 23:56 UTC (permalink / raw)
  To: 12647

[Sorry for the duplicate #12678, I had noticed too late that this bug
was already open for the issue.]

>> We agreed above that we can't afford the right fix for the
>> feature freeze.

> I assume you agree that some interim fix is necessary then?

Maybe r110444 could be reverted, until things are properly sorted out?





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

* bug#12647: 24.2.50; emacs --daemon broken in tty
  2012-10-18 23:56 ` Ulrich Mueller
@ 2012-10-19  0:23   ` Daniel Colascione
  2012-10-19  1:40     ` Stefan Monnier
  2012-10-20  3:45     ` Daniel Colascione
  0 siblings, 2 replies; 12+ messages in thread
From: Daniel Colascione @ 2012-10-19  0:23 UTC (permalink / raw)
  To: Ulrich Mueller; +Cc: 12647

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

On 10/18/2012 4:56 PM, Ulrich Mueller wrote:
> [Sorry for the duplicate #12678, I had noticed too late that this bug
> was already open for the issue.]
> 
>>> We agreed above that we can't afford the right fix for the
>>> feature freeze.
> 
>> I assume you agree that some interim fix is necessary then?
> 
> Maybe r110444 could be reverted, until things are properly sorted out?

For the sake of one easy-to-fix-temporarily bug? I don't think that's the right
option.

The right fix for the feature freeze is to just set x-display-name the way we
did before. We'll be no worse off than we were in the last version.


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 259 bytes --]

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

* bug#12647: 24.2.50; emacs --daemon broken in tty
  2012-10-19  0:23   ` Daniel Colascione
@ 2012-10-19  1:40     ` Stefan Monnier
  2012-10-20  3:45     ` Daniel Colascione
  1 sibling, 0 replies; 12+ messages in thread
From: Stefan Monnier @ 2012-10-19  1:40 UTC (permalink / raw)
  To: Daniel Colascione; +Cc: 12647, Ulrich Mueller

> The right fix for the feature freeze is to just set x-display-name the way we
> did before. We'll be no worse off than we were in the last version.

Yes, could you do that, please?


        Stefan





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

* bug#12647: 24.2.50; emacs --daemon broken in tty
  2012-10-19  0:23   ` Daniel Colascione
  2012-10-19  1:40     ` Stefan Monnier
@ 2012-10-20  3:45     ` Daniel Colascione
  2012-10-20 12:30       ` Ulrich Mueller
  1 sibling, 1 reply; 12+ messages in thread
From: Daniel Colascione @ 2012-10-20  3:45 UTC (permalink / raw)
  To: 12647

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

On 10/18/2012 5:23 PM, Daniel Colascione wrote:
> On 10/18/2012 4:56 PM, Ulrich Mueller wrote:
>> [Sorry for the duplicate #12678, I had noticed too late that this bug
>> was already open for the issue.]
>>
>>>> We agreed above that we can't afford the right fix for the
>>>> feature freeze.
>>
>>> I assume you agree that some interim fix is necessary then?
>>
>> Maybe r110444 could be reverted, until things are properly sorted out?
> 
> For the sake of one easy-to-fix-temporarily bug? I don't think that's the right
> option.
> 
> The right fix for the feature freeze is to just set x-display-name the way we
> did before. We'll be no worse off than we were in the last version.
> 

I've installed a tweaked version of Glenn's patch. It appears to resolve the
problem.


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 256 bytes --]

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

* bug#12647: 24.2.50; emacs --daemon broken in tty
  2012-10-20  3:45     ` Daniel Colascione
@ 2012-10-20 12:30       ` Ulrich Mueller
  0 siblings, 0 replies; 12+ messages in thread
From: Ulrich Mueller @ 2012-10-20 12:30 UTC (permalink / raw)
  To: Daniel Colascione; +Cc: 12647

>>>>> On Fri, 19 Oct 2012, Daniel Colascione wrote:

>> The right fix for the feature freeze is to just set x-display-name
>> the way we did before. We'll be no worse off than we were in the
>> last version.

> I've installed a tweaked version of Glenn's patch. It appears to
> resolve the problem.

Thank you. I can confirm that I don't see the problem any more in the
current version (110601) from bzr.





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

end of thread, other threads:[~2012-10-20 12:30 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-14 15:44 bug#12647: 24.2.50; emacs --daemon broken in tty Toby Cubitt
2012-10-16  7:00 ` Glenn Morris
2012-10-16 13:20   ` Stefan Monnier
2012-10-16 15:47     ` Glenn Morris
2012-10-16 21:34       ` Stefan Monnier
2012-10-16 21:42         ` Toby Cubitt
2012-10-18 23:46         ` Glenn Morris
2012-10-18 23:56 ` Ulrich Mueller
2012-10-19  0:23   ` Daniel Colascione
2012-10-19  1:40     ` Stefan Monnier
2012-10-20  3:45     ` Daniel Colascione
2012-10-20 12:30       ` Ulrich Mueller

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