GNU bug report logs -
#51648
28.0.60; `tab-bar-close-button' and `tab-bar-new-button' should be documented in the manual
Previous Next
Reported by: Po Lu <luangruo <at> yahoo.com>
Date: Sun, 7 Nov 2021 03:08:01 UTC
Severity: wishlist
Merged with 51309
Found in version 28.0.60
Fixed in version 29.0.50
Done: Juri Linkov <juri <at> linkov.net>
Bug is archived. No further changes may be made.
Full log
Message #49 received at 51648 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
>> 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
[tab-bar-new-icon.patch (text/x-diff, inline)]
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))
(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 ()
This bug report was last modified 2 years and 210 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.