Commit de411615 authored by Juri Linkov's avatar Juri Linkov

Tab-bar related fixes.

* lisp/cus-start.el (tab-bar-mode): Use dedicated group 'tab-bar'.

* lisp/tab-bar.el (tab-bar-history-mode): Add :group 'tab-bar'.
(tab-bar-get-buffer-tab): Add optional arg 'ignore-current-tab'.

* lisp/desktop.el (desktop-buffers-not-to-save-function): Add docstring.
parent 247f2cfa
Pipeline #4716 passed with stage
in 56 minutes and 40 seconds
......@@ -324,7 +324,7 @@ Leaving \"Default\" unchecked is equivalent with specifying a default of
;; FIXME?
;; :initialize custom-initialize-default
:set custom-set-minor-mode)
(tab-bar-mode (frames mouse) boolean nil
(tab-bar-mode tab-bar boolean nil
;; :initialize custom-initialize-default
:set custom-set-minor-mode)
(tool-bar-mode (frames mouse) boolean nil
......
......@@ -946,7 +946,12 @@ which means to truncate VAR's value to at most MAX-SIZE elements
")\n"))))
;; ----------------------------------------------------------------------------
(defvar desktop-buffers-not-to-save-function nil)
(defvar desktop-buffers-not-to-save-function nil
"Function identifying buffers that are to be excluded from saving.
Like `desktop-buffers-not-to-save' it can be used to check whether
a given buffer should not be saved. It takes the same arguments as
`desktop-save-buffer-p' and should return nil if buffer should not
have its state saved in the desktop file.")
(defun desktop-save-buffer-p (filename bufname mode &rest rest)
"Return t if buffer should have its state saved in the desktop file.
......
......@@ -1123,7 +1123,7 @@ function `tab-bar-tab-name-function'."
(define-minor-mode tab-bar-history-mode
"Toggle tab history mode for the tab bar."
:global t
:global t :group 'tab-bar
(if tab-bar-history-mode
(progn
(when (and tab-bar-mode (not (get-text-property 0 'display tab-bar-back-button)))
......@@ -1400,7 +1400,7 @@ in the selected frame."
((framep all-frames) (list all-frames))
(t (list (selected-frame)))))
(defun tab-bar-get-buffer-tab (buffer-or-name &optional all-frames)
(defun tab-bar-get-buffer-tab (buffer-or-name &optional all-frames ignore-current-tab)
"Return a tab owning a window whose buffer is BUFFER-OR-NAME.
BUFFER-OR-NAME may be a buffer or a buffer name and defaults to
the current buffer.
......@@ -1414,7 +1414,10 @@ The optional argument ALL-FRAMES specifies the frames to consider:
- A frame means consider all tabs on that frame only.
Any other value of ALL-FRAMES means consider all tabs on the
selected frame and no others."
selected frame and no others.
When the optional argument IGNORE-CURRENT-TAB is non-nil,
don't take into account the buffers in the currently selected tab."
(let ((buffer (if buffer-or-name
(get-buffer buffer-or-name)
(current-buffer))))
......@@ -1424,7 +1427,8 @@ selected frame and no others."
(seq-some
(lambda (tab)
(when (if (eq (car tab) 'current-tab)
(get-buffer-window buffer frame)
(unless ignore-current-tab
(get-buffer-window buffer frame))
(let* ((state (alist-get 'ws tab))
(buffers (when state
(window-state-buffers state))))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment