* A DOS box starting Emacs (w32) @ 2014-02-11 22:53 Angelo Graziosi 2014-02-11 23:46 ` Juanma Barranquero 0 siblings, 1 reply; 19+ messages in thread From: Angelo Graziosi @ 2014-02-11 22:53 UTC (permalink / raw) To: emacs-devel Using the binaries for trunk rev. 116256-20140203 from https://sourceforge.net/projects/emacs-bin, I notice the following behaviour... On Win7 (64bit), Emacs starts normally, i.e. without a DOS box, using the link created by "addpm" in the Start menu. But if I add Emacs to the applications bar (mouse-3 on the Emacs icon and then click on "Add this application to the applications bar"), and then I start Emacs from that bar, a DOS box opens behind the Emacs frame. Is this to be expected? If I close the DOS box also Emacs closes... Ciao, Angelo. ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: A DOS box starting Emacs (w32) 2014-02-11 22:53 A DOS box starting Emacs (w32) Angelo Graziosi @ 2014-02-11 23:46 ` Juanma Barranquero 2014-02-12 0:11 ` Angelo Graziosi ` (2 more replies) 0 siblings, 3 replies; 19+ messages in thread From: Juanma Barranquero @ 2014-02-11 23:46 UTC (permalink / raw) To: Angelo Graziosi; +Cc: Emacs developers On Tue, Feb 11, 2014 at 11:53 PM, Angelo Graziosi <angelo.graziosi@alice.it> wrote: > But if I add Emacs to the applications bar (mouse-3 on the Emacs icon and > then click on "Add this application to the applications bar"), and then I > start Emacs from that bar, a DOS box opens behind the Emacs frame. Modify the shortcut so it runs runemacs.exe, not emacs.exe. J ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: A DOS box starting Emacs (w32) 2014-02-11 23:46 ` Juanma Barranquero @ 2014-02-12 0:11 ` Angelo Graziosi 2014-02-12 1:10 ` Juanma Barranquero 2014-02-12 5:06 ` Kalle Olavi Niemitalo 2014-02-12 7:37 ` Dani Moncayo 2 siblings, 1 reply; 19+ messages in thread From: Angelo Graziosi @ 2014-02-12 0:11 UTC (permalink / raw) To: Juanma Barranquero; +Cc: Emacs developers Ciao Juanma, Il 12/02/2014 00:46, Juanma Barranquero ha scritto: > On Tue, Feb 11, 2014 at 11:53 PM, Angelo Graziosi > <angelo.graziosi@alice.it> wrote: > >> But if I add Emacs to the applications bar (mouse-3 on the Emacs icon and >> then click on "Add this application to the applications bar"), and then I >> start Emacs from that bar, a DOS box opens behind the Emacs frame. > > Modify the shortcut so it runs runemacs.exe, not emacs.exe. but it ALREADY runs runemacs.exe!!! Opening the links, it has, as target, C:\Emacs.app\bin\runemacs.exe (C:\Emacs.app is the root of Emacs tree...) Ciao, Angelo. ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: A DOS box starting Emacs (w32) 2014-02-12 0:11 ` Angelo Graziosi @ 2014-02-12 1:10 ` Juanma Barranquero 2014-02-12 10:41 ` Angelo Graziosi 0 siblings, 1 reply; 19+ messages in thread From: Juanma Barranquero @ 2014-02-12 1:10 UTC (permalink / raw) To: Angelo Graziosi; +Cc: Emacs developers > but it ALREADY runs runemacs.exe!!! I mean the shortcut created in the taskbar when you left-click and select "Add this application to the applications bar", not the shortcut in the Start menu.. J ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: A DOS box starting Emacs (w32) 2014-02-12 1:10 ` Juanma Barranquero @ 2014-02-12 10:41 ` Angelo Graziosi 0 siblings, 0 replies; 19+ messages in thread From: Angelo Graziosi @ 2014-02-12 10:41 UTC (permalink / raw) To: Juanma Barranquero; +Cc: Emacs developers Oops... Il 12/02/2014 02:10, Juanma Barranquero ha scritto: >> but it ALREADY runs runemacs.exe!!! > > I mean the shortcut created in the taskbar when you left-click and > select "Add this application to the applications bar", not the > shortcut in the Start menu.. I didn't understand that... Now I have fixed this issue... In any case, what Dani suggests seems the main way to avoid it.. :) Thanks, Angelo. ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: A DOS box starting Emacs (w32) 2014-02-11 23:46 ` Juanma Barranquero 2014-02-12 0:11 ` Angelo Graziosi @ 2014-02-12 5:06 ` Kalle Olavi Niemitalo 2014-02-12 10:50 ` Juanma Barranquero 2014-02-12 16:22 ` Eli Zaretskii 2014-02-12 7:37 ` Dani Moncayo 2 siblings, 2 replies; 19+ messages in thread From: Kalle Olavi Niemitalo @ 2014-02-12 5:06 UTC (permalink / raw) To: Juanma Barranquero; +Cc: Emacs developers Juanma Barranquero <lekktu@gmail.com> writes: > On Tue, Feb 11, 2014 at 11:53 PM, Angelo Graziosi > <angelo.graziosi@alice.it> wrote: > >> But if I add Emacs to the applications bar (mouse-3 on the Emacs icon and >> then click on "Add this application to the applications bar"), and then I >> start Emacs from that bar, a DOS box opens behind the Emacs frame. > > Modify the shortcut so it runs runemacs.exe, not emacs.exe. On MS-Windows 7 or later, emacs.exe could automate this by setting the System.AppUserModel.RelaunchCommand property on its windows. It would have to detect whether the property should refer to emacs.exe or runemacs.exe. Because runemacs.c sets start.wShowWindow = SW_HIDE when it calls CreateProcess, emacs.exe could perhaps call GetConsoleWindow and IsWindowVisible, or call GetStartupInfo and check wShowWindow. Some of the necessary functions don't exist in MS-Windows 9X, so GetProcAddress would have to be used. ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: A DOS box starting Emacs (w32) 2014-02-12 5:06 ` Kalle Olavi Niemitalo @ 2014-02-12 10:50 ` Juanma Barranquero 2014-02-12 16:22 ` Eli Zaretskii 1 sibling, 0 replies; 19+ messages in thread From: Juanma Barranquero @ 2014-02-12 10:50 UTC (permalink / raw) To: Kalle Olavi Niemitalo; +Cc: Emacs developers On Wed, Feb 12, 2014 at 6:06 AM, Kalle Olavi Niemitalo <kon@iki.fi> wrote: > On MS-Windows 7 or later, emacs.exe could automate this by > setting the System.AppUserModel.RelaunchCommand property on its > windows. Would you file a wishlist bug report with a suitable patch, please? J ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: A DOS box starting Emacs (w32) 2014-02-12 5:06 ` Kalle Olavi Niemitalo 2014-02-12 10:50 ` Juanma Barranquero @ 2014-02-12 16:22 ` Eli Zaretskii 1 sibling, 0 replies; 19+ messages in thread From: Eli Zaretskii @ 2014-02-12 16:22 UTC (permalink / raw) To: Kalle Olavi Niemitalo; +Cc: lekktu, emacs-devel > From: Kalle Olavi Niemitalo <kon@iki.fi> > Date: Wed, 12 Feb 2014 07:06:32 +0200 > Cc: Emacs developers <emacs-devel@gnu.org> > > On MS-Windows 7 or later, emacs.exe could automate this by > setting the System.AppUserModel.RelaunchCommand property on its > windows. AFAIU, this will avoid Angelo's problem with pinning of Emacs icons (solving which is probably a Good Thing), but it doesn't resolve the issues that cause us to have runemacs.exe in the first place. IOW, runemacs.exe will still need to be available, even if we adopt this technique. > It would have to detect whether the property should refer to > emacs.exe or runemacs.exe. Because runemacs.c sets start.wShowWindow > = SW_HIDE when it calls CreateProcess, emacs.exe could perhaps call > GetConsoleWindow and IsWindowVisible, or call GetStartupInfo and check > wShowWindow. Why is this logic needed? Are there any circumstances where the pinned icon should invoke emacs.exe, rather than runemacs.exe? ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: A DOS box starting Emacs (w32) 2014-02-11 23:46 ` Juanma Barranquero 2014-02-12 0:11 ` Angelo Graziosi 2014-02-12 5:06 ` Kalle Olavi Niemitalo @ 2014-02-12 7:37 ` Dani Moncayo 2014-02-12 10:48 ` Juanma Barranquero 2014-02-12 16:20 ` Eli Zaretskii 2 siblings, 2 replies; 19+ messages in thread From: Dani Moncayo @ 2014-02-12 7:37 UTC (permalink / raw) To: Juanma Barranquero; +Cc: Emacs developers, Angelo Graziosi On Wed, Feb 12, 2014 at 12:46 AM, Juanma Barranquero <lekktu@gmail.com> wrote: > On Tue, Feb 11, 2014 at 11:53 PM, Angelo Graziosi > <angelo.graziosi@alice.it> wrote: > >> But if I add Emacs to the applications bar (mouse-3 on the Emacs icon and >> then click on "Add this application to the applications bar"), and then I >> start Emacs from that bar, a DOS box opens behind the Emacs frame. > > Modify the shortcut so it runs runemacs.exe, not emacs.exe. If it was possible, it'd be nice if we could get rid of "runemacs.exe", and always use "emacs.exe" like on the rest of platforms. AFAIK, what "runemacs.exe" does is to asynchronously invoke "emacs.exe" and then close/kill the CMD window. Wouldn't it be possible to achieve the same behavior from "emacs.exe"? -- Dani Moncayo ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: A DOS box starting Emacs (w32) 2014-02-12 7:37 ` Dani Moncayo @ 2014-02-12 10:48 ` Juanma Barranquero 2014-02-12 12:30 ` Fabrice Popineau 2014-02-12 16:21 ` Eli Zaretskii 2014-02-12 16:20 ` Eli Zaretskii 1 sibling, 2 replies; 19+ messages in thread From: Juanma Barranquero @ 2014-02-12 10:48 UTC (permalink / raw) To: Dani Moncayo; +Cc: Emacs developers, Angelo Graziosi On Wed, Feb 12, 2014 at 8:37 AM, Dani Moncayo <dmoncayo@gmail.com> wrote: > AFAIK, what "runemacs.exe" does is to asynchronously invoke > "emacs.exe" and then close/kill the CMD window. Wouldn't it be > possible to achieve the same behavior from "emacs.exe"? IIRC, it would be possible, but then you would see the console being opened and then hidden, which is ugly. You could work around it by setting a shortcut to start Emacs hidden, but that doesn't help when you run emacs.exe directly from the Start menu, for example. The whole runemacs/emacs dance is here to avoid that initial "open console / hide console" ugliness. J ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: A DOS box starting Emacs (w32) 2014-02-12 10:48 ` Juanma Barranquero @ 2014-02-12 12:30 ` Fabrice Popineau 2014-02-12 16:27 ` Eli Zaretskii 2014-02-12 16:21 ` Eli Zaretskii 1 sibling, 1 reply; 19+ messages in thread From: Fabrice Popineau @ 2014-02-12 12:30 UTC (permalink / raw) To: emacs-devel Juanma Barranquero <lekktu <at> gmail.com> writes: > > On Wed, Feb 12, 2014 at 8:37 AM, Dani Moncayo <dmoncayo <at> gmail.com> wrote: > > > AFAIK, what "runemacs.exe" does is to asynchronously invoke > > "emacs.exe" and then close/kill the CMD window. Wouldn't it be > > possible to achieve the same behavior from "emacs.exe"? > > IIRC, it would be possible, but then you would see the console being > opened and then hidden, which is ugly. You could work around it by > setting a shortcut to start Emacs hidden, but that doesn't help when > you run emacs.exe directly from the Start menu, for example. The whole > runemacs/emacs dance is here to avoid that initial "open console / > hide console" ugliness. > > J > AFAIK, there is no clean solution to build an app which is both a console app and a gui app. http://blogs.msdn.com/b/oldnewthing/archive/2009/01/01/9259142.aspx Anyway, if you dare to use it, you can try my own binaries for Emacs-W64 : http://semantic.supelec.fr/popineau/programming-emacs.html#sec-2 There is a version of emacsclient borrowed from EmacsW32 which is more friendly than the pair runemacs/emacs . Basically, emacsclient is used to launch emacs and no console show off. Fabrice > ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: A DOS box starting Emacs (w32) 2014-02-12 12:30 ` Fabrice Popineau @ 2014-02-12 16:27 ` Eli Zaretskii 2014-02-12 16:52 ` Juanma Barranquero 0 siblings, 1 reply; 19+ messages in thread From: Eli Zaretskii @ 2014-02-12 16:27 UTC (permalink / raw) To: Fabrice Popineau; +Cc: emacs-devel > From: Fabrice Popineau <fabrice.popineau@gmail.com> > Date: Wed, 12 Feb 2014 12:30:48 +0000 (UTC) > > There is a version of emacsclient borrowed from EmacsW32 which is more > friendly than the pair runemacs/emacs . > > Basically, emacsclient is used to launch emacs and no console show off. In what way is this more friendly than the "official" way of invoking Emacs? ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: A DOS box starting Emacs (w32) 2014-02-12 16:27 ` Eli Zaretskii @ 2014-02-12 16:52 ` Juanma Barranquero 2014-02-12 17:38 ` Eli Zaretskii 0 siblings, 1 reply; 19+ messages in thread From: Juanma Barranquero @ 2014-02-12 16:52 UTC (permalink / raw) To: Eli Zaretskii; +Cc: Fabrice Popineau, Emacs developers On Wed, Feb 12, 2014 at 5:27 PM, Eli Zaretskii <eliz@gnu.org> wrote: > In what way is this more friendly than the "official" way of invoking > Emacs? If no emacs instance is running, it starts emacs, waits for it to answer, and then connects with it as if the emacsclient had been successful in the first place. This is better in some cases that simply running emacs through -a, mostly when emacsclient is used to launch Emacs as editor for some app. But Lennart has not updated his emacsclient from the trunk in years, and it is different enough that integration of his changes is not trivial (not impossible, of course, just a non-negligible amount of work). J ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: A DOS box starting Emacs (w32) 2014-02-12 16:52 ` Juanma Barranquero @ 2014-02-12 17:38 ` Eli Zaretskii 2014-02-12 17:41 ` Juanma Barranquero 0 siblings, 1 reply; 19+ messages in thread From: Eli Zaretskii @ 2014-02-12 17:38 UTC (permalink / raw) To: Juanma Barranquero; +Cc: fabrice.popineau, emacs-devel > From: Juanma Barranquero <lekktu@gmail.com> > Date: Wed, 12 Feb 2014 17:52:44 +0100 > Cc: Fabrice Popineau <fabrice.popineau@gmail.com>, Emacs developers <emacs-devel@gnu.org> > > On Wed, Feb 12, 2014 at 5:27 PM, Eli Zaretskii <eliz@gnu.org> wrote: > > > In what way is this more friendly than the "official" way of invoking > > Emacs? > > If no emacs instance is running, it starts emacs, waits for it to > answer, and then connects with it as if the emacsclient had been > successful in the first place. This is better in some cases that > simply running emacs through -a, mostly when emacsclient is used to > launch Emacs as editor for some app. I understand why this is better when we indeed need the client functionality. I was asking why is this better when just invoking Emacs for the first time in a session, like after a system restart. ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: A DOS box starting Emacs (w32) 2014-02-12 17:38 ` Eli Zaretskii @ 2014-02-12 17:41 ` Juanma Barranquero 2014-02-12 19:16 ` Fabrice Popineau 0 siblings, 1 reply; 19+ messages in thread From: Juanma Barranquero @ 2014-02-12 17:41 UTC (permalink / raw) To: Eli Zaretskii; +Cc: Fabrice Popineau, Emacs developers On Wed, Feb 12, 2014 at 6:38 PM, Eli Zaretskii <eliz@gnu.org> wrote: > I was asking why is this better when just invoking > Emacs for the first time in a session, like after a system restart. I don't think Fabrice meant this, but let's hear him. J ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: A DOS box starting Emacs (w32) 2014-02-12 17:41 ` Juanma Barranquero @ 2014-02-12 19:16 ` Fabrice Popineau 0 siblings, 0 replies; 19+ messages in thread From: Fabrice Popineau @ 2014-02-12 19:16 UTC (permalink / raw) To: Juanma Barranquero; +Cc: Eli Zaretskii, Emacs developers [-- Attachment #1: Type: text/plain, Size: 823 bytes --] Well, before starting to use this modified emacsclient, I had the same complaint about the pair runemacs/emacs launching a spurious console. That was quite some time ago. Seeing this report, I infered too quickly that this was still a problem. If it isn't so, I apologize. Actually, looking at runemacs.c, I see that it takes care of a few things my old emacsclient.c doesn't. I wonder if it wouldn't be a good idea to merge both programs (runemacs + emacsclient) into one. Fabrice 2014-02-12 18:41 GMT+01:00 Juanma Barranquero <lekktu@gmail.com>: > On Wed, Feb 12, 2014 at 6:38 PM, Eli Zaretskii <eliz@gnu.org> wrote: > > > I was asking why is this better when just invoking > > Emacs for the first time in a session, like after a system restart. > > I don't think Fabrice meant this, but let's hear him. > > J > [-- Attachment #2: Type: text/html, Size: 1433 bytes --] ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: A DOS box starting Emacs (w32) 2014-02-12 10:48 ` Juanma Barranquero 2014-02-12 12:30 ` Fabrice Popineau @ 2014-02-12 16:21 ` Eli Zaretskii 2014-02-12 16:48 ` Juanma Barranquero 1 sibling, 1 reply; 19+ messages in thread From: Eli Zaretskii @ 2014-02-12 16:21 UTC (permalink / raw) To: Juanma Barranquero; +Cc: emacs-devel, angelo.graziosi, dmoncayo > From: Juanma Barranquero <lekktu@gmail.com> > Date: Wed, 12 Feb 2014 11:48:03 +0100 > Cc: Emacs developers <emacs-devel@gnu.org>, > Angelo Graziosi <angelo.graziosi@alice.it> > > You could work around it by setting a shortcut to start Emacs hidden How do you do that? I see only "minimized" and "maximized" options, but no "hidden" option. What am I missing? ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: A DOS box starting Emacs (w32) 2014-02-12 16:21 ` Eli Zaretskii @ 2014-02-12 16:48 ` Juanma Barranquero 0 siblings, 0 replies; 19+ messages in thread From: Juanma Barranquero @ 2014-02-12 16:48 UTC (permalink / raw) To: Eli Zaretskii; +Cc: Emacs developers, Angelo Graziosi, Dani Moncayo On Wed, Feb 12, 2014 at 5:21 PM, Eli Zaretskii <eliz@gnu.org> wrote: > How do you do that? I see only "minimized" and "maximized" options, > but no "hidden" option. What am I missing? Nothing, I misremembered. Sorry. ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: A DOS box starting Emacs (w32) 2014-02-12 7:37 ` Dani Moncayo 2014-02-12 10:48 ` Juanma Barranquero @ 2014-02-12 16:20 ` Eli Zaretskii 1 sibling, 0 replies; 19+ messages in thread From: Eli Zaretskii @ 2014-02-12 16:20 UTC (permalink / raw) To: Dani Moncayo; +Cc: lekktu, angelo.graziosi, emacs-devel > Date: Wed, 12 Feb 2014 08:37:15 +0100 > From: Dani Moncayo <dmoncayo@gmail.com> > Cc: Emacs developers <emacs-devel@gnu.org>, > Angelo Graziosi <angelo.graziosi@alice.it> > > If it was possible, it'd be nice if we could get rid of > "runemacs.exe", and always use "emacs.exe" like on the rest of > platforms. If it's possible, yes. Patches are welcome. > AFAIK, what "runemacs.exe" does is to asynchronously invoke > "emacs.exe" and then close/kill the CMD window. No, that's not what runemacs does. It invokes emacs.exe while specifying that its console window be hidden in the first place, and never shown, neither on the desktop nor in the task bar. This prevents momentarily flashing the console window, as well as several other potential problems. As a side effect, it also emulates the Posix "&" shell operator, when runemacs is invoked from a shell prompt (although this is not the main reason for having runemacs, as there are other method of achieving the same). > Wouldn't it be possible to achieve the same behavior from > "emacs.exe"? Maybe it is possible, but certainly not trivial, AFAIK. Patches are welcome; the requirements for such a single emacs.exe executable are as follows: . It should be able to run it as a console application with output to the same console from which it was invoked, when given the -nw or the -batch/--script options. . When run without the above switches, it should behave as a GUI application, i.e. create a GUI frame, start the message pump, etc. . When invoked from a shell prompt, it should support redirection as in "emacs > foo" (including redirection of stderr with 2> and 2>&1), both in GUI and in -nw/batch modes. . When invoked from a shell prompt, it should not release the console (this is actually a subtle prerequisite of the previous requirement, but is mentioned here explicitly because it is not immediately self-evident). . When invoked in the GUI mode, it should not display a console window of any kind, shape, or form, including not in the task bar. . It should support invocation in GUI mode using any method Windows provides for activating applications, including from a desktop shortcut, from the Start menu, and from the icon pinned to the task bar. . When invoked in the console/batch mode, it should not display any additional windows, GUI or otherwise. . In batch mode, it should be able to read keyboard input typed into the console window from which it was invoked. . It should support invocation from a debugger, as in "gdb ./emacs.exe". . It should be possible to invoke Emacs "as Administrator". ^ permalink raw reply [flat|nested] 19+ messages in thread
end of thread, other threads:[~2014-02-12 19:16 UTC | newest] Thread overview: 19+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2014-02-11 22:53 A DOS box starting Emacs (w32) Angelo Graziosi 2014-02-11 23:46 ` Juanma Barranquero 2014-02-12 0:11 ` Angelo Graziosi 2014-02-12 1:10 ` Juanma Barranquero 2014-02-12 10:41 ` Angelo Graziosi 2014-02-12 5:06 ` Kalle Olavi Niemitalo 2014-02-12 10:50 ` Juanma Barranquero 2014-02-12 16:22 ` Eli Zaretskii 2014-02-12 7:37 ` Dani Moncayo 2014-02-12 10:48 ` Juanma Barranquero 2014-02-12 12:30 ` Fabrice Popineau 2014-02-12 16:27 ` Eli Zaretskii 2014-02-12 16:52 ` Juanma Barranquero 2014-02-12 17:38 ` Eli Zaretskii 2014-02-12 17:41 ` Juanma Barranquero 2014-02-12 19:16 ` Fabrice Popineau 2014-02-12 16:21 ` Eli Zaretskii 2014-02-12 16:48 ` Juanma Barranquero 2014-02-12 16:20 ` Eli Zaretskii
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).