reddit / emacs

Tab Bar Mode naming function

SheetKey · 2022-01-30 23:38
I'm setting up tab-bar-mode and would like to be prompted for the name of a new tab whenever I create one. `tab-bar-tab-name-function` should allow me to do this. It can take a function but it is not allowed to take any arguments. ``` (defun my/namefunc (x) (interactive "s")) ``` does not work because it takes an argument. I tried ``` (defun my/namefunc () (interactive) (let ((read-string "Enter name:")))) ``` But this also does not work and creates a bunch of issues. I'm pretty new to writing elisp so any help would be much appreciated.
karthink · 2022-01-31 01:54
(add-hook 'tab-bar-tab-post-open-functions (lambda (&rest _) (call-interactively #'tab-bar-rename-tab)))