summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.emacs.d/init-spw.el17
1 files changed, 8 insertions, 9 deletions
diff --git a/.emacs.d/init-spw.el b/.emacs.d/init-spw.el
index 81f05e14..7900a6ad 100644
--- a/.emacs.d/init-spw.el
+++ b/.emacs.d/init-spw.el
@@ -741,15 +741,14 @@ add places the library might be available to `load-path'."
(let (recent-tab-old-time)
(defun spw/tab-bar-switch-to-recent-tab ()
(interactive)
- ;; If the most recent tab is not the one we end up at after exiting the
- ;; transient map, we will want to set that tab's time back to what it was
- ;; before we changed tabs, as if we had never selected it. So record that
- ;; info so we can do that.
- (setq recent-tab-old-time
- (apply #'min
- (mapcar (lambda (tab) (alist-get 'time tab))
- (spw/tabs-without-current))))
- (call-interactively #'tab-bar-switch-to-recent-tab))
+ (when-let ((tabs (spw/tabs-without-current)))
+ ;; If the most recent tab is not the one we end up at after exiting the
+ ;; transient map, we will want to set that tab's time back to what it
+ ;; was before we changed tabs, as if we had never selected it. So
+ ;; record that info so we can do that.
+ (setq recent-tab-old-time
+ (apply #'min (mapcar (lambda (tab) (alist-get 'time tab)) tabs)))
+ (call-interactively #'tab-bar-switch-to-recent-tab)))
(spw/bind-command-with-cycling
([remap tab-next] . spw/tab-bar-switch-to-recent-tab)
(lambda (count)