>> The only problem is that I don't know how to use matched numbered groups >> \1 from matches of buffer names in display conditions. >> >> display-buffer-assq-regexp uses string-match-p, not string-match. > > If you really need 'string-match', we have to save the match data. display-buffer-in-tab is implemented now, but we need also an action to display the buffer in an existing tab if such buffer is already displayed in it. I tried to copy an existing action that supports frames, but can't find such a frame action that would select another frame if the buffer is already is displayed in it. Does such frame action exist whose behavior could be copied to tabs? This will require a new function function tab-bar-buffer-visible-in-tabs. Also I use this function in a wrapper that kills the buffer, such wrapper checks (tab-bar-buffer-visible-in-tabs-p (current-buffer)) If true, it doesn't kill the buffer, but buries it. So switching back to that tab still displays the buffer. Another place where I use tab-bar-buffer-visible-in-tabs-p is to save Dired buffers to the desktop file only when the Dired buffer is displayed in a tab: (setq desktop-buffers-not-to-save-function (lambda (_filename bufname mode &rest _) (or (not (memq mode '(dired-mode vc-dir-mode))) (memq (get-buffer bufname) (mapcar #'window-buffer (window-list-1))) (tab-bar-buffer-visible-in-tabs-p (get-buffer bufname))))) This also required changes in desktop.el to support new predicate function desktop-buffers-not-to-save-function.