I haven't used Windows for a long time and new job may require Windows environment. So I checked out new ways to use Emacs under Windows.
I used to prefer native Emacs over Cygwin because of native widgets and copy/paste. With cygwin-mount cross-compiling from Cygwin to native win application would be easy.
The only problem I encountered that hg is a Python script, not an executable and can't be called from native Emacs. To work around with issue I wrote simple Cygwin application that route call and arguments to script.
So you just rename this utility to
$SCRIPT.exe and put it behind Cygwin in a
PATH. It have
basic protection from infinite calling to itself and allows using of scripts under from Cygwin in
native Windows application, like native Emacs.
Source code of utility is available on http://hg.defun.work/utils/file/tip/cygwin/cygrun/cygrun.c
But I constantly have issue with VC mode. Native Emacs is wrongly determining file revision and
reported it as string
rev. That it's due to quoting and wrong Emacs code assumption:
Re: Using Cygwin Emacs.
Starting X for graphical Emacs seems too complicated, but possible. Especially by using multi-window:
but all programs should be started with
With some tweaking it is possible smoother integration:
XWin -clipboard -silent-dup-error -xkblayout "us,ru" -xkboptions "grp:caps_toggle"
Nowadays there is
emacs-w32 build in Cygwin repositories. It uses native widgets and in all
other cases is regular Cygwin application. So I have Hg/Git and TRAMP working out of the box!
Only issue with
emacs-w32 executable is that all Cygwin executables compiled with
-mconsole (which is by default). That causes opening Windows console
window along with GUI. That console window distracts me during
Re: Is it possible to hide emacs-w32 console window?
Cygwin programs can't be compiled with
--subsystem=windows). Reason for this
run(1) man page:
run - start programs with hidden console window SYNOPSIS run [ -p path ] command [ --wait ] [ --quote ] arguments runcommand [ -p path ] [ --wait ] [ --quote ] arguments DESCRIPTION Windows programs are either GUI programs or console programs. When started console programs will either attach to an existing console or create a new one. GUI programs can never attach to an exiting console. There is no way to attach to an existing console but hide it if started as GUI program. run will do this for you. It works as intermediate and starts a program but makes the console window hidden.
run command helps to hide console window. So you should start Emacs as:
I have "smart" starter of Emacs with short and convenient for quick typing name
e and batch file
e.bat. Because I switched to
emacs-w32 as a default for Windows I updated
implementation to take care about
run emacsclient-w32 -a emacs-w32 %*
Full script available at:: http://hg.defun.work/utils/file/tip/emacs/e.bat