changeset 258:d13551cac5b3

Use one level hierarchy.
author Oleksandr Gavenko <gavenkoa@gmail.com>
date Sat, 20 Mar 2010 23:36:54 +0200
parents ffac34ac9254
children 5792dc4174fa
files emacs/Makefile emacs/e emacs/e.bat emacs/ew emacs/ew.bat emacs/unix/e emacs/unix/ew emacs/win/e emacs/win/e.bat emacs/win/ew.bat emacs/win/r.bat
diffstat 11 files changed, 113 insertions(+), 146 deletions(-) [+]
line wrap: on
line diff
--- a/emacs/Makefile	Sat Mar 20 23:22:18 2010 +0200
+++ b/emacs/Makefile	Sat Mar 20 23:36:54 2010 +0200
@@ -20,12 +20,9 @@
   host_os = windows
 endif
 
-# By default assume UNIX.
 ifeq 'windows' '$(host_os)'
-  SRCDIR = win
-  SRC_FNAMES = e e.bat ew.bat # r.bat
+  SRC_FNAMES = e ew e.bat ew.bat
 else
-  SRCDIR = unix
   SRC_FNAMES = e ew
 endif
 
@@ -41,7 +38,6 @@
 install:
 	[ -d $(bindir) ] || mkdir -p $(bindir)
 	[ -d $(man1dir) ] || mkdir -p $(man1dir)
