branch: elpa/helm
commit 08f5a7267fd3a8f8c97bbf8792905acb999d9400
Author: Thierry Volpiatto <thie...@posteo.net>
Commit: Thierry Volpiatto <thie...@posteo.net>

    Add comments only
---
 helm-buffers.el | 13 +++++++++++++
 helm-utils.el   |  6 +++++-
 2 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/helm-buffers.el b/helm-buffers.el
index adb3ff26c8..8193fea829 100644
--- a/helm-buffers.el
+++ b/helm-buffers.el
@@ -131,6 +131,19 @@ Do not use `setq' to set this variable.
 This variable takes effect only when `tab-bar-mode' is available 
(emacs-27.1+)."
   :type 'boolean
   :set (lambda (var val)
+         ;; We should be able to retrieve all buffers assigned to a tab 
whatever
+         ;; the value used for `tab-bar-tab-name-function', unfortunately this
+         ;; is not the case, it seems the alist contains the buffer names only
+         ;; when `tab-bar-tab-name-all' is used and set globally. Then when the
+         ;; mode-line/header-line is rebuilded some code (probably C code in
+         ;; `force-mode-line-update' or elsewhare) changes the alist so just
+         ;; let-binding `tab-bar-tab-name-function' is not enough. This is
+         ;; reproductible when we have more than one window visible and we turn
+         ;; on `tab-bar-mode', the alist is showing only the first buffer of
+         ;; window-list omitting the others, however when starting with only 
one
+         ;; window, calling `tab-bar-mode' and splitting window afterward the
+         ;; alist is updated. Looks it is a bug or a limitation of
+         ;; `tab-bar-mode'.
          (set var val)
          (if val
              (customize-set-variable
diff --git a/helm-utils.el b/helm-utils.el
index f77f0d6663..93ba9e77cf 100644
--- a/helm-utils.el
+++ b/helm-utils.el
@@ -322,7 +322,11 @@ If a prefix arg is given split windows vertically."
   (if (and (fboundp 'tab-bar-mode)
            helm-buffers-maybe-switch-to-tab
            tab-bar-mode)
-      (let* ((tab-bar-tab-name-function #'tab-bar-tab-name-all)
+      (let* (;; Normally `helm-buffers-maybe-switch-to-tab' custom set function
+             ;; bounded `tab-bar-tab-name-function' to `tab-bar-tab-name-all'
+             ;; but in case user bounded this with setq ensure it works
+             ;; at least partially by let-bounding it here.
+             (tab-bar-tab-name-function #'tab-bar-tab-name-all)
              (tabs (tab-bar-tabs))
              (tab-names (mapcar (lambda (tab)
                                   (cdr (assq 'name tab)))

Reply via email to