emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] master 9988904 150/399: counsel.el (counsel--switch-buffer-update


From: Oleh Krehel
Subject: [elpa] master 9988904 150/399: counsel.el (counsel--switch-buffer-update-fn): Fix for when find-file fails
Date: Sat, 20 Jul 2019 14:57:13 -0400 (EDT)

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

    counsel.el (counsel--switch-buffer-update-fn): Fix for when find-file fails
    
    Fixes #2009
---
 counsel.el | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/counsel.el b/counsel.el
index 2b64032..7f16098 100644
--- a/counsel.el
+++ b/counsel.el
@@ -5078,9 +5078,16 @@ The buffers are those opened during a session of 
`counsel-switch-buffer'."
       ((get-buffer current)
        (ivy-call))
       ((and virtual (file-exists-p (cdr virtual)))
-       (let ((buf (find-file-noselect (cdr virtual))))
-         (push buf counsel--switch-buffer-temporary-buffers)
-         (ivy-call)))
+       (let ((buf (ignore-errors
+                    ;; may not open due to `large-file-warning-threshold' etc.
+                    (find-file-noselect (cdr virtual)))))
+         (if buf
+             (progn
+               (push buf counsel--switch-buffer-temporary-buffers)
+               (ivy-call))
+           ;; clean up the minibuffer so that there's no delay before
+           ;; the Ivy candidates are displayed once again
+           (message ""))))
       (t
        (with-ivy-window
          (switch-to-buffer (ivy-state-buffer ivy-last)))))))



reply via email to

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