feat(emacs): Initial buffer for new tabs

This commit is contained in:
Madeleine Sydney
2025-02-17 02:51:21 -07:00
parent 0c2e7d7d6d
commit 90d2e9584e

View File

@@ -25,6 +25,8 @@
(defvar syd-tab-bar-name-function #'syd-tab-bar-make-free-name (defvar syd-tab-bar-name-function #'syd-tab-bar-make-free-name
"Nullary function expected to return the name for a new tab.") "Nullary function expected to return the name for a new tab.")
(defvar syd-tab-bar-default-buffer-function #'scratch-buffer)
(syd-add-hook 'tab-bar-tab-post-open-functions (syd-add-hook 'tab-bar-tab-post-open-functions
(defun syd-tab-bar--name-new-tab-h (tab) (defun syd-tab-bar--name-new-tab-h (tab)
"Hooks to `tab-bar-tab-post-open-functions' such that new tabs will be "Hooks to `tab-bar-tab-post-open-functions' such that new tabs will be
@@ -34,7 +36,9 @@ given \"explicit names\" that are static."
"Show the tab-bar if it is not already visible. See "Show the tab-bar if it is not already visible. See
`syd-tab-bar-hide-tab-bar-h'." `syd-tab-bar-hide-tab-bar-h'."
(unless vim-tab-bar-mode (unless vim-tab-bar-mode
(vim-tab-bar-mode 1)))) (vim-tab-bar-mode 1)))
(defun syd-tab-bar--switch-to-default-buffer-h (_tab)
(switch-to-buffer (funcall syd-tab-bar-default-buffer-function))))
(syd-add-hook 'tab-bar-tab-pre-close-functions (syd-add-hook 'tab-bar-tab-pre-close-functions
(defun syd-tab-bar-hide-tab-bar-h (_tab _final-tab-p) (defun syd-tab-bar-hide-tab-bar-h (_tab _final-tab-p)