I haven't used Windows for a long time and my 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 Windows application would be easy.
The only problem I've encountered is that
hg is a Python script, not an executable and can't be
called from native Emacs. To work around an issue I wrote simple Cygwin application that re-route
call and arguments to the script.
Just rename this utility to
$SCRIPT.exe and put it behind Cygwin in the
PATH. It has a basic
protection from infinite calling to itself and allows using of Cygwin scripts 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 integration will be smoother:
XWin -clipboard -silent-dup-error -xkblayout "us,ru" -xkboptions "grp:caps_toggle"
Nowadays there is
emacs-w32 build in Cygwin repository. It uses native widgets but in all other
cases it is a regular Cygwin application. So I will have Hg/Git and TRAMP working out of the box!
The 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 app 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 name for quick typing:
e and batch
e.bat. Because I switched to
emacs-w32 as a default for Windows I updated
implementation to use
run emacsclient-w32 -a emacs-w32 %*
Full script is available at:: http://hg.defun.work/utils/file/tip/emacs/e.bat