view emacs/e.bat @ 648:898e6d98f933

Translated comments into English.
author Oleksandr Gavenko <gavenkoa@gmail.com>
date Wed, 19 Dec 2018 01:06:46 +0200
parents a9aa9260f4a2
children
line wrap: on
line source
@echo off

REM Written by Oleksandr Gavenko <gavenkoa@gmail.com>, 2008, 2015.
REM File placed by author in public domain.

REM View files in emacs buffer using emacsclientw.
REM If emacs not already running, run it.
REM Put this file (e.bat) in your PATH.
REM Name `e' because `edit'. `ew' wait to `C-x #'. `ec' create new frame.

REM If path to file contain spaces it must be inclosed into quotes.

for %%X in (emacsclient-w32.exe) do (set FOUND=%%~$PATH:X)
if defined FOUND (
  rem Cygwin Emacs-w32.
  set EMACSCLIENT=run.exe --quote emacsclient-w32
) else (
  rem Native Emacs.
  set RUNEMACSARG=-a runemacs
  set EMACSCLIENT=emacsclientw
)

if x%1 == x-h     goto usage
if x%1 == x-help  goto usage
if x%1 == x--help goto usage

if %~n0 == e goto cmd_e
if %~n0 == ew goto cmd_ew
if %~n0 == ec goto cmd_ec
if %~n0 == et goto cmd_et

echo Unknown command flavor: %~n0, use one of e/ew/ec/et.
exit 1

:cmd_e
set args=-n
goto invoke
:cmd_ew
set args=
goto invoke
:cmd_ec
set args=-c
goto invoke
:cmd_et
set args=-t
goto invoke

:invoke
if x%1 == x (
  %EMACSCLIENT% %RUNEMACSARG% %args% .
) else (
  %EMACSCLIENT% %RUNEMACSARG% %args% %*
)
goto :eof

:usage
@echo Shortcut for %EMACSCLIENT% for busy people.
@echo Usage:
@echo   e [-h^|--help] file...
goto :eof