GNU bug report logs - #73178
31.0.50; [PATCH] Improve the widget to customize icon

Previous Next

Package: emacs;

Reported by: David Ponce <da_vid <at> orange.fr>

Date: Wed, 11 Sep 2024 14:29:02 UTC

Severity: normal

Tags: patch

Found in version 31.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: David Ponce <da_vid <at> orange.fr>, Mauro Aranda <maurooaranda <at> gmail.com>
Cc: 73178 <at> debbugs.gnu.org
Subject: bug#73178: 31.0.50; [PATCH] Improve the widget to customize icon
Date: Sat, 14 Sep 2024 12:52:28 +0300
> 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" <bug-gnu-emacs <at> gnu.org>
> 
> 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))




This bug report was last modified 133 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.