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

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

[elpa] externals/consult 16ec34dd12: Simplify consult--buffer-preview


From: ELPA Syncer
Subject: [elpa] externals/consult 16ec34dd12: Simplify consult--buffer-preview
Date: Thu, 30 Mar 2023 07:57:52 -0400 (EDT)

branch: externals/consult
commit 16ec34dd12a734b231bcc0fa03a1ab40a86def93
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>

    Simplify consult--buffer-preview
---
 consult.el | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/consult.el b/consult.el
index 0f498aadc1..48a6ed9e7a 100644
--- a/consult.el
+++ b/consult.el
@@ -4407,17 +4407,14 @@ AS is a conversion function."
                     (not other-win))
            (switch-to-buffer-other-window orig-buf)
            (setq other-win (selected-window)))
-         (let ((win (or other-win (selected-window))))
-           (when (window-live-p win)
+         (let ((win (or other-win (selected-window)))
+               (buf (or (and cand (get-buffer cand)) orig-buf)))
+           (when (and (window-live-p win) (buffer-live-p buf))
              (with-selected-window win
                (unless (or orig-prev orig-next)
                  (setq orig-prev (copy-sequence (window-prev-buffers))
                        orig-next (copy-sequence (window-next-buffers))))
-               (cond
-                ((and cand (get-buffer cand))
-                 (switch-to-buffer cand 'norecord))
-                ((buffer-live-p orig-buf)
-                 (switch-to-buffer orig-buf 'norecord)))))))))))
+               (switch-to-buffer buf 'norecord)))))))))
 
 (defun consult--buffer-action (buffer &optional norecord)
   "Switch to BUFFER via `consult--buffer-display' function.



reply via email to

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