annotate emacs/e.bat @ 602:29d5e6e64da8

Port ew/ec/et commands to Windows batch file.
author Oleksandr Gavenko <gavenkoa@gmail.com>
date Wed, 16 Dec 2015 00:04:39 +0200
parents 12e37fe91d89
children 83f25a2581e3
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2
06536c9e15d4 Added file from bin/path.
Oleksandr Gavenko <gavenko@bifit.com.ua>
parents:
diff changeset
1 @echo off
211
ea15eb62b804 Update copyright.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 209
diff changeset
2
ea15eb62b804 Update copyright.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 209
diff changeset
3 REM Written by Oleksandr Gavenko <gavenkoa@gmail.com>, 2008.
ea15eb62b804 Update copyright.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 209
diff changeset
4 REM File placed by author in public domain.
2
06536c9e15d4 Added file from bin/path.
Oleksandr Gavenko <gavenko@bifit.com.ua>
parents:
diff changeset
5
387
83d9a15e3614 Fix doc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 386
diff changeset
6 REM View files in emacs buffer using emacsclientw.
7
2f3ca206301b If emacs not already running, run it.
Oleksander Gavenko <gavenko_a@3g.ua>
parents: 6
diff changeset
7 REM If emacs not already running, run it.
5
7c6b58c4f138 Added r.bat. Added copyright notice.
Oleksander Gavenko <gavenko_a@3g.ua>
parents: 3
diff changeset
8 REM Put this file (e.bat) in your PATH.
87
8c181c0bf731 Spell correction. Correct email.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 13
diff changeset
9 REM Name `e' because `edit'.
5
7c6b58c4f138 Added r.bat. Added copyright notice.
Oleksander Gavenko <gavenko_a@3g.ua>
parents: 3
diff changeset
10
245
8d4828549738 Enclose %1 into quotes is danger because if %1 equal to "a b" result expression ""a b"" has two words, not one enclosed into quotes!
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 211
diff changeset
11 REM If path to file contain spaces it must be inclosed into quotes.
8d4828549738 Enclose %1 into quotes is danger because if %1 equal to "a b" result expression ""a b"" has two words, not one enclosed into quotes!
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 211
diff changeset
12
8d4828549738 Enclose %1 into quotes is danger because if %1 equal to "a b" result expression ""a b"" has two words, not one enclosed into quotes!
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 211
diff changeset
13 if x%1 == x-h goto usage
8d4828549738 Enclose %1 into quotes is danger because if %1 equal to "a b" result expression ""a b"" has two words, not one enclosed into quotes!
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 211
diff changeset
14 if x%1 == x-help goto usage
8d4828549738 Enclose %1 into quotes is danger because if %1 equal to "a b" result expression ""a b"" has two words, not one enclosed into quotes!
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 211
diff changeset
15 if x%1 == x--help goto usage
8d4828549738 Enclose %1 into quotes is danger because if %1 equal to "a b" result expression ""a b"" has two words, not one enclosed into quotes!
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 211
diff changeset
16
602
29d5e6e64da8 Port ew/ec/et commands to Windows batch file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 388
diff changeset
17 if %~n0 == e goto cmd_e
29d5e6e64da8 Port ew/ec/et commands to Windows batch file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 388
diff changeset
18 if %~n0 == ew goto cmd_ew
29d5e6e64da8 Port ew/ec/et commands to Windows batch file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 388
diff changeset
19 if %~n0 == ec goto cmd_ec
29d5e6e64da8 Port ew/ec/et commands to Windows batch file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 388
diff changeset
20 if %~n0 == et goto cmd_et
29d5e6e64da8 Port ew/ec/et commands to Windows batch file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 388
diff changeset
21
29d5e6e64da8 Port ew/ec/et commands to Windows batch file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 388
diff changeset
22 echo Unknown command flavor: %~n0, use one of e/ew/ec/et.
29d5e6e64da8 Port ew/ec/et commands to Windows batch file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 388
diff changeset
23 exit 1
29d5e6e64da8 Port ew/ec/et commands to Windows batch file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 388
diff changeset
24
29d5e6e64da8 Port ew/ec/et commands to Windows batch file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 388
diff changeset
25 :cmd_e
29d5e6e64da8 Port ew/ec/et commands to Windows batch file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 388
diff changeset
26 set args=-a runemacs -n
29d5e6e64da8 Port ew/ec/et commands to Windows batch file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 388
diff changeset
27 goto invoke
29d5e6e64da8 Port ew/ec/et commands to Windows batch file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 388
diff changeset
28 :cmd_ew
29d5e6e64da8 Port ew/ec/et commands to Windows batch file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 388
diff changeset
29 set args=-a runemacs
29d5e6e64da8 Port ew/ec/et commands to Windows batch file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 388
diff changeset
30 goto invoke
29d5e6e64da8 Port ew/ec/et commands to Windows batch file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 388
diff changeset
31 :cmd_ec
29d5e6e64da8 Port ew/ec/et commands to Windows batch file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 388
diff changeset
32 set args=-a runemacs -c
29d5e6e64da8 Port ew/ec/et commands to Windows batch file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 388
diff changeset
33 goto invoke
29d5e6e64da8 Port ew/ec/et commands to Windows batch file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 388
diff changeset
34 :cmd_et
29d5e6e64da8 Port ew/ec/et commands to Windows batch file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 388
diff changeset
35 set args=-a runemacs -t
29d5e6e64da8 Port ew/ec/et commands to Windows batch file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 388
diff changeset
36 goto invoke
29d5e6e64da8 Port ew/ec/et commands to Windows batch file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 388
diff changeset
37
29d5e6e64da8 Port ew/ec/et commands to Windows batch file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 388
diff changeset
38 :invoke
29d5e6e64da8 Port ew/ec/et commands to Windows batch file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 388
diff changeset
39 if x%1 == x (
29d5e6e64da8 Port ew/ec/et commands to Windows batch file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 388
diff changeset
40 emacsclientw %args% .
29d5e6e64da8 Port ew/ec/et commands to Windows batch file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 388
diff changeset
41 ) else (
29d5e6e64da8 Port ew/ec/et commands to Windows batch file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 388
diff changeset
42 emacsclientw %args% %*
29d5e6e64da8 Port ew/ec/et commands to Windows batch file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 388
diff changeset
43 )
246
f9b1f51b8ac4 Use built-in :eol label to exit.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 245
diff changeset
44 goto :eof
2
06536c9e15d4 Added file from bin/path.
Oleksandr Gavenko <gavenko@bifit.com.ua>
parents:
diff changeset
45
06536c9e15d4 Added file from bin/path.
Oleksandr Gavenko <gavenko@bifit.com.ua>
parents:
diff changeset
46 :usage
388
12e37fe91d89 Fix usage docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 387
diff changeset
47 @echo Shortcut for emacsclientw for busy people.
247
98e3b92920c7 Make better description in help.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 246
diff changeset
48 @echo Usage:
388
12e37fe91d89 Fix usage docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 387
diff changeset
49 @echo e [-h^|--help] file...
602
29d5e6e64da8 Port ew/ec/et commands to Windows batch file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 388
diff changeset
50 goto :eof