From b1336e18ce0d5b6d135c8393b7e439413ddd4353 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sun, 26 Sep 2021 12:07:35 +0200 Subject: [PATCH] fix(tabs): error while centaur-tabs-mode is off The hooks on `+doom-dashboard-mode-hook` and `+popup-buffer-mode-hook` will throw an error if centaur-tabs-mode is disabled, which may be the case if the user disables it interactively, post-startup. Fix #5196 --- modules/ui/tabs/config.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/ui/tabs/config.el b/modules/ui/tabs/config.el index 180e36baf..fba46edd1 100644 --- a/modules/ui/tabs/config.el +++ b/modules/ui/tabs/config.el @@ -15,8 +15,11 @@ centaur-tabs-cycle-scope 'tabs) :config - (add-hook '+doom-dashboard-mode-hook #'centaur-tabs-local-mode) - (add-hook '+popup-buffer-mode-hook #'centaur-tabs-local-mode)) + (add-hook! '(+doom-dashboard-mode-hook +popup-buffer-mode-hook) + (defun +tabs-disable-centaur-tabs-mode-maybe-h () + "Disable `centaur-tabs-mode' in current buffer." + (when (centaur-tabs-mode-on-p) + (centaur-tabs-local-mode))))) ;; TODO tab-bar-mode (emacs 27)