From: Juri Linkov <juri@linkov.net>
To: Matthias Meulien <orontee@gmail.com>
Cc: 41372@debbugs.gnu.org
Subject: bug#41372: 28.0.50; [PATCH] Wrong value of tab-bar-tab-name-ellipsis
Date: Wed, 20 May 2020 01:35:56 +0300 [thread overview]
Message-ID: <87tv0b7dtf.fsf@mail.linkov.net> (raw)
In-Reply-To: <87imguchpw.fsf@gmail.com> (Matthias Meulien's message of "Mon, 18 May 2020 00:35:55 +0200")
> When I evaluate (char-displayable-p ?…) from current frame (under X) it
> evaluates to a valid font but, after I customized
> `tab-bar-tab-name-function` to equal `tab-bar-tab-name-truncated`, tab
> names are truncated using three dots characters.
Thanks for the patch. One problem is that the patch hard-codes the ellipsis,
so that the user loses the ability to configure it.
A better way would be to leave defvar tab-bar-tab-name-ellipsis,
but by default set its value to nil. So when it's non-nil,
then use its value, otherwise use "…"/"..." by default.
> -(defvar tab-bar-tab-name-ellipsis
> - (if (char-displayable-p ?…) "…" "..."))
> -
> (defun tab-bar-tab-name-truncated ()
> "Generate tab name from the buffer of the selected window.
> -Truncate it to the length specified by `tab-bar-tab-name-truncated-max'.
> -Append ellipsis `tab-bar-tab-name-ellipsis' in this case."
> - (let ((tab-name (buffer-name (window-buffer (minibuffer-selected-window)))))
> +Truncate it to the length specified by `tab-bar-tab-name-truncated-max'."
> + (let ((tab-name (buffer-name (window-buffer (minibuffer-selected-window))))
> + (ellipsis (if (char-displayable-p ?…) "…" "...")))
> (if (< (length tab-name) tab-bar-tab-name-truncated-max)
> tab-name
> (propertize (truncate-string-to-width
> tab-name tab-bar-tab-name-truncated-max nil nil
> - tab-bar-tab-name-ellipsis)
> + ellipsis)
next prev parent reply other threads:[~2020-05-19 22:35 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-17 22:35 bug#41372: 28.0.50; [PATCH] Wrong value of tab-bar-tab-name-ellipsis Matthias Meulien
2020-05-19 22:35 ` Juri Linkov [this message]
2020-05-23 19:54 ` Matthias Meulien
2020-05-23 22:28 ` Juri Linkov
2020-05-24 2:33 ` Eli Zaretskii
2020-05-24 22:02 ` Juri Linkov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87tv0b7dtf.fsf@mail.linkov.net \
--to=juri@linkov.net \
--cc=41372@debbugs.gnu.org \
--cc=orontee@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).