[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re:Re: [patch] two patchs about tab-bar.el
From: |
tumashu |
Subject: |
Re:Re: [patch] two patchs about tab-bar.el |
Date: |
Fri, 10 Sep 2021 21:18:51 +0800 (CST) |
At 2021-09-10 14:33:48, "Juri Linkov" <juri@linkov.net> wrote:
>> * lisp/tab-bar.el (tab-bar-get-buffer-tab): Fix issue when
>> 'current-tab is not at the beginning of tabs.
>>
>> --- a/lisp/tab-bar.el
>> +++ b/lisp/tab-bar.el
>> @@ -1940,7 +1940,9 @@ tab-bar-get-buffer-tab
>> - (funcall tab-bar-tabs-function frame)))
>> + (let ((tabs (funcall tab-bar-tabs-function frame)))
>> + ;; Make sure current-tab is alway at the beginning of tabs.
>> + (push (assq 'current-tab tabs) tabs))))
>
>Please explain what problem this patch is intended to fix.
I have two tabs:
1. *scratch* 2. *scratch*, *Messages*
and current-tab is 2
if I switch-to-buffer *scratch*, it will jump to tab 1, instead of to jump to
window '*scratch*' in current tab.
for the current-tab is not at the begin of tabs.
(cl-prettyprint (tab-bar-tabs))
((tab (name . "*scratch*")
(explicit-name)
(time . 1631279460.570877)
(ws ((min-height . 4)
(min-width . 10)
(min-height-ignore . 3)
(min-width-ignore . 4)
(min-height-safe . 1)
(min-width-safe . 2)
(min-pixel-height . 92)
(min-pixel-width . 100)
(min-pixel-height-ignore . 69)
(min-pixel-width-ignore . 40)
(min-pixel-height-safe . 23)
(min-pixel-width-safe . 20))
leaf
(pixel-width . 1366)
(pixel-height . 663)
(total-width . 137)
(total-height . 28)
(normal-height . 1.0)
(normal-width . 1.0)
(buffer "*scratch*"
(selected . t)
(hscroll . 0)
(fringes 8 8 nil nil)
(margins nil)
(scroll-bars nil 0 t nil 0 t nil)
(vscroll . 0)
(dedicated)
(point . 1)
(start . 1)))
(wc . #<window-configuration>)
(wc-point . #<marker at 1 in *scratch*>)
(wc-bl #<buffer *scratch*> #<buffer *Minibuf-1*>)
(wc-bbl)
(wc-history-back ((wc . #<window-configuration>)
(wc-point . #<marker at 1 in *scratch*>))
((wc . #<window-configuration>)
(wc-point . #<marker at 1 in *scratch*>)))
(wc-history-forward))
(current-tab (name . "*scratch*, *Messages*") (explicit-name)))
>
>> --- a/lisp/tab-bar.el
>> +++ b/lisp/tab-bar.el
>> @@ -1962,11 +1962,12 @@ display-buffer-in-tab
>>
>> If ALIST contains a `reusable-frames' entry, its value determines
>> which frames to search for a reusable tab:
>> - nil -- the selected frame (actually the last non-minibuffer frame)
>> + nil -- do not reuse any frames.
>> A frame -- just that frame
>> `visible' -- all visible frames
>> 0 -- all frames on the current terminal
>> t -- all frames.
>> + others -- selected frame.
>
>I wonder where did you get the value 'others' that means the selected frame?
(defun tab-bar--reusable-frames (all-frames)
(cond
((eq all-frames t) (frame-list))
((eq all-frames 'visible) (visible-frame-list))
((framep all-frames) (list all-frames))
(t (list (selected-frame)))))
^^^^^^^^^^^^^^
Re: [patch] two patchs about tab-bar.el, Feng Shu, 2021/09/10