dired: M-> and M-< now go to the first/last file
[emacs.git] / bin / byte-compile
index f9422b2..d03ac24 100755 (executable)
@@ -5,13 +5,16 @@ set -u
 set -E
 
 EC=emacsclient
+INPUT=${1:-"${HOME}/.emacs.d/elisp/local"}
 
-DIR=${1:-"${HOME}/elisp/local"}
-cd ${DIR}
-
-find -type f -name "*.elc" -delete
-
-for file in $(find -type f -name "*.el"); do
-    echo -n "${file} ... "
-    ${EC} --eval "(byte-compile-file \"${file}\")"
-done
+if [[ -f "${INPUT}" ]]; then
+    rm -f "${INPUT}c"
+    ${EC} --eval "(byte-compile-file \"${INPUT}\")"
+else
+    cd ${INPUT}
+    find -type f -name "*.elc" -delete
+    for file in $(find -type f -name "*.el"); do
+        echo -n "${file} ... "
+        ${EC} --eval "(byte-compile-file \"${file}\")"
+    done
+fi