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

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

[elpa] externals/bufferlo e40613cbbc 22/37: Fix buffer selection in empt


From: ELPA Syncer
Subject: [elpa] externals/bufferlo e40613cbbc 22/37: Fix buffer selection in empty tabs
Date: Sun, 5 Nov 2023 09:57:33 -0500 (EST)

branch: externals/bufferlo
commit e40613cbbc941d5b29876046f7661ca0e62c48a6
Author: Florian Rommel <mail@florommel.de>
Commit: Florian Rommel <mail@florommel.de>

    Fix buffer selection in empty tabs
---
 bufferlo.el | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/bufferlo.el b/bufferlo.el
index 3494cbcea1..9d44c9f8e5 100644
--- a/bufferlo.el
+++ b/bufferlo.el
@@ -190,8 +190,21 @@ after `tab-bar--tab' but only when it is called from 
`tab-bar-select-tab'."
 
 (defun bufferlo--clear-buffer-lists-activate (oldfn &rest args)
   "See `bufferlo--clear-buffer-lists'."
-  (let ((bufferlo--clear-buffer-lists-active t))
-    (apply oldfn args)))
+  (let* ((bufferlo--clear-buffer-lists-active t)
+         (result (apply oldfn args)))
+
+    ;; FIXME: Occasionally it happens that a non-local buffer is shown in the 
tab,
+    ;; after switching frames, primarily with empty tabs.
+    ;; This workaround selects a buffer that is in the local list in such a 
case.
+    (unless (bufferlo-local-buffer-p (current-buffer) nil nil t)
+      (let ((buffer (or
+                     (cl-find-if-not #'minibufferp
+                                     (frame-parameter nil 'buffer-list))
+                     (cl-find-if-not #'minibufferp
+                                     (frame-parameter nil 
'buried-buffer-list)))))
+        (switch-to-buffer buffer t t)))
+
+    result))
 
 (defun bufferlo--buffer-predicate (buffer)
   (bufferlo-local-buffer-p buffer nil nil t))



reply via email to

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