branch: master commit e12ff84a09a0e796c171cbed036cb9a008f1241d Author: Oleh Krehel <ohwoeo...@gmail.com> Commit: Oleh Krehel <ohwoeo...@gmail.com>
counsel.el (counsel-list-processes-action-switch): Improve Fixes #398 --- counsel.el | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/counsel.el b/counsel.el index 258ecbf..083413a 100644 --- a/counsel.el +++ b/counsel.el @@ -1559,9 +1559,11 @@ PREFIX is used to create the key." (delete x ivy--all-candidates)))) (defun counsel-list-processes-action-switch (x) - (if (get-buffer x) - (switch-to-buffer x) - (message "Process %s doesn't have a buffer" x))) + (let* ((proc (get-process x)) + (buf (and proc (process-buffer proc)))) + (if buf + (switch-to-buffer x) + (message "Process %s doesn't have a buffer" x)))) ;;;###autoload (defun counsel-list-processes ()