From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#51648: 28.0.60; `tab-bar-close-button' and `tab-bar-new-button' should be documented in the manual Date: Sun, 23 Oct 2022 21:11:43 +0300 Organization: LINKOV.NET Message-ID: <86fsfe73tc.fsf@mail.linkov.net> References: <878ry0y884.fsf.ref@yahoo.com> <878ry0y884.fsf@yahoo.com> <83ee7sa17b.fsf@gnu.org> <878ry0whrm.fsf@yahoo.com> <83a6ig9zxc.fsf@gnu.org> <86h7cogg2d.fsf@mail.linkov.net> <835yt3962f.fsf@gnu.org> <864k8nrf5l.fsf@mail.linkov.net> <831r3r95bs.fsf@gnu.org> <86r1brpwh3.fsf@mail.linkov.net> <871r3rtrkr.fsf@yahoo.com> <86r1br2f6s.fsf@mail.linkov.net> <86a670ac4g.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13229"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) To: 51648@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Oct 24 08:42:26 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1omrAH-0003J0-Lr for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 24 Oct 2022 08:42:25 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1omnIQ-0004vP-MS; Sun, 23 Oct 2022 22:34:34 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1omgQ6-000885-MZ for bug-gnu-emacs@gnu.org; Sun, 23 Oct 2022 15:14:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1omgQ6-0001rN-BM for bug-gnu-emacs@gnu.org; Sun, 23 Oct 2022 15:14:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1omgQ6-0003wt-68 for bug-gnu-emacs@gnu.org; Sun, 23 Oct 2022 15:14:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 23 Oct 2022 19:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51648 X-GNU-PR-Package: emacs Original-Received: via spool by 51648-submit@debbugs.gnu.org id=B51648.166655238915099 (code B ref 51648); Sun, 23 Oct 2022 19:14:02 +0000 Original-Received: (at 51648) by debbugs.gnu.org; 23 Oct 2022 19:13:09 +0000 Original-Received: from localhost ([127.0.0.1]:46501 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1omgPE-0003vM-PQ for submit@debbugs.gnu.org; Sun, 23 Oct 2022 15:13:09 -0400 Original-Received: from relay10.mail.gandi.net ([217.70.178.230]:34903) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1omgPB-0003ub-Fw for 51648@debbugs.gnu.org; Sun, 23 Oct 2022 15:13:07 -0400 Original-Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 13D43240008 for <51648@debbugs.gnu.org>; Sun, 23 Oct 2022 19:12:57 +0000 (UTC) In-Reply-To: <86a670ac4g.fsf@mail.linkov.net> (Juri Linkov's message of "Thu, 15 Sep 2022 19:20:39 +0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: "bug-gnu-emacs" Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:246095 Archived-At: --=-=-= Content-Type: text/plain > 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 > OTOH, the following patch works pretty well: --=-=-= Content-Type: text/x-diff; charset=utf-8 Content-Disposition: inline; filename=tab-bar-icons.patch Content-Transfer-Encoding: 8bit diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el index abefd996a8a..777837f4db7 100644 --- a/lisp/tab-bar.el +++ b/lisp/tab-bar.el @@ -155,25 +155,34 @@ tab-bar--undefine-keys (defun tab-bar--load-buttons () "Load the icons for the tab buttons." - (when (and tab-bar-new-button - (not (get-text-property 0 'display tab-bar-new-button))) - ;; This file is pre-loaded so only here we can use the right data-directory: - (add-text-properties 0 (length tab-bar-new-button) - `(display (image :type xpm - :file "tabs/new.xpm" - :margin ,tab-bar-button-margin - :ascent center)) - tab-bar-new-button)) + (require 'icons) - (when (and tab-bar-close-button - (not (get-text-property 0 'display tab-bar-close-button))) - ;; This file is pre-loaded so only here we can use the right data-directory: - (add-text-properties 0 (length tab-bar-close-button) - `(display (image :type xpm - :file "tabs/close.xpm" - :margin ,tab-bar-button-margin - :ascent center)) - tab-bar-close-button))) + (unless (iconp 'tab-bar-new) + (define-icon tab-bar-new nil + `((image "tabs/new.xpm" + :margin ,tab-bar-button-margin + :ascent center) + ;; (emoji "➕") + ;; (symbol "+") + (text " + ")) + "Icon for creating a new tab." + :version "29.1" + :help-echo "New tab")) + (setq tab-bar-new-button (icon-string 'tab-bar-new)) + + (unless (iconp 'tab-bar-close) + (define-icon tab-bar-close nil + `((image "tabs/close.xpm" + :margin ,tab-bar-button-margin + :ascent center) + ;; (emoji " ❌") + ;; (symbol "ⓧ") + (text " x")) + "Icon for closing the clicked tab." + :version "29.1" + :help-echo "Click to close tab")) + (setq tab-bar-close-button (propertize (icon-string 'tab-bar-close) + 'close-tab t))) (defun tab-bar--tab-bar-lines-for-frame (frame) "Determine and return the value of `tab-bar-lines' for FRAME. @@ -1916,22 +1933,27 @@ tab-bar-history-mode :global t :group 'tab-bar (if tab-bar-history-mode (progn - (when (and tab-bar-mode (not (get-text-property 0 'display tab-bar-back-button))) - ;; This file is pre-loaded so only here we can use the right data-directory: - (add-text-properties 0 (length tab-bar-back-button) - `(display (image :type xpm - :file "tabs/left-arrow.xpm" - :margin ,tab-bar-button-margin - :ascent center)) - tab-bar-back-button)) - (when (and tab-bar-mode (not (get-text-property 0 'display tab-bar-forward-button))) - ;; This file is pre-loaded so only here we can use the right data-directory: - (add-text-properties 0 (length tab-bar-forward-button) - `(display (image :type xpm - :file "tabs/right-arrow.xpm" - :margin ,tab-bar-button-margin - :ascent center)) - tab-bar-forward-button)) + (require 'icons) + + (unless (iconp 'tab-bar-back) + (define-icon tab-bar-back nil + `((image "tabs/left-arrow.xpm" + :margin ,tab-bar-button-margin + :ascent center) + (text " < ")) + "Icon for going back in tab history." + :version "29.1")) + (setq tab-bar-back-button (icon-string 'tab-bar-back)) + + (unless (iconp 'tab-bar-forward) + (define-icon tab-bar-forward nil + `((image "tabs/right-arrow.xpm" + :margin ,tab-bar-button-margin + :ascent center) + (text " > ")) + "Icon for going forward in tab history." + :version "29.1")) + (setq tab-bar-forward-button (icon-string 'tab-bar-forward)) (add-hook 'pre-command-hook 'tab-bar--history-pre-change) (add-hook 'window-configuration-change-hook 'tab-bar--history-change)) --=-=-=--