bug#38367: 26.3; Cannot start Emacs with -nw option, starting with Emacs 26.1

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

bug#38367: 26.3; Cannot start Emacs with -nw option, starting with Emacs 26.1

Drew Adams
This is the case starting with Emacs 26.1.  It is still the case with
Emacs 26.3.

I create a shortcut in Windows 10 with the executable as Target:

 Y:\Emacs-26\bin\runemacs -Q -nw

I double-click that shortcut.  Nothing seems to happen.

In the Task Manager I see a background process that corresponds, named
"GNU Emacs: The extensible self-documenting text editor", but there is
no Emacs window.

This works in all previous releases I have, from Emacs 20.7 through
Emacs 25.3.1.


In GNU Emacs 26.3 (build 1, x86_64-w64-mingw32)
 of 2019-08-29
Repository revision: 96dd0196c28bc36779584e47fffcca433c9309cd
Windowing system distributor `Microsoft Corp.', version 10.0.17763
Configured using:
 `configure --without-dbus --host=x86_64-w64-mingw32
 --without-compress-install 'CFLAGS=-O2 -static -g3''



Reply | Threaded
Open this post in threaded view
|

bug#38367: 26.3; Cannot start Emacs with -nw option, starting with Emacs 26.1

Juanma Barranquero


On Mon, Nov 25, 2019 at 10:36 PM Drew Adams <[hidden email]> wrote:

> This works in all previous releases I have, from Emacs 20.7 through
> Emacs 25.3.1.

Did it? I don't have a release of 25.3 at hand, but I have one of 24.5 and the effect is the same.

Which isn't surprising, as runemacs' only use is to start an Emacs hidding the console window.

Why don't you do the shortcut with just emacs.exe, instead of runemacs.exe?
Reply | Threaded
Open this post in threaded view
|

bug#38367: 26.3; Cannot start Emacs with -nw option, starting with Emacs 26.1

Drew Adams
>> This works in all previous releases I have,
>> from Emacs 20.7 through Emacs 25.3.1.
>
> Did it? I don't have a release of 25.3 at
> hand, but I have one of 24.5 and the effect
> is the same.

24.5 works fine for me with -nw.

> Which isn't surprising, as runemacs' only use
> is to start an Emacs hidding the console window.

That's what I've used for -nw in the past.
But I just tried plain `emacs' for -nw, and
that works too.  (I use plain `emacs' for GUI.)

> Why don't you do the shortcut with just
> emacs.exe, instead of runemacs.exe?

I already tried that too.  Should 've
mentioned it in the bug report.

Does Emacs 26 on Windows 10 work for you
with -nw?



Reply | Threaded
Open this post in threaded view
|

bug#38367: 26.3; Cannot start Emacs with -nw option, starting with Emacs 26.1

Juanma Barranquero

On Tue, Nov 26, 2019 at 1:56 AM Drew Adams <[hidden email]> wrote:

> 24.5 works fine for me with -nw.

Do you mean that if you create a desktop shortcut to 24.5's runemacs.exe that runs it with -Q -nw, and click on it, you get Emacs running in a console?

Because I get an Emacs running with a hidden console (no visible frame).

> That's what I've used for -nw in the past.
> But I just tried plain `emacs' for -nw, and
> that works too.  (I use plain `emacs' for GUI.)

I'm confused now. 

What do you mean with "That's what I've used for -nw in the past"? From a shortcut, or from CMD?

> Does Emacs 26 on Windows 10 work for you
> with -nw?

26.3 works as expected:

1) "emacs.exe -Q -nw" from CMD: starts a console Emacs inside CMD
2) "emacs.exe -Q" from CMD: starts a windows Emacs, but it's attached to the original CMD.
3) "runemacs.exe -Q -nw" from CMD: starts a detached console Emacs (i.e., I see nothing because there's no window)
4) "runemacs.exe -Q" from CMD: starts a detached windows Emacs (CMD is available to use).

5) "emacs.exe -Q -nw" from a shortcut: stars a console Emacs.
6) "emacs.exe -Q" from a shortcut: Stars a windows Emacs, but there's a visible console.
7) "runemacs.exe -Q -nw" from a shortcut: starts a console Emacs, but the console is hidden, so nothing is visible.
8) "runemacs.exe -Q" from a shortcut: starts a windows Emacs.

