[RFC] Use emoji to indicate errors and warnings
Kévin Le Gouguec
legouguec@adacore.com
Fri Jan 10 17:25:43 GMT 2025
Tom Tromey <tromey@adacore.com> writes:
> This patch adds, at long last, some emoji output to gdb. In
> particular, warnings are indicated with the warning sign, and errors
> with the police car light.
>
> Perhaps this kind of thing should be configurable.
I rather like the way Emacs's icons.el handles configuration, some of
which might be applicable to GDB?
* "Icons" are defined as a reference name + a set of alternative
presentations:
(define-icon outline-open nil
'((image "outline-open.svg" "outline-open.pbm" :height (0.8 . em))
(emoji "🔽")
(symbol " ▼ ")
(text " open "))
"Icon used for buttons for opened sections in outline buffers."
…)
* Users express their preferred presentation by setting the
icon-preference user option.
(defcustom icon-preference '(image emoji symbol text)
"List of icon types to use, in order of preference.
Emacs will choose the icon of the highest preference possible
on the current display, and \"degrade\" gracefully to an icon
type that's available."
…)
* The rest of the codebase then invokes (icon-string 'outline-open) to
get the correct "string" to insert ("string" in quotes because of the
'image representation).
The "\n⚠️ warning: " example in your patch makes me wonder whether
"emoji+text" should be an option too in that scheme. (That would
probably help the folks who report confusion with Emacs's choice of "⛔"
for warnings-suppress…)
(No thoughts on what the default presentation should be - beside
agreeing with Guinevere's assessment that experienced users stand a
better chance of reaching for a knob to turn emoji off, than novices are
to be on the lookout for a knob to turn them on)
> Also it should probably be dependent on whether the current encoding
> is UTF-8 compatible.
>
> Anyway, looking for feedback.
More information about the Gdb-patches
mailing list