[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master e12ff84 125/272: counsel.el (counsel-list-processes-action

From: Oleh Krehel
Subject: [elpa] master e12ff84 125/272: counsel.el (counsel-list-processes-action-switch): Improve
Date: Mon, 25 Apr 2016 10:13:21 +0000

branch: master
commit e12ff84a09a0e796c171cbed036cb9a008f1241d
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>

    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))))
 (defun counsel-list-processes ()

reply via email to

[Prev in Thread] Current Thread [Next in Thread]