[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Fix width tabs
From: |
Juri Linkov |
Subject: |
Re: Fix width tabs |
Date: |
Tue, 22 Feb 2022 19:18:35 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) |
> I tried the following (not trying to dynamically compute the tabs width
> to start with and disabling support for close buttons):
>
> (defun my-tab-bar-tab-name-format (tab i)
> (propertize
> (truncate-string-to-width
> (format
> (concat "%-" (number-to-string tab-bar-tab-name-truncated-max) "s")
> (alist-get 'name tab))
> tab-bar-tab-name-truncated-max 0 ?m t)
> 'face (funcall tab-bar-tab-face-function tab)))
>
> (setq tab-bar-tab-name-format-function 'my-tab-bar-tab-name-format)
>
> Unfortunately it doesn't play well with variable pitch font, and the
> display property "min-width" isn't honored in tab-bar. I guess my naive
> approach won't be sufficient...
I don't remember if we already have pixel-level space padding for
variable pitch fonts. Probably not, because variable pitch fonts
can't be used on the mode-line where the problem is that the
coding-system indicator can't take the fixed amount of space.
One of the threads where this was recently discussed:
https://lists.gnu.org/archive/html/emacs-devel/2021-06/msg00343.html