-	cd $(SRCDIR); \
 	for file in $(SRC_FNAMES); do \
 		install -m 755 $$file $(bindir); \
 	done
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emacs/e	Sat Mar 20 23:36:54 2010 +0200
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+# Written by Oleksandr Gavenko <gavenkoa@gmail.com>, 2008.
+# File placed by author in public domain.
+
+# View file in emacs buffer using emacsclientw.
+# If emacs not already running, run it.
+# Put this file (e.bat) in your PATH.
+# Name `e' because `edit'.
+
+case "$1" in
+  -h|-help|--help)
+    echo "Emacsclient run script."
+    echo "Usage:"
+    echo "  e [-h|--help] <edit-files>"
+    exit 0
+    ;;
+  "")
+    echo "What file you want to open?"
+    exit 0
+    ;;
+esac
+
+if [ -n $COMPSPEC -a -n $WINDIR ]; then
+  # We under Windows like OS.
+  emacsclientw -a emacs -n "$1"
+else
+  # We under UNIX like OS.
+  emacsclient -a emacs -n "$1"
+fi
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emacs/e.bat	Sat Mar 20 23:36:54 2010 +0200
@@ -0,0 +1,26 @@
+@echo off
+
+REM Written by Oleksandr Gavenko <gavenkoa@gmail.com>, 2008.
+REM File placed by author in public domain.
+
+REM View file 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'.
+
+REM If path to file contain spaces it must be inclosed into quotes.
+
+REM Enclose %1 into quotes is danger because if %1 equal to "a b" result
+REM expression ""a b"" has two words, not one enclosed into quotes!
+
+if x%1 == x-h     goto usage
+if x%1 == x-help  goto usage
+if x%1 == x--help goto usage
+
+emacsclientw -a runemacs -n %1
+goto :eof
+
+:usage
+@echo Alias for emacsclient without waiting for editing ending.
+@echo Usage:
+@echo   e [-h^|--help] ^<edit-files^>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emacs/ew	Sat Mar 20 23:36:54 2010 +0200
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+# Written by Oleksandr Gavenko <gavenkoa@gmail.com>, 2008.
+# File placed by author in public domain.
+
+# Wait for end of editing file in emacs buffer using emacsclientw.
+# If emacs not already running, run it.
+# Put this file in your PATH.
+# Name `ew' because `edit and wait for C-x #'.
+
+case "$1" in
+  -h|-help|--help)
+    echo "Emacsclient run script."
+    echo "Usage:"
+    echo "  e [-h|--help] <edit-files>"
+    exit 0
+    ;;
+  "")
+    echo "What file you want to open?"
+    exit 0
+    ;;
+esac
+
+if [ -n $COMPSPEC -a -n $WINDIR ]; then
+  # We under Windows like OS.
+  emacsclientw -a emacs "$1"
+else
+  # We under UNIX like OS.
+  emacsclient -a emacs "$1"
+fi
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emacs/ew.bat	Sat Mar 20 23:36:54 2010 +0200
@@ -0,0 +1,26 @@
+@echo off
+
+REM Written by Oleksandr Gavenko <gavenkoa@gmail.com>, 2009.
+REM File placed by author in public domain.
+
+REM Wait for end of editing file in emacs buffer using emacsclientw.
+REM If emacs not already running, run it.
+REM Put this file in your PATH.
+REM Name `ew' because `edit and wait for C-x #'.
+
+REM If path to file contain spaces it must be inclosed into quotes.
+
+REM Enclose %1 into quotes is danger because if %1 equal to "a b" result
+REM expression ""a b"" has two words, not one enclosed into quotes!
+
+if x%1 == x-h     goto usage
+if x%1 == x-help  goto usage
+if x%1 == x--help goto usage
+
+emacsclientw -a runemacs %1
+goto :eof
+
+:usage
+@echo Alias for emacsclient with waiting for editing ending.
+@echo Usage:
+@echo   e [-h^|--help] ^<edit-files^>
--- a/emacs/unix/e	Sat Mar 20 23:22:18 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-#!/bin/sh
-
-# Written by Oleksandr Gavenko <gavenkoa@gmail.com>, 2008.
-# File placed by author in public domain.
-
-# View file in emacs buffer using emacsclientw.
-# If emacs not already running, run it.
-# Put this file (e.bat) in your PATH.
-# Name `e' because `edit'.
-
-case "$1" in
-  -h|-help|--help)
-    echo "Emacsclient run script."
-    echo "Usage:"
-    echo "  e [-h|--help] <edit-files>"
-    exit 0
-    ;;
-  "")
-    echo "What file you want to open?"
-    exit 0
-    ;;
-esac
-
-emacsclient -a emacs -n "$1"
--- a/emacs/unix/ew	Sat Mar 20 23:22:18 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-#!/bin/sh
-
-# Written by Oleksandr Gavenko <gavenkoa@gmail.com>, 2008.
-# File placed by author in public domain.
-
-# Wait for end of editing file in emacs buffer using emacsclientw.
-# If emacs not already running, run it.
-# Put this file in your PATH.
-# Name `ew' because `edit and wait for C-x #'.
-
-case "$1" in
-  -h|-help|--help)
-    echo "Emacsclient run script."
-    echo "Usage:"
-    echo "  e [-h|--help] <edit-files>"
-    exit 0
-    ;;
-  "")
-    echo "What file you want to open?"
-    exit 0
-    ;;
-esac
-
-emacsclient -a emacs "$1"
--- a/emacs/win/e	Sat Mar 20 23:22:18 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,9 +0,0 @@
-#!/bin/sh
-# -*- coding: cp1251-unix -*-
-
-# Written by Oleksandr Gavenko <gavenkoa@gmail.com>, 2008.
-# File placed by author in public domain.
-
-# Reinvoke windows e.bat.
-
-cmd /c "e.bat \"$1\""
--- a/emacs/win/e.bat	Sat Mar 20 23:22:18 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +0,0 @@
-@echo off
-
-REM Written by Oleksandr Gavenko <gavenkoa@gmail.com>, 2008.
-REM File placed by author in public domain.
-
-REM View file 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'.
-
-REM If path to file contain spaces it must be inclosed into quotes.
-
-REM Enclose %1 into quotes is danger because if %1 equal to "a b" result
-REM expression ""a b"" has two words, not one enclosed into quotes!
-
-if x%1 == x-h     goto usage
-if x%1 == x-help  goto usage
-if x%1 == x--help goto usage
-
-emacsclientw -a runemacs -n %1
-goto :eof
-
-:usage
-@echo Alias for emacsclient without waiting for editing ending.
-@echo Usage:
-@echo   e [-h^|--help] ^<edit-files^>
--- a/emacs/win/ew.bat	Sat Mar 20 23:22:18 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +0,0 @@
-@echo off
-
-REM Written by Oleksandr Gavenko <gavenkoa@gmail.com>, 2009.
-REM File placed by author in public domain.
-
-REM Wait for end of editing file in emacs buffer using emacsclientw.
-REM If emacs not already running, run it.
-REM Put this file in your PATH.
-REM Name `ew' because `edit and wait for C-x #'.
-
-REM If path to file contain spaces it must be inclosed into quotes.
-
-REM Enclose %1 into quotes is danger because if %1 equal to "a b" result
-REM expression ""a b"" has two words, not one enclosed into quotes!
-
-if x%1 == x-h     goto usage
-if x%1 == x-help  goto usage
-if x%1 == x--help goto usage
-
-emacsclientw -a runemacs %1
-goto :eof
-
-:usage
-@echo Alias for emacsclient with waiting for editing ending.
-@echo Usage:
-@echo   e [-h^|--help] ^<edit-files^>
--- a/emacs/win/r.bat	Sat Mar 20 23:22:18 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-@echo off
-
-REM Written by Oleksandr Gavenko <gavenkoa@gmail.com>, 2008.
-REM File placed by author in public domain.
-
-REM View file read only in emacs buffer using emacsclientw.
-REM Put this file (r.bat) in your PATH.
-REM Name `r' becouse `read'.
-
-REM If path to file contain spaces it must be inclosed into quotes.
-
-REM Enclose %1 into quotes is danger because if %1 equal to "a b" result
-REM expression ""a b"" has two words, not one enclosed into quotes!
-
-if x%1 == x-h     goto usage
-if x%1 == x-help  goto usage
-if x%1 == x--help goto usage
-
-setlocal
-set file=%*
-set file=%file:\=/%
-set currdir=%CD:\=/%
-
-emacsclientw -a runemacs -e "(setq default-directory \"%currdir%\")"
-emacsclientw -n -e "(find-file-read-only \""%file%"\")"
-goto :eof
-
-:usage
-@echo Alias for emacsclient without waiting for editing ending.
-@echo File opens read only.
-@echo Usage:
-@echo   r [-h^|--help] ^<edit-files^>