diff options
author | Kyle Meyer <kyle@kyleam.com> | 2015-11-24 22:05:11 -0500 |
---|---|---|
committer | Kyle Meyer <kyle@kyleam.com> | 2015-11-24 22:05:11 -0500 |
commit | b8eb24e28283f17ae182ac7dc085d79d2d6a00db (patch) | |
tree | 9ab9321ef5a19986b72688debf5023833f4ff6f6 | |
parent | 1ba192ea6e5d97b8e4450d1400a83c4ad1e41c1a (diff) | |
download | emacs.d-b8eb24e28283f17ae182ac7dc085d79d2d6a00db.tar.gz |
zsh-ansi-term--args: Auto-complete 1-directory case
-rw-r--r-- | lisp/init-external.el | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lisp/init-external.el b/lisp/init-external.el index 829c5dd..65a6681 100644 --- a/lisp/init-external.el +++ b/lisp/init-external.el @@ -80,9 +80,12 @@ DIRECTORY." ((= (prefix-numeric-value current-prefix-arg) 4) "~/") ((= (prefix-numeric-value current-prefix-arg) 0) - (--if-let (km/zsh-ansi-term-current-directories) - (completing-read "Directory: " it nil nil nil nil (car it)) - (user-error "No ZSH buffers found"))) + (let ((dirs (km/zsh-ansi-term-current-directories))) + (cl-case (length dirs) + (0 (user-error "No ZSH buffers found")) + (1 (car dirs)) + (t (completing-read "Directory: " dirs + nil nil nil nil (car dirs)))))) (t (read-directory-name "Directory: "))))) |