From b8eb24e28283f17ae182ac7dc085d79d2d6a00db Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Tue, 24 Nov 2015 22:05:11 -0500 Subject: zsh-ansi-term--args: Auto-complete 1-directory case --- lisp/init-external.el | 9 ++++++--- 1 file 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: "))))) -- cgit v1.2.3