aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuri Linkov2020-01-30 01:22:19 +0200
committerJuri Linkov2020-01-30 01:22:19 +0200
commitde411615344d1551d685e45b0739e1f738cf4afd (patch)
treebc61466b8d578f7a09dcf1ead44d60878940a0b0
parent247f2cfa021f26fc9b36798664545027051260e9 (diff)
downloademacs-de411615344d1551d685e45b0739e1f738cf4afd.tar.gz
emacs-de411615344d1551d685e45b0739e1f738cf4afd.zip
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.
-rw-r--r--lisp/cus-start.el2
-rw-r--r--lisp/desktop.el7
-rw-r--r--lisp/tab-bar.el12
3 files changed, 15 insertions, 6 deletions
diff --git a/lisp/cus-start.el b/lisp/cus-start.el
index e3dc6f03c4b..dff4d9a6060 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
324 ;; FIXME? 324 ;; FIXME?
325 ;; :initialize custom-initialize-default 325 ;; :initialize custom-initialize-default
326 :set custom-set-minor-mode) 326 :set custom-set-minor-mode)
327 (tab-bar-mode (frames mouse) boolean nil 327 (tab-bar-mode tab-bar boolean nil
328 ;; :initialize custom-initialize-default 328 ;; :initialize custom-initialize-default
329 :set custom-set-minor-mode) 329 :set custom-set-minor-mode)
330 (tool-bar-mode (frames mouse) boolean nil 330 (tool-bar-mode (frames mouse) boolean nil
diff --git a/lisp/desktop.el b/lisp/desktop.el
index bfab50da463..7745b50b64c 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
946 ")\n")))) 946 ")\n"))))
947 947
948;; ---------------------------------------------------------------------------- 948;; ----------------------------------------------------------------------------
949(defvar desktop-buffers-not-to-save-function nil) 949(defvar desktop-buffers-not-to-save-function nil
950 "Function identifying buffers that are to be excluded from saving.
951Like `desktop-buffers-not-to-save' it can be used to check whether
952a given buffer should not be saved. It takes the same arguments as
953`desktop-save-buffer-p' and should return nil if buffer should not
954have its state saved in the desktop file.")
950 955
951(defun desktop-save-buffer-p (filename bufname mode &rest rest) 956(defun desktop-save-buffer-p (filename bufname mode &rest rest)
952 "Return t if buffer should have its state saved in the desktop file. 957 "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 eccab268dc9..ebb0c566ad1 100644
--- a/lisp/tab-bar.el
+++ b/lisp/tab-bar.el
@@ -1123,7 +1123,7 @@ function `tab-bar-tab-name-function'."
1123 1123
1124(define-minor-mode tab-bar-history-mode 1124(define-minor-mode tab-bar-history-mode
1125 "Toggle tab history mode for the tab bar." 1125 "Toggle tab history mode for the tab bar."
1126 :global t 1126 :global t :group 'tab-bar
1127 (if tab-bar-history-mode 1127 (if tab-bar-history-mode
1128 (progn 1128 (progn
1129 (when (and tab-bar-mode (not (get-text-property 0 'display tab-bar-back-button))) 1129 (when (and tab-bar-mode (not (get-text-property 0 'display tab-bar-back-button)))
@@ -1400,7 +1400,7 @@ in the selected frame."
1400 ((framep all-frames) (list all-frames)) 1400 ((framep all-frames) (list all-frames))
1401 (t (list (selected-frame))))) 1401 (t (list (selected-frame)))))
1402 1402
1403(defun tab-bar-get-buffer-tab (buffer-or-name &optional all-frames) 1403(defun tab-bar-get-buffer-tab (buffer-or-name &optional all-frames ignore-current-tab)
1404 "Return a tab owning a window whose buffer is BUFFER-OR-NAME. 1404 "Return a tab owning a window whose buffer is BUFFER-OR-NAME.
1405BUFFER-OR-NAME may be a buffer or a buffer name and defaults to 1405BUFFER-OR-NAME may be a buffer or a buffer name and defaults to
1406the current buffer. 1406the current buffer.
@@ -1414,7 +1414,10 @@ The optional argument ALL-FRAMES specifies the frames to consider:
1414- A frame means consider all tabs on that frame only. 1414- A frame means consider all tabs on that frame only.
1415 1415
1416Any other value of ALL-FRAMES means consider all tabs on the 1416Any other value of ALL-FRAMES means consider all tabs on the
1417selected frame and no others." 1417selected frame and no others.
1418
1419When the optional argument IGNORE-CURRENT-TAB is non-nil,
1420don't take into account the buffers in the currently selected tab."
1418 (let ((buffer (if buffer-or-name 1421 (let ((buffer (if buffer-or-name
1419 (get-buffer buffer-or-name) 1422 (get-buffer buffer-or-name)
1420 (current-buffer)))) 1423 (current-buffer))))
@@ -1424,7 +1427,8 @@ selected frame and no others."
1424 (seq-some 1427 (seq-some
1425 (lambda (tab) 1428 (lambda (tab)
1426 (when (if (eq (car tab) 'current-tab) 1429 (when (if (eq (car tab) 'current-tab)
1427 (get-buffer-window buffer frame) 1430 (unless ignore-current-tab
1431 (get-buffer-window buffer frame))
1428 (let* ((state (alist-get 'ws tab)) 1432 (let* ((state (alist-get 'ws tab))
1429 (buffers (when state 1433 (buffers (when state
1430 (window-state-buffers state)))) 1434 (window-state-buffers state))))