diff options
-rw-r--r-- | .emacs.d/init-spw.el | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/.emacs.d/init-spw.el b/.emacs.d/init-spw.el index 86c16a2d..df659d7e 100644 --- a/.emacs.d/init-spw.el +++ b/.emacs.d/init-spw.el @@ -724,6 +724,10 @@ add places the library might be available to `load-path'." tab-bar-new-button-show nil tab-bar-close-button-show nil) ;; this makes C-x t o like my (customised) C-x o +(defun spw/tabs-without-current () + (cl-remove-if (lambda (tab) + (eq (car tab) 'current-tab)) + (funcall tab-bar-tabs-function))) (let (recent-tab-old-time) (defun spw/tab-bar-switch-to-recent-tab () (interactive) @@ -734,9 +738,7 @@ add places the library might be available to `load-path'." (setq recent-tab-old-time (apply #'min (mapcar (lambda (tab) (alist-get 'time tab)) - (cl-remove-if (lambda (tab) - (eq (car tab) 'current-tab)) - (funcall tab-bar-tabs-function))))) + (spw/tabs-without-current)))) (call-interactively #'tab-bar-switch-to-recent-tab)) (spw/bind-command-with-cycling ([remap tab-next] . spw/tab-bar-switch-to-recent-tab) @@ -753,12 +755,10 @@ add places the library might be available to `load-path'." (length tabs)))) (alist-get 'time (nth new-index tabs))))) (tab-bar-switch-to-next-tab count) - (setf (alist-get - 'time - (car (seq-sort-by (lambda (tab) (alist-get 'time tab)) #'> - (seq-remove (lambda (tab) - (eq (car tab) 'current-tab)) - (funcall tab-bar-tabs-function))))) + (setf (alist-get 'time (car (seq-sort-by (lambda (tab) + (alist-get 'time tab)) + #'> + (spw/tabs-without-current)))) recent-tab-old-time) (setq recent-tab-old-time next-tab-old-time))))) |