7066bf7c6b522af9147ebf03c00361c4c6490d42

Author
Tristan Carel <tcarel@exalead.com>
Committer
Tristan Carel <tcarel@exalead.com>
Date

Message

Fix builtin `ecd' when file path contains space characters.

Diff

 1diff --git a/plugins/emacs/emacs.plugin.zsh b/plugins/emacs/emacs.plugin.zsh
 2index 737abe9d6f438c2f5996c4e16594e7d91f5754c5..e22f10740609382779da8060b9ebcd150d41a35f 100644
 3--- a/plugins/emacs/emacs.plugin.zsh
 4+++ b/plugins/emacs/emacs.plugin.zsh
 5@@ -31,13 +31,13 @@ if "$ZSH/tools/require_tool.sh" emacs 23 2>/dev/null ; then
 6         $EDITOR --eval "$cmd" | tr -d \"
 7     }
 8 
 9-    # display the directory of the file
10+    # Write to standard output the directory of the file
11     # opened in the the current buffer
12     function ecd {
13         local cmd="(let ((buf-name (buffer-file-name (window-buffer))))
14                      (if buf-name (file-name-directory buf-name)))"
15 
16-        local dir=`$EDITOR --eval "$cmd" | tr -d \"`
17+        local dir="$($EDITOR --eval $cmd | tr -d \")"
18         if [ -n "$dir" ] ;then
19             echo "$dir"
20         else