Basically, runemacs.exe exists *specifically* to help with 2) and 6), because windows Emacs *always* creates a console, but when you're running a windows Emacs, you don't want to see it (it's just a nuisance).

But if you're trying to run a console Emacs, "emacs.exe -Q -nw" is what you want, either in a shortcut or from the command line.

So, what you see is not a bug, and I think it's always been so. I just tried with 20.7.3 and I get the very same behavior.


Reply | Threaded
Open this post in threaded view
|

bug#38367: 26.3; Cannot start Emacs with -nw option, starting with Emacs 26.1

Drew Adams
>> 24.5 works fine for me with -nw.

> Do you mean that if you create a desktop shortcut to 24.5's runemacs.exe that runs it with -Q -nw, and click on it, you get Emacs running in a console?

That's what I meant.  But I had it backward
(`emacs' vs `runemacs').  Sorry for the noise -
I'll close the bug.

The Target on the Shortcut tab is this:

y:\Emacs-24.5\bin\emacs.exe -nw
                  ^^^^^

That works fine for me in all Emacs versions,
including 24.5 and 26.x.

I don't actually use -nw, except rarely, for
testing something.  For 26.x I tried to do
what I've done before for -nw, but I got it
backward.

> What do you mean with "That's what I've used for -nw in the past"? From a shortcut, or from CMD?

I always use shortcuts, not CMD.

What I meant and wrote was backward from what I
actually do (which works, including in Emacs 26).

I use `runemacs', not `emacs', for GUI, and
I use `emacs', not `runemacs', for -nw.

What I said was mistakenly the opposite of that.

Thanks.



Reply | Threaded
Open this post in threaded view
|

bug#38367: 26.3; Cannot start Emacs with -nw option, starting with Emacs 26.1

martin rudalics
In reply to this post by Juanma Barranquero
 > 1) "emacs.exe -Q -nw" from CMD: starts a console Emacs inside CMD
 > 2) "emacs.exe -Q" from CMD: starts a windows Emacs, but it's attached to
 > the original CMD.
 > 3) "runemacs.exe -Q -nw" from CMD: starts a detached console Emacs (i.e., I
 > see nothing because there's no window)
 > 4) "runemacs.exe -Q" from CMD: starts a detached windows Emacs (CMD is
 > available to use).
 >
 > 5) "emacs.exe -Q -nw" from a shortcut: stars a console Emacs.
 > 6) "emacs.exe -Q" from a shortcut: Stars a windows Emacs, but there's a
 > visible console.
 > 7) "runemacs.exe -Q -nw" from a shortcut: starts a console Emacs, but the
 > console is hidden, so nothing is visible.
 > 8) "runemacs.exe -Q" from a shortcut: starts a windows Emacs.

This is a nice summary.  Couldn't we add it somewhere to nt/README?

Thanks, martin



Reply | Threaded
Open this post in threaded view
|

bug#38367: 26.3; Cannot start Emacs with -nw option, starting with Emacs 26.1

Juanma Barranquero


On Tue, Nov 26, 2019 at 10:33 AM martin rudalics <[hidden email]> wrote:

> This is a nice summary.  Couldn't we add it somewhere to nt/README?

I think it would add confusion. If anything, perhaps nt/README should be a
bit more specific about what to do if the user wants to run a console emacs.
Currently it just says:

  + emacs.exe - The main Emacs executable.  As this is designed to run
    as both a text-mode application (emacs -nw) and as a GUI application,
    it will pop up a command prompt window if run directly from Explorer.

  + runemacs.exe - A wrapper for running Emacs as a GUI application
    without popping up a command prompt window.  If you create a
    desktop shortcut for invoking Emacs, make it point to this
    executable, not to emacs.exe.


Reply | Threaded
Open this post in threaded view
|

bug#38367: 26.3; Cannot start Emacs with -nw option, starting with Emacs 26.1

Tomas Nordin-2
Juanma Barranquero <[hidden email]> writes:

> On Tue, Nov 26, 2019 at 10:33 AM martin rudalics <[hidden email]> wrote:
>
>> This is a nice summary.  Couldn't we add it somewhere to nt/README?
>
> I think it would add confusion. If anything, perhaps nt/README should be a
> bit more specific about what to do if the user wants to run a console emacs.
> Currently it just says:
>
>   + emacs.exe - The main Emacs executable.  As this is designed to run
>     as both a text-mode application (emacs -nw) and as a GUI application,
>     it will pop up a command prompt window if run directly from Explorer.
>
>   + runemacs.exe - A wrapper for running Emacs as a GUI application
>     without popping up a command prompt window.  If you create a
>     desktop shortcut for invoking Emacs, make it point to this
>     executable, not to emacs.exe.

Which is to the point and just fine, isn't it? Possibly consider
changing "text-mode" to "command prompt" since that wording is used
later in the sentence (in the first bullet).

diff --git a/nt/README b/nt/README
index de68162131..aa5be96f56 100644
--- a/nt/README
+++ b/nt/README
@@ -26,8 +26,9 @@
   files in the bin directory.
 
   + emacs.exe - The main Emacs executable.  As this is designed to run
-    as both a text-mode application (emacs -nw) and as a GUI application,
-    it will pop up a command prompt window if run directly from Explorer.
+    as both a command prompt application (emacs -nw) and as a GUI
+    application, it will pop up a command prompt window as well, if run
+    directly from Explorer.
 
   + runemacs.exe - A wrapper for running Emacs as a GUI application
     without popping up a command prompt window.  If you create a


Best regards
--
Tomas



Reply | Threaded
Open this post in threaded view
|

bug#38367: 26.3; Cannot start Emacs with -nw option, starting with Emacs 26.1

Eli Zaretskii
> From: Tomas Nordin <[hidden email]>
> Date: Sat, 07 Dec 2019 19:22:38 +0100
> Cc: [hidden email]
>
> >   + emacs.exe - The main Emacs executable.  As this is designed to run
> >     as both a text-mode application (emacs -nw) and as a GUI application,
> >     it will pop up a command prompt window if run directly from Explorer.
> >
> >   + runemacs.exe - A wrapper for running Emacs as a GUI application
> >     without popping up a command prompt window.  If you create a
> >     desktop shortcut for invoking Emacs, make it point to this
> >     executable, not to emacs.exe.
>
> Which is to the point and just fine, isn't it? Possibly consider
> changing "text-mode" to "command prompt"

That loses information, since the -nw switch does make the session
text-mode, unlike other invocations from the command prompt.