From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#73178: 31.0.50; [PATCH] Improve the widget to customize icon Date: Sat, 14 Sep 2024 12:52:28 +0300 Message-ID: <86ed5mh89v.fsf@gnu.org> References: <4cd4a62c-6642-49a3-8b2c-5eda13ac79af@orange.fr> <53eb31f5-e95d-48c9-a04a-c951a3a057a7@orange.fr> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38921"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 73178@debbugs.gnu.org To: David Ponce , Mauro Aranda Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Sep 14 11:53:12 2024 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 1spPSp-0009w8-2P for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 14 Sep 2024 11:53:11 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1spPSZ-0004Zs-6q; Sat, 14 Sep 2024 05:52:55 -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 1spPSX-0004ZE-BH for bug-gnu-emacs@gnu.org; Sat, 14 Sep 2024 05:52:53 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1spPSW-00014i-SF for bug-gnu-emacs@gnu.org; Sat, 14 Sep 2024 05:52:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=References:In-Reply-To:From:Date:To:Subject; bh=c+FsRUSUUXcJvlRKvBoN0gw53Adca3jIDKcyHi7X5Sw=; b=TSiBylHJU39Sx6PCW4sDf9HqvdSXMS6xiIHF8oeSYFysO4xHLpUIJNT9Tshtmt+7wNOAqIgLMPN3k8F6FSrR0UVGS6ryOEaoljEPrC1O+RVNNkWn+3S5IP8MIG8B2sjB+BsqfA2iFSImr5cUt2oAOgnKH+U5f+0RUauPdRSsvmeQbsKAD5m2OVZcYGWs5UA+bV2Bn7Pv+lluXmgP7zW0pzbMUik8lHp0gw3vPyKfUjWTbuLwdOkZ2s0c5fts8f5kegOqG/EYOxm7iYxgKFOGltYYnQ9fC3cBKAN0Ysph7qNERY/q7VI1AP3zxWw77kZCGa1AFm3WYzUwHYGBj56nHA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1spPSg-000290-OV for bug-gnu-emacs@gnu.org; Sat, 14 Sep 2024 05:53:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 14 Sep 2024 09:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73178 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 73178-submit@debbugs.gnu.org id=B73178.17263075688201 (code B ref 73178); Sat, 14 Sep 2024 09:53:02 +0000 Original-Received: (at 73178) by debbugs.gnu.org; 14 Sep 2024 09:52:48 +0000 Original-Received: from localhost ([127.0.0.1]:44855 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1spPSS-00028C-2X for submit@debbugs.gnu.org; Sat, 14 Sep 2024 05:52:48 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:44912) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1spPSQ-000280-Vd for 73178@debbugs.gnu.org; Sat, 14 Sep 2024 05:52:47 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1spPSB-000138-7q; Sat, 14 Sep 2024 05:52:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=c+FsRUSUUXcJvlRKvBoN0gw53Adca3jIDKcyHi7X5Sw=; b=EQ7vYOS46EQJ r48nClTEgT20ZG+4Kro2sEP0JZOpwwJQxBfjElOlJtpCLvhRWxyRNyyz8bPgflNTxe0bIWWQ7LJtO wUB/e5aFeM4ltCrePwtXm1RiLw7L+zPxtoFn6e2f6RSvc+qOr0tot5obe0xpVuEy+9JdyTPiVz2y1 Lq5Ts0nMlRfwYsMJzsRBPt4PFZJxUyGQ/5mmA5MFiVBaX454UD070Fwaa9fJNO9CDUzqFCRhTkiLx ZHYKd6t3EjjXbyGDOQ4GxtfUayxuF9dU4IzX5/Y4eGjWjTjyRvYYsaL1oEAxOGlalkmUza7/lQLKj 6kEBcdl01smsU60WKXPoEg==; In-Reply-To: <53eb31f5-e95d-48c9-a04a-c951a3a057a7@orange.fr> (bug-gnu-emacs@gnu.org) 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: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:291721 Archived-At: > Date: Wed, 11 Sep 2024 17:19:58 +0200 > From: David Ponce via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" > > Attached the correct patch. > Sorry > > diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el > index 3ab5f11532e..fd790b18630 100644 > --- a/lisp/cus-edit.el > +++ b/lisp/cus-edit.el > @@ -5525,6 +5525,53 @@ custom-icon-extended-menu > "A menu for `custom-icon' widgets. > Used in `custom-icon-action' to show a menu to the user.") > > +(defconst custom-icon--images-sub-type > + '(list :format "%{%t%}:\n%v\n" > + :tag "Images" > + (const :tag "" image) > + (repeat :tag "Values" > + (string :tag "Image filename")) > + (plist :tag "Image attributes"))) > + > +(defconst custom-icon--emojis-sub-type > + '(list :format "%{%t%}:\n%v\n" > + :tag "Colorful Emojis" > + (const :tag "" emoji) > + (repeat :tag "Values" > + (string :tag "Emoji text")) > + (plist :tag "Emoji text properties"))) > + > +(defconst custom-icon--symbols-sub-type > + '(list :format "%{%t%}:\n%v\n" > + :tag "Monochrome Symbols" > + (const :tag "" symbol) > + (repeat :tag "Values" > + (string :tag "Symbol text")) > + (plist :tag "Symbol text properties"))) > + > +(defconst custom-icon--texts-sub-type > + '(list :format "%{%t%}:\n%v\n" > + :tag "Texts Only" > + (const :tag "" text) > + (repeat :tag "Values" > + (string :tag "Text")) > + (plist :tag "Text properties"))) > + > +(defconst custom-icon--type > + `(repeat :format ,(concat "%{%t%}" > + (propertize ":" 'display "") > + "\n\n%v%i\n") > + :tag "Icon elements: > +- Only the first occurrence of a same element counts. > +- Missing elements will take their default value. > +- At least one element should be provided with a valid value." > + (choice :void ,custom-icon--texts-widget > + :extra-offset -3 > + ,custom-icon--images-sub-type > + ,custom-icon--emojis-sub-type > + ,custom-icon--symbols-sub-type > + ,custom-icon--texts-sub-type))) > + > (defun custom-icon-value-create (widget) > "Here is where you edit the icon's specification." > (custom-load-widget widget) > @@ -5535,13 +5582,7 @@ custom-icon-value-create > (form (widget-get widget :custom-form)) > (symbol (widget-get widget :value)) > (tag (widget-get widget :tag)) > - (type '(repeat > - (list (choice (const :tag "Images" image) > - (const :tag "Colorful Emojis" emoji) > - (const :tag "Monochrome Symbols" symbol) > - (const :tag "Text Only" text)) > - (repeat string) > - plist))) > + (type custom-icon--type) > (prefix (widget-get widget :custom-prefix)) > (last (widget-get widget :custom-last)) > (style (widget-get widget :custom-style))