From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Mauro Aranda Newsgroups: gmane.emacs.bugs Subject: bug#73178: 31.0.50; [PATCH] Improve the widget to customize icon Date: Wed, 8 Jan 2025 10:59:27 -0300 Message-ID: <8cc723b7-c6c5-450d-9832-9039362d63a5@gmail.com> References: <53eb31f5-e95d-48c9-a04a-c951a3a057a7@orange.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6746"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: Eli Zaretskii To: David Ponce , 73178@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jan 08 15:00:47 2025 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 1tVWc3-0001cZ-2w for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 08 Jan 2025 15:00:47 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tVWbr-0008CM-OD; Wed, 08 Jan 2025 09:00:38 -0500 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 1tVWbR-00084y-0p for bug-gnu-emacs@gnu.org; Wed, 08 Jan 2025 09:00:26 -0500 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 1tVWbL-0007I9-BA for bug-gnu-emacs@gnu.org; Wed, 08 Jan 2025 09:00:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=In-Reply-To:From:References:MIME-Version:Date:To:Subject; bh=XFIvwYKb1hlEApdeVPhxrBZuVMX9X+/QvtbwW9qdX2A=; b=HFwklbaF3RqdGAMRevVkiAP4P9loVZDcgLnz8nc6YNQ5Pf9QwpXEIk7bkHZZUIq+U5CD3E3hIqfRQAImIgGQKXmj8HmAMcDuSNhBTBzYTiPKeXtLLScDhomBMjKvfh+qA8zmovQp2vPyU+sOCYCwrEgK5CLcd8D/cRHv98zNFxXSRqAd09E8jyNyH3QDKqh644kMCeQ1dUHbZnQVaQQSxVqA8vetICaPdpBnrszNUmcQotrB06uraHcEzrNfrQIvOy0GjvExK7OdTM6ZeP7qvN/zLETYOLxon9o6AcA5wwmy4iJ+zaT6+m2+C8jlLB5YFB2+91rhkJGcWtC5+fgxvA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tVWbL-0004DC-5e for bug-gnu-emacs@gnu.org; Wed, 08 Jan 2025 09:00:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Mauro Aranda Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 08 Jan 2025 14:00:03 +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.173634477916125 (code B ref 73178); Wed, 08 Jan 2025 14:00:03 +0000 Original-Received: (at 73178) by debbugs.gnu.org; 8 Jan 2025 13:59:39 +0000 Original-Received: from localhost ([127.0.0.1]:46509 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tVWax-0004C1-Bp for submit@debbugs.gnu.org; Wed, 08 Jan 2025 08:59:39 -0500 Original-Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]:56349) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1tVWau-0004Bk-TG for 73178@debbugs.gnu.org; Wed, 08 Jan 2025 08:59:37 -0500 Original-Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-2163b0c09afso248081965ad.0 for <73178@debbugs.gnu.org>; Wed, 08 Jan 2025 05:59:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1736344771; x=1736949571; darn=debbugs.gnu.org; h=content-transfer-encoding:in-reply-to:from:cc:content-language :references:to:subject:user-agent:mime-version:date:message-id:from :to:cc:subject:date:message-id:reply-to; bh=XFIvwYKb1hlEApdeVPhxrBZuVMX9X+/QvtbwW9qdX2A=; b=jgigPvGtNpsC7yCV4I3dWa7FWkBFOC83TVIN/Yu6KWVTtyMQI2pFQwH+MhMpJydA8l p0vk8E/zbtTrNX3zE+3wSsyBi2GTsiKu+q76/VDnUi8EIIffblexr151/yEKBbY50bIR YNxJUl0IRGJB7nEzLsffHu8TwJF0Hv02LZNvjdTSRGnGOixBlGYdeWpsULlB5DZ6D9iv a5jpQJ2/AEcA42SLeTj/yAnrjjkuWmxnIZATNJi/kQuL58zeSveB8EHDERjRnFMrW70R 2uideqcb6kOLMbeQUrIBo93HJ2iqa+2zZVFPElFDcNH8LxwOwGKYNW/G4yL42eokBG7o z1Bw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736344771; x=1736949571; h=content-transfer-encoding:in-reply-to:from:cc:content-language :references:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=XFIvwYKb1hlEApdeVPhxrBZuVMX9X+/QvtbwW9qdX2A=; b=fn84/mmeEzEek00Z4ZnCLq63USO7YA1InUAk2LWXJgmv21x5kY/mxRoZwaNA5a3m3v w5RMMfyk0ShU1BJ2wHToqhMc639G1YhhEOjrUh6Q9JkZt+7L+xNQbIZFAqxHG241spUw a5Y7YwFftVZ47T6YQTD1Mjjlf5Y5PeMfbOkkgX59O4mu1WqyqTdzC5ykq3aG3mfUr5/U BF9lVyKux8/sIqZ/qUTBcvH7AvBp1ms4S6A3ebb4OpUh96Ge5OrRXU2gz+xY6TN4Lcpo 3ctci0zIT6qerYajnaS2nqmSKYUM5U+ChfnrKkeaikyKzNzxLFii1KS3m9wT4Jd0A+94 kl3A== X-Forwarded-Encrypted: i=1; AJvYcCVzt5/j8bo4a+2u9TXn35Pu3IrBrGr1B0y7+aYK/jg8P9oUsWO47AY5tZfj0K4oyRZlexQRNw==@debbugs.gnu.org X-Gm-Message-State: AOJu0Yxpgb6fHUh4wJo4actU9vZYOu6bti1qbH/1ZSvdKFNS836ihyPy SUnQi6e3DrkuS5cjScJitrz+PmscoaNMQaCgPfwPj6MXjGDyxw5d X-Gm-Gg: ASbGnct2VljQsqtYb0+ApEAGn6wEsSaJuQYbJtJrLTk4Oy67JDvbT0R3FlgBT1oqx5T 5drbErQztXUwkLIU7boU9XM8Rh7DMhxsR++STA4ZPqZ4WpAdjb7hHtns3RHQImEhLvcccbKEu/R F2nyo1YJiyRXyOloDNwPWuXx7yhJClVwBVkJxf9RPA4zYx61uBWIBTKviWCjsnZH4au2CAlYdtZ etDcEuqZlgglf5QzMQ+0ZlKIzFLxS9mikDtTnlngSSSSi51SYFgl8dPkXDx+4w= X-Google-Smtp-Source: AGHT+IF2eGs+qZlUMGUoTmyQnq3gMfVYIOhzJ8orP03eAM1fFE6Q2x6RXUAwVLQihIkTmp1bb8WQxg== X-Received: by 2002:a17:903:1cf:b0:21a:8300:b9d5 with SMTP id d9443c01a7336-21a83f4cd36mr48068715ad.23.1736344770608; Wed, 08 Jan 2025 05:59:30 -0800 (PST) Original-Received: from [192.168.0.234] ([181.228.33.6]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-842aba72f71sm32743473a12.9.2025.01.08.05.59.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 08 Jan 2025 05:59:29 -0800 (PST) Content-Language: en-US In-Reply-To: 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:298781 Archived-At: David Ponce writes: > On 11/09/2024 5:19 PM, David Ponce wrote: >> Attached the correct patch. >> Sorry > Should be the good one this time. > Sorry again. > > 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-sub-type > + :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)) I think this is an improvement. Thanks David.