changeset 629:815567721a82

Increase privileges for Cygwin emacs-w32.
author Oleksandr Gavenko <gavenkoa@gmail.com>
date Tue, 14 Feb 2017 23:36:32 +0200
parents d7536d442db1
children ad57cd9cc810
files emacs/e emacs/e.bat
diffstat 2 files changed, 9 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/emacs/e	Tue Feb 14 22:42:52 2017 +0200
+++ b/emacs/e	Tue Feb 14 23:36:32 2017 +0200
@@ -17,6 +17,11 @@
     ;;
 esac
 
+if [[ "$MAKECYGEMACSADMIN" = yes ]]; then
+    unset MAKECYGEMACSADMIN
+    exec cygstart --action=runas run emacs-w32
+fi
+
 emacs_cmd=emacs
 if [ -n "$COMSPEC" ]; then
     # We probably under Windows like OS. I like Cygwin emacs-w32.
@@ -32,7 +37,7 @@
 
 if [ -n "$COMSPEC" ]; then
     # We probably under Windows like OS. I like Cygwin emacs-w32.
-    exec run emacsclient-w32 $args -- "$@"
+    exec run --quote emacsclient-w32 $args -- "$@"
 fi
 
 f=`readlink -f "$1"`
--- a/emacs/e.bat	Tue Feb 14 22:42:52 2017 +0200
+++ b/emacs/e.bat	Tue Feb 14 23:36:32 2017 +0200
@@ -10,13 +10,12 @@
 
 REM If path to file contain spaces it must be inclosed into quotes.
 
-setlocal
-
 for %%X in (emacsclient-w32.exe) do (set FOUND=%%~$PATH:X)
 if defined FOUND (
   rem Cygwin Emacs-w32.
-  set RUNEMACSARG=-a emacs-w32
-  set EMACSCLIENT=run emacsclient-w32
+  set RUNEMACSARG=-a e
+  set EMACSCLIENT=run --quote emacsclient-w32
+  set MAKECYGEMACSADMIN=yes
 ) else (
   rem Native Emacs.
   set RUNEMACSARG=-a runemacs