[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
emacs-27 de41161: Tab-bar related fixes.
From: |
Juri Linkov |
Subject: |
emacs-27 de41161: Tab-bar related fixes. |
Date: |
Wed, 29 Jan 2020 18:22:26 -0500 (EST) |
branch: emacs-27
commit de411615344d1551d685e45b0739e1f738cf4afd
Author: Juri Linkov <address@hidden>
Commit: Juri Linkov <address@hidden>
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.
---
lisp/cus-start.el | 2 +-
lisp/desktop.el | 7 ++++++-
lisp/tab-bar.el | 12 ++++++++----
3 files changed, 15 insertions(+), 6 deletions(-)
diff --git a/lisp/cus-start.el b/lisp/cus-start.el
index e3dc6f0..dff4d9a 100644
--- a/lisp/cus-start.el
+++ b/lisp/cus-start.el
@@ -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
diff --git a/lisp/desktop.el b/lisp/desktop.el
index bfab50d..7745b50 100644
--- a/lisp/desktop.el
+++ b/lisp/desktop.el
@@ -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.
diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el
index eccab26..ebb0c56 100644
--- a/lisp/tab-bar.el
+++ b/lisp/tab-bar.el
@@ -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))))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- emacs-27 de41161: Tab-bar related fixes.,
Juri Linkov <=