Skip to content
This repository
Browse code

-L option for 'emacsb compile'

  • Loading branch information...
commit de78f2e72f00d86f4266b83d966f6e67aebf660e 1 parent 3c2d3a2
INA Lintaro authored May 11, 2012

Showing 1 changed file with 9 additions and 5 deletions. Show diff stats Hide diff stats

  1. 14  .zsh/emacs.zsh
14  .zsh/emacs.zsh
@@ -12,26 +12,30 @@ function emacs-standalone () {
12 12
 
13 13
 function emacsb () {
14 14
     [[ -z "$1" ]] &&
15  
-    echo "Usage: $0 [compile FILE | install URL | update]..." && return
  15
+    echo "Usage: $0 [-L dir]... [compile FILE | install URL | update]..." && return
16 16
     local cmd; cmd=(emacs-standalone --batch)
  17
+    local -a libs; libs=()
17 18
     local install; install=($cmd -l ~/.emacs.d/dot/install.el)
18 19
     local action; action=$1; shift
  20
+    while [[ "$1" == "-L" ]]; do
  21
+        libs=($libs $1 "$2"); shift; shift
  22
+    done
19 23
     case "$action" in
20 24
         compile)
21  
-            $cmd -f batch-byte-compile $@
  25
+            $cmd -L . $libs -f batch-byte-compile "$@"
22 26
             ;;
23 27
         install)
24 28
             local url; url=$1; shift
25  
-            $install --eval "(install-elisp \"$url\")" $@
  29
+            $install --eval "(install-elisp \"$url\")" "$@"
26 30
             ;;
27 31
         update)
28  
-            $install -f update-remote-emacs-lisp $@
  32
+            $install -f update-remote-emacs-lisp "$@"
29 33
             ;;
30 34
         help)
31 35
             $0
32 36
             ;;
33 37
         *)
34  
-            $cmd $@
  38
+            $cmd "$@"
35 39
             ;;
36 40
     esac
37 41
 }

0 notes on commit de78f2e

Please sign in to comment.
Something went wrong with that request. Please try again.