changeset 634:44b6346fd952

run.exe fails to run from mintty. So I removed tricks with run.exe and start with admin privileges and wrote separate utility to start Emacs with high privileges.
author Oleksandr Gavenko <gavenkoa@gmail.com>
date Tue, 13 Jun 2017 01:09:50 +0300
parents fcf0302e287e
children c680d6e03c87
files emacs/Makefile emacs/e emacs/e.bat emacs/re.bat
diffstat 4 files changed, 10 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/emacs/Makefile	Sun May 07 13:05:05 2017 +0300
+++ b/emacs/Makefile	Tue Jun 13 01:09:50 2017 +0300
@@ -85,6 +85,7 @@
 .PHONY: install-win
 install-win: install-init
 	\
+$(INSTALL_PROGRAM) re.bat $(bindir)/re.bat; \
 for f in $(BIN_FILES); do \
   $(INSTALL_PROGRAM) e.bat $(bindir)/$$f.bat; \
 done
--- a/emacs/e	Sun May 07 13:05:05 2017 +0300
+++ b/emacs/e	Tue Jun 13 01:09:50 2017 +0300
@@ -22,26 +22,21 @@
     exec cygstart --action=runas run emacs-w32
 fi
 
-emacs_cmd=emacs
+emacs_cmd="-a emacs"
 if [ -n "$COMSPEC" ]; then
-    # We probably under Windows like OS. I like Cygwin emacs-w32.
-    emacs_cmd=emacs-w32
+    # We probably under Windows. Don't try to start Emacs as fallback.
+    emacs_cmd=
 fi
 
 case ${0##*/} in
-  ew) args="-a ${emacs_cmd}" ;;
+  ew) args="${emacs_cmd}" ;;
   ec) args="-c" ;;
   et) args="-t" ;;
-  *) args="-a ${emacs_cmd} -n" ;;
+  *) args="${emacs_cmd} -n" ;;
 esac
 
 if [ -n "$COMSPEC" ]; then
-    # We probably under Windows like OS. I like Cygwin emacs-w32.
-    case ${0##*/} in
-      # 'run' utility detach from terminal, need special care.
-      et) exec emacsclient-w32 $args -- "$@" ;;
-      *) exec run --quote emacsclient-w32 $args -- "$@" ;;
-    esac
+    exec emacsclient-w32 $args -- "$@"
 fi
 
 f=`readlink -f "$1"`
--- a/emacs/e.bat	Sun May 07 13:05:05 2017 +0300
+++ b/emacs/e.bat	Tue Jun 13 01:09:50 2017 +0300
@@ -13,9 +13,7 @@
 for %%X in (emacsclient-w32.exe) do (set FOUND=%%~$PATH:X)
 if defined FOUND (
   rem Cygwin Emacs-w32.
-  set RUNEMACSARG=-a e
   set EMACSCLIENT=run.exe --quote emacsclient-w32
-  set MAKECYGEMACSADMIN=yes
 ) else (
   rem Native Emacs.
   set RUNEMACSARG=-a runemacs
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emacs/re.bat	Tue Jun 13 01:09:50 2017 +0300
@@ -0,0 +1,3 @@
+@echo off
+
+cygstart --action=runas run emacs-w32