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: Thu, 9 Jan 2025 06:10:06 -0300 Message-ID: References: <53eb31f5-e95d-48c9-a04a-c951a3a057a7@orange.fr> <8cc723b7-c6c5-450d-9832-9039362d63a5@gmail.com> <86ed1c31o6.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34826"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: 73178@debbugs.gnu.org To: Eli Zaretskii , da_vid@orange.fr Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jan 09 10:11:21 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 1tVoZU-0008ss-Mn for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 09 Jan 2025 10:11:21 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tVoZI-0001pJ-9c; Thu, 09 Jan 2025 04:11:08 -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 1tVoZC-0001oq-OT for bug-gnu-emacs@gnu.org; Thu, 09 Jan 2025 04:11:02 -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 1tVoZC-0003jn-3S for bug-gnu-emacs@gnu.org; Thu, 09 Jan 2025 04:11:02 -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=PMQr7xRlIE2OLebPVHhewxFqbPPHTJ33rHSIIaeHEpk=; b=CILMXcGbj68rcoBH3vtdo7HP1r5SSyyYmpyyOWBgTpm5PeQ5zepYIgn8M+LlEX2UXoRzWUQX5aSRThr9dfiQELcMFYdNB4uNcmTcSxljS7UoaIyWH9Eo3sI7Bxu7/l8tAzZkW9L7AbbMBpm+PffdthLi28Ca8Xp91mpPGQXAxqotCRObf2WHZaOkYhAvdb4RVDs2TzDemIBTlmozuiL1LBJ+QfctcD6zVntoCXR+htBNyfMn/0AB0YnL4AcNyu71jH/5Z7TqdTDd3voiEIBI0tRPJwrpxcAx0+hXb2/w+KDtAUOKTAlIswd0GkkwiuCI5F17S5h0cEVVB/i1Vw2eIg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tVoZB-0003gG-VB for bug-gnu-emacs@gnu.org; Thu, 09 Jan 2025 04:11:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Mauro Aranda Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 09 Jan 2025 09:11:01 +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.173641382114088 (code B ref 73178); Thu, 09 Jan 2025 09:11:01 +0000 Original-Received: (at 73178) by debbugs.gnu.org; 9 Jan 2025 09:10:21 +0000 Original-Received: from localhost ([127.0.0.1]:50404 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tVoYW-0003fA-TC for submit@debbugs.gnu.org; Thu, 09 Jan 2025 04:10:21 -0500 Original-Received: from mail-vs1-xe2f.google.com ([2607:f8b0:4864:20::e2f]:59476) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1tVoYU-0003aS-7P for 73178@debbugs.gnu.org; Thu, 09 Jan 2025 04:10:19 -0500 Original-Received: by mail-vs1-xe2f.google.com with SMTP id ada2fe7eead31-4aff5b3845eso302134137.2 for <73178@debbugs.gnu.org>; Thu, 09 Jan 2025 01:10:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1736413812; x=1737018612; darn=debbugs.gnu.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=PMQr7xRlIE2OLebPVHhewxFqbPPHTJ33rHSIIaeHEpk=; b=XmhB8yCbFhNdflhI+agDXSbTDWS317uJSeJl8OxZ5Bu+gbVyBFPct3ZcqaYQVdesb7 T2fnO2i5Cj+cP+0jFdhNVKio41PfjgvWebJ4uErHYaQrse7WCyt0VXigwbsjq1X81zOe fUlL+sekwOxfSTHcvATagPhFI5eQ3tOTdQNuqHkuxaq+uRqGCr3DI8kKhDzIisq3xY+O aqCOg6gHtRldiHj9rQL3Y/WzhSXI1QqFvdwLN5EfCQnqlgf7FquCSjzugsHesMVY5kMR 58YHzPBuRU6fCn0v10pU1yz3L+gVk9ry7yzDhBDdYHmGStT0qCjeCX7w63dXfXfmtALV qs1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736413812; x=1737018612; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=PMQr7xRlIE2OLebPVHhewxFqbPPHTJ33rHSIIaeHEpk=; b=V524Re1ql4ygqzunthFhroh7J22DBo4UQs9M5KVo7hI4i0ApO6liQEt0vqkO/u8d+u cajbDXr7Z8XqQwnpzq6ct3gbYhFJYgn0ZxePvhz2u4l/iQRiFUZkTEpyIhvgbcpbZQog YeqUH0L41EXr4gbi2QwYOLvvoJ4NylXkyJrj+Nl8SaCPA0mpCO2qq6phj4ibhWsj7KHd WVAJ/Q58wFhNL2d03T/yVBt35Cizhc6EF14Kve2zvXRiIFFSp/pmkK/38jr/nOf9HIZT G/KNwFBKEy7Hp0o+QSHGdZuhpQCglcafEfr1GaKc7uBVVHf6Uf8bigqEvsbMQrRRL78P rsFw== X-Gm-Message-State: AOJu0YzsYnKeEtWH2OrT1V87r5n1QC/cwsKBLqAsVwlFT9JRetafKV2H eZZOsg/MfVZdo0v0zVBtkguPjsxWDG3WiK8kqZ4b77lM3EdIMA0W X-Gm-Gg: ASbGncuI9nFb+9KMt+qtiHeqiWeedcV2WiII9oZYnoN143Q+2C4AEKPfiOlfIUbJMPG gtk8EjFCbrN0mUTLJ0uPEclMcU1FWFf+81VOYbBoAoE3Ku3dB/4ZbZjr2V/LFro2lEL+dqJiP6l lHVwV5OtrEfF/lRClzh9RlNPYK6YiDgC2bPQf/Iyy3InU77nwkbjLXTq7OJp4DdZMszGa2GVSbq 0bJr/tY+Jefid5zSCKtCvkk1SKGA8mt8r7JDg9HmJTEF3rH4VF19zlAy+dCS4o= X-Google-Smtp-Source: AGHT+IHmHraYCboIAukZNAaUNGDHyZTSPA122TRcMx7gz1RWil4eSTbEyY+2X8r9lGybS63dh1oawQ== X-Received: by 2002:a05:6102:a4e:b0:4b2:4cb0:91d5 with SMTP id ada2fe7eead31-4b3d0fc4fdbmr4802660137.15.1736413812260; Thu, 09 Jan 2025 01:10:12 -0800 (PST) Original-Received: from [192.168.0.234] ([181.228.33.6]) by smtp.gmail.com with ESMTPSA id a1e0cc1a2514c-8623157902esm546356241.32.2025.01.09.01.10.08 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 09 Jan 2025 01:10:10 -0800 (PST) Content-Language: en-US In-Reply-To: <86ed1c31o6.fsf@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:298820 Archived-At: Eli Zaretskii writes: >> Date: Wed, 8 Jan 2025 10:59:27 -0300 >> Cc: Eli Zaretskii >> From: Mauro Aranda >> >> 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. > > Thanks for the review. > > I wanted to install this, but byte-compiler produces a warning: > >     ELC      cus-edit.elc > >   In toplevel form: >   cus-edit.el:5595:20: Warning: reference to free variable `custom-icon--texts-widget' > > Is that a typo, and you actually meant custom-icon--texts-sub-type? There were typos in the first 2 patches David sent.  The last patch, the one that ends with -V2, was good.  I think I quoted that one.