From dc3a960e9bba5722a5d5dd3fa4bdf26846cc89b9 Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Sat, 25 Jun 2016 02:01:18 -0400 Subject: zsh-ansi-term: Don't assume ansi-term returns the buffer ... because it no longer does. --- lisp/km-shell.el | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/lisp/km-shell.el b/lisp/km-shell.el index fe9d25d..9b656a8 100644 --- a/lisp/km-shell.el +++ b/lisp/km-shell.el @@ -58,14 +58,12 @@ DIRECTORY." (name (or name (concat "zsh: " dir))) (full-name (concat "*" name "*")) (default-directory dir)) - (pop-to-buffer-same-window - (cond - ((and (not (string= (km/zsh-ansi-term-directory) dir)) - (get-buffer full-name))) - (t - (cl-letf (((symbol-function 'switch-to-buffer) - (lambda (b &rest _) (get-buffer b)))) - (ansi-term "zsh" name))))) + (unless (and (not (string= (km/zsh-ansi-term-directory) dir)) + (get-buffer full-name)) + (cl-letf (((symbol-function 'switch-to-buffer) + (lambda (&rest _) nil))) + (ansi-term "zsh" name))) + (pop-to-buffer-same-window full-name) (comint-goto-process-mark))) ;;;###autoload -- cgit v1.2.3