* bug#73178: 31.0.50; [PATCH] Improve the widget to customize icon
@ 2024-09-11 14:28 David Ponce via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-11 15:19 ` David Ponce via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-14 9:51 ` Eli Zaretskii
0 siblings, 2 replies; 11+ messages in thread
From: David Ponce via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-09-11 14:28 UTC (permalink / raw)
To: 73178
[-- Attachment #1: Type: text/plain, Size: 3524 bytes --]
Hello,
Whenever I try to use Emacs' built-in icons, I have some difficulty
understanding the user interface for customizing an icon. For example,
regardless of the type of icon element, all the fields have similar
labels, which makes the interface difficult to understand and use.
For instance, for Images, it is not clear that the String field is
intended to enter the image file name:
Choice: Value Menu [Images|Colorful Emojis|Monochrome Symbols|Text only]
Repeat:
INS DEL String:
INS
Plist:
INS DEL :
Key:
Value:
INS
Also, nothing guides you regarding usage of this complex widget.
I propose the attached patch that improves the widget used to
customize an icon. Possible ChangeLog:
2024-09-11 David Ponce <da_vid@orange.fr>
Improve usability of the widget used to customize icon.
* lisp/cus-edit.el (custom-icon--images-sub-type)
(custom-icon--emojis-sub-type, custom-icon--symbols-sub-type)
(custom-icon--texts-sub-type): New constant.
(custom-icon--type): New constant.
(custom-icon-value-create): Use it.
With this patch, a quick help summarizes usage, and the different
fields are named according to the kind of icon element.
Here is a view of the new UI when customizing the default `button' icon:
---------------------------------------------------------------
Hide Button:
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.
INS DEL Choice: Value Menu Images:
Values:
INS DEL Image filename:
INS
Image attributes:
INS DEL :
Key: :face
Value: icon-button
INS
INS DEL Choice: Value Menu Colorful Emojis:
Values:
INS DEL Emoji text: 🔵
INS
Emoji text properties:
INS DEL :
Key: :face
Value: icon
INS
INS DEL Choice: Value Menu Monochrome Symbols:
Values:
INS DEL Symbol text: ●
INS
Symbol text properties:
INS DEL :
Key: :face
Value: icon-button
INS
INS DEL Choice: Value Menu Texts Only:
Values:
INS DEL Text: button
INS
Text properties:
INS DEL :
Key: :face
Value: icon-button
INS
INS
---------------------------------------------------------------
WDYT?
Thanks!
In GNU Emacs 31.0.50 (build 3, x86_64-pc-linux-gnu, GTK+ Version
3.24.43, cairo version 1.18.0) of 2024-09-11
Repository revision: 69e1aca041c57ba425425d31471e1c8f86d3bf04
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12014000
System Description: Fedora Linux 40 (KDE Plasma)
Configured using:
'configure --with-x-toolkit=gtk3 --with-cairo-xcb
--with-native-compilation=no
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig'
Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NOTIFY
INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF
TOOLKIT_SCROLL_BARS TREE_SITTER WEBP X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB
Important settings:
value of $LC_TIME: fr_FR.utf8
value of $LANG: fr_FR.UTF-8
locale-coding-system: utf-8-unix
[-- Attachment #2: improve-widget-to-customize-icon-V0.patch --]
[-- Type: text/x-patch, Size: 2776 bytes --]
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--widget)
(prefix (widget-get widget :custom-prefix))
(last (widget-get widget :custom-last))
(style (widget-get widget :custom-style))
^ permalink raw reply related [flat|nested] 11+ messages in thread
* bug#73178: 31.0.50; [PATCH] Improve the widget to customize icon
2024-09-11 14:28 bug#73178: 31.0.50; [PATCH] Improve the widget to customize icon David Ponce via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2024-09-11 15:19 ` David Ponce via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-11 15:28 ` David Ponce via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-14 9:52 ` Eli Zaretskii
2024-09-14 9:51 ` Eli Zaretskii
1 sibling, 2 replies; 11+ messages in thread
From: David Ponce via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-09-11 15:19 UTC (permalink / raw)
To: 73178
[-- Attachment #1: Type: text/plain, Size: 33 bytes --]
Attached the correct patch.
Sorry
[-- Attachment #2: improve-widget-to-customize-icon-V1.patch --]
[-- Type: text/x-patch, Size: 2774 bytes --]
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))
^ permalink raw reply related [flat|nested] 11+ messages in thread
* bug#73178: 31.0.50; [PATCH] Improve the widget to customize icon
2024-09-11 15:19 ` David Ponce via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2024-09-11 15:28 ` David Ponce via Bug reports for GNU Emacs, the Swiss army knife of text editors
2025-01-08 13:59 ` Mauro Aranda
2024-09-14 9:52 ` Eli Zaretskii
1 sibling, 1 reply; 11+ messages in thread
From: David Ponce via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-09-11 15:28 UTC (permalink / raw)
To: 73178
[-- Attachment #1: Type: text/plain, Size: 126 bytes --]
On 11/09/2024 5:19 PM, David Ponce wrote:
> Attached the correct patch.
> Sorry
Should be the good one this time.
Sorry again.
[-- Attachment #2: improve-widget-to-customize-icon-V2.patch --]
[-- Type: text/x-patch, Size: 2776 bytes --]
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))
^ permalink raw reply related [flat|nested] 11+ messages in thread
* bug#73178: 31.0.50; [PATCH] Improve the widget to customize icon
2024-09-11 14:28 bug#73178: 31.0.50; [PATCH] Improve the widget to customize icon David Ponce via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-11 15:19 ` David Ponce via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2024-09-14 9:51 ` Eli Zaretskii
1 sibling, 0 replies; 11+ messages in thread
From: Eli Zaretskii @ 2024-09-14 9:51 UTC (permalink / raw)
To: David Ponce, Mauro Aranda; +Cc: 73178
> Date: Wed, 11 Sep 2024 16:28:24 +0200
> From: David Ponce via "Bug reports for GNU Emacs,
> the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
>
> Whenever I try to use Emacs' built-in icons, I have some difficulty
> understanding the user interface for customizing an icon. For example,
> regardless of the type of icon element, all the fields have similar
> labels, which makes the interface difficult to understand and use.
> For instance, for Images, it is not clear that the String field is
> intended to enter the image file name:
>
> Choice: Value Menu [Images|Colorful Emojis|Monochrome Symbols|Text only]
> Repeat:
> INS DEL String:
> INS
> Plist:
> INS DEL :
> Key:
> Value:
> INS
>
> Also, nothing guides you regarding usage of this complex widget.
>
> I propose the attached patch that improves the widget used to
> customize an icon. Possible ChangeLog:
>
> 2024-09-11 David Ponce <da_vid@orange.fr>
>
> Improve usability of the widget used to customize icon.
>
> * lisp/cus-edit.el (custom-icon--images-sub-type)
> (custom-icon--emojis-sub-type, custom-icon--symbols-sub-type)
> (custom-icon--texts-sub-type): New constant.
> (custom-icon--type): New constant.
> (custom-icon-value-create): Use it.
>
> With this patch, a quick help summarizes usage, and the different
> fields are named according to the kind of icon element.
>
> Here is a view of the new UI when customizing the default `button' icon:
>
> ---------------------------------------------------------------
> Hide Button:
> 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.
>
> INS DEL Choice: Value Menu Images:
>
> Values:
> INS DEL Image filename:
> INS
> Image attributes:
> INS DEL :
> Key: :face
> Value: icon-button
> INS
>
> INS DEL Choice: Value Menu Colorful Emojis:
>
> Values:
> INS DEL Emoji text: 🔵
> INS
> Emoji text properties:
> INS DEL :
> Key: :face
> Value: icon
> INS
>
> INS DEL Choice: Value Menu Monochrome Symbols:
>
> Values:
> INS DEL Symbol text: ●
> INS
> Symbol text properties:
> INS DEL :
> Key: :face
> Value: icon-button
> INS
>
> INS DEL Choice: Value Menu Texts Only:
>
> Values:
> INS DEL Text: button
> INS
> Text properties:
> INS DEL :
> Key: :face
> Value: icon-button
> INS
>
> INS
> ---------------------------------------------------------------
>
> WDYT?
>
> Thanks!
Thanks. Mauro, could you please review and comment?
> 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--widget)
> (prefix (widget-get widget :custom-prefix))
> (last (widget-get widget :custom-last))
> (style (widget-get widget :custom-style))
^ permalink raw reply [flat|nested] 11+ messages in thread
* bug#73178: 31.0.50; [PATCH] Improve the widget to customize icon
2024-09-11 15:19 ` David Ponce via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-11 15:28 ` David Ponce via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2024-09-14 9:52 ` Eli Zaretskii
1 sibling, 0 replies; 11+ messages in thread
From: Eli Zaretskii @ 2024-09-14 9:52 UTC (permalink / raw)
To: David Ponce, Mauro Aranda; +Cc: 73178
> 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@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))
^ permalink raw reply [flat|nested] 11+ messages in thread
* bug#73178: 31.0.50; [PATCH] Improve the widget to customize icon
2024-09-11 15:28 ` David Ponce via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2025-01-08 13:59 ` Mauro Aranda
2025-01-09 7:07 ` Eli Zaretskii
0 siblings, 1 reply; 11+ messages in thread
From: Mauro Aranda @ 2025-01-08 13:59 UTC (permalink / raw)
To: David Ponce, 73178; +Cc: Eli Zaretskii
David Ponce <da_vid@orange.fr> 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.
^ permalink raw reply [flat|nested] 11+ messages in thread
* bug#73178: 31.0.50; [PATCH] Improve the widget to customize icon
2025-01-08 13:59 ` Mauro Aranda
@ 2025-01-09 7:07 ` Eli Zaretskii
2025-01-09 9:10 ` Mauro Aranda
2025-01-09 10:01 ` David Ponce via Bug reports for GNU Emacs, the Swiss army knife of text editors
0 siblings, 2 replies; 11+ messages in thread
From: Eli Zaretskii @ 2025-01-09 7:07 UTC (permalink / raw)
To: da_vid, Mauro Aranda; +Cc: 73178
> Date: Wed, 8 Jan 2025 10:59:27 -0300
> Cc: Eli Zaretskii <eliz@gnu.org>
> From: Mauro Aranda <maurooaranda@gmail.com>
>
> David Ponce <da_vid@orange.fr> 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?
Also, could you please accompany the patch with the ChangeLog-style
commit log message (see CONTRIBUTE for the details)? Otherwise, I
will have to write the log message manually when installing your
changes.
Thanks.
^ permalink raw reply [flat|nested] 11+ messages in thread
* bug#73178: 31.0.50; [PATCH] Improve the widget to customize icon
2025-01-09 7:07 ` Eli Zaretskii
@ 2025-01-09 9:10 ` Mauro Aranda
2025-01-09 10:01 ` David Ponce via Bug reports for GNU Emacs, the Swiss army knife of text editors
1 sibling, 0 replies; 11+ messages in thread
From: Mauro Aranda @ 2025-01-09 9:10 UTC (permalink / raw)
To: Eli Zaretskii, da_vid; +Cc: 73178
Eli Zaretskii <eliz@gnu.org> writes:
>> Date: Wed, 8 Jan 2025 10:59:27 -0300
>> Cc: Eli Zaretskii <eliz@gnu.org>
>> From: Mauro Aranda <maurooaranda@gmail.com>
>>
>> David Ponce <da_vid@orange.fr> 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.
^ permalink raw reply [flat|nested] 11+ messages in thread
* bug#73178: 31.0.50; [PATCH] Improve the widget to customize icon
2025-01-09 7:07 ` Eli Zaretskii
2025-01-09 9:10 ` Mauro Aranda
@ 2025-01-09 10:01 ` David Ponce via Bug reports for GNU Emacs, the Swiss army knife of text editors
2025-01-09 14:35 ` Eli Zaretskii
1 sibling, 1 reply; 11+ messages in thread
From: David Ponce via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2025-01-09 10:01 UTC (permalink / raw)
To: Eli Zaretskii, Mauro Aranda; +Cc: 73178
[-- Attachment #1: Type: text/plain, Size: 1349 bytes --]
On 2025-01-09 08:07, Eli Zaretskii wrote:
>> Date: Wed, 8 Jan 2025 10:59:27 -0300
>> Cc: Eli Zaretskii <eliz@gnu.org>
>> From: Mauro Aranda <maurooaranda@gmail.com>
>>
[...]
>> 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?
>
> Also, could you please accompany the patch with the ChangeLog-style
> commit log message (see CONTRIBUTE for the details)? Otherwise, I
> will have to write the log message manually when installing your
> changes.
>
> Thanks.
Hello Eli,
Hmm, it seems you didn't install the correct patch?
I attached the correct patch (V2) which applies cleanly for me.
Also below is my proposed ChangeLog.
Thank you, and thanks Mauro for your review.
2025-01-09 David Ponce <da_vid@orange.fr>
Improve usability of the widget used to customize icon.
* lisp/cus-edit.el (custom-icon--images-sub-type)
(custom-icon--emojis-sub-type, custom-icon--symbols-sub-type)
(custom-icon--texts-sub-type): New constant.
(custom-icon--type): New constant.
(custom-icon-value-create): Use it.
[-- Attachment #2: improve-widget-to-customize-icon-V2.patch --]
[-- Type: text/x-patch, Size: 2776 bytes --]
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))
^ permalink raw reply related [flat|nested] 11+ messages in thread
* bug#73178: 31.0.50; [PATCH] Improve the widget to customize icon
2025-01-09 10:01 ` David Ponce via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2025-01-09 14:35 ` Eli Zaretskii
2025-01-09 14:52 ` David Ponce via Bug reports for GNU Emacs, the Swiss army knife of text editors
0 siblings, 1 reply; 11+ messages in thread
From: Eli Zaretskii @ 2025-01-09 14:35 UTC (permalink / raw)
To: David Ponce; +Cc: maurooaranda, 73178-done
> Date: Thu, 9 Jan 2025 11:01:40 +0100
> Cc: 73178@debbugs.gnu.org
> From: David Ponce <da_vid@orange.fr>
>
> > 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?
> >
> > Also, could you please accompany the patch with the ChangeLog-style
> > commit log message (see CONTRIBUTE for the details)? Otherwise, I
> > will have to write the log message manually when installing your
> > changes.
> >
> > Thanks.
>
> Hello Eli,
>
> Hmm, it seems you didn't install the correct patch?
> I attached the correct patch (V2) which applies cleanly for me.
> Also below is my proposed ChangeLog.
>
> Thank you, and thanks Mauro for your review.
Thanks, and sorry for missing the last patch earlier.
Now installed on master, and closing the bug.
^ permalink raw reply [flat|nested] 11+ messages in thread
* bug#73178: 31.0.50; [PATCH] Improve the widget to customize icon
2025-01-09 14:35 ` Eli Zaretskii
@ 2025-01-09 14:52 ` David Ponce via Bug reports for GNU Emacs, the Swiss army knife of text editors
0 siblings, 0 replies; 11+ messages in thread
From: David Ponce via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2025-01-09 14:52 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: maurooaranda, 73178-done
On 2025-01-09 15:35, Eli Zaretskii wrote:
>> Date: Thu, 9 Jan 2025 11:01:40 +0100
>> Cc: 73178@debbugs.gnu.org
>> From: David Ponce <da_vid@orange.fr>
>>
>>> 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?
>>>
>>> Also, could you please accompany the patch with the ChangeLog-style
>>> commit log message (see CONTRIBUTE for the details)? Otherwise, I
>>> will have to write the log message manually when installing your
>>> changes.
>>>
>>> Thanks.
>>
>> Hello Eli,
>>
>> Hmm, it seems you didn't install the correct patch?
>> I attached the correct patch (V2) which applies cleanly for me.
>> Also below is my proposed ChangeLog.
>>
>> Thank you, and thanks Mauro for your review.
>
> Thanks, and sorry for missing the last patch earlier.
No worries. I should have double-checked my patch before submitting it ;-)
>
> Now installed on master, and closing the bug.
Thank you very much!
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2025-01-09 14:52 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-11 14:28 bug#73178: 31.0.50; [PATCH] Improve the widget to customize icon David Ponce via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-11 15:19 ` David Ponce via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-11 15:28 ` David Ponce via Bug reports for GNU Emacs, the Swiss army knife of text editors
2025-01-08 13:59 ` Mauro Aranda
2025-01-09 7:07 ` Eli Zaretskii
2025-01-09 9:10 ` Mauro Aranda
2025-01-09 10:01 ` David Ponce via Bug reports for GNU Emacs, the Swiss army knife of text editors
2025-01-09 14:35 ` Eli Zaretskii
2025-01-09 14:52 ` David Ponce via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-14 9:52 ` Eli Zaretskii
2024-09-14 9:51 ` Eli Zaretskii
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.