;; 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
")\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.
(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)))
((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.
- 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))))
(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))))