From: Juri Linkov <juri@linkov.net>
To: Po Lu <luangruo@yahoo.com>
Cc: Eli Zaretskii <eliz@gnu.org>, 51648@debbugs.gnu.org
Subject: bug#51648: 28.0.60; `tab-bar-close-button' and `tab-bar-new-button' should be documented in the manual
Date: Thu, 15 Sep 2022 19:20:39 +0300 [thread overview]
Message-ID: <86a670ac4g.fsf@mail.linkov.net> (raw)
In-Reply-To: <86r1br2f6s.fsf@mail.linkov.net> (Juri Linkov's message of "Mon, 08 Nov 2021 11:02:19 +0200")
[-- Attachment #1: Type: text/plain, Size: 606 bytes --]
>> People generally want to customize the image, and perhaps the scale of
>> that image.
>>
>> But I see no harm in letting people customize the whole string, if he
>> wants to.
>
> I can't imagine how Customization UI could support customization of
> such strings with text properties and images on them.
Fortunately, now we have customizable icons. So I tried to do this
with a patch like below, but compilation failed with this error
because tab-bar.el is pre-loaded:
Loading tab-bar (native compiled elisp)...
Error: void-function (icons--register)
(require cl-print) while preparing to dump
[-- Attachment #2: tab-bar-new-icon.patch --]
[-- Type: text/x-diff, Size: 1238 bytes --]
diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el
index 561365bb48..5d990ac184 100644
--- a/lisp/tab-bar.el
+++ b/lisp/tab-bar.el
@@ -33,7 +33,8 @@
(eval-when-compile
(require 'cl-lib)
- (require 'seq))
+ (require 'seq)
+ (require 'icons))
\f
(defgroup tab-bar nil
@@ -521,6 +522,17 @@ tab-bar-new-button-show
(defvar tab-bar-new-button " + "
"Button for creating a new tab.")
+(define-icon tab-bar-new-icon nil
+ `((image "tabs/new.xpm"
+ :margin ,tab-bar-button-margin
+ :ascent center)
+ (emoji "➕")
+ (symbol "+")
+ (text " + " :face tab-bar-tab))
+ "Icon for creating a new tab."
+ :version "29.1"
+ :help-echo "New tab")
+
(defcustom tab-bar-close-button-show t
"Defines where to show the close tab button.
If t, show the close tab button on all tabs.
@@ -905,8 +925,8 @@ tab-bar-format-tabs-groups
(defun tab-bar-format-add-tab ()
"Button to add a new tab."
- (when (and tab-bar-new-button-show tab-bar-new-button)
- `((add-tab menu-item ,tab-bar-new-button tab-bar-new-tab
+ (when (and tab-bar-new-button-show)
+ `((add-tab menu-item ,(icon-string 'tab-bar-new-icon) tab-bar-new-tab
:help "New tab"))))
(defun tab-bar-format-align-right ()
next prev parent reply other threads:[~2022-09-15 16:20 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <878ry0y884.fsf.ref@yahoo.com>
2021-11-07 3:07 ` bug#51648: 28.0.60; `tab-bar-close-button' and `tab-bar-new-button' should be documented in the manual Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-11-07 7:12 ` Eli Zaretskii
2021-11-07 7:23 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-11-07 7:40 ` Eli Zaretskii
2021-11-07 8:05 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-11-07 17:37 ` Juri Linkov
2021-11-07 18:25 ` Eli Zaretskii
2021-11-07 18:31 ` Juri Linkov
2021-11-07 18:41 ` Eli Zaretskii
2021-11-07 20:00 ` Juri Linkov
2021-11-08 0:32 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-11-08 9:02 ` Juri Linkov
2022-09-15 16:20 ` Juri Linkov [this message]
2022-10-23 18:11 ` Juri Linkov
2021-11-08 17:46 ` Juri Linkov
2022-01-27 18:45 ` 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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=86a670ac4g.fsf@mail.linkov.net \
--to=juri@linkov.net \
--cc=51648@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=luangruo@yahoo.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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.