-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stop using ASCII quotation marks in compiler messages #11127
Comments
Not sure about unicode quotation marks:
Here one option would be to simply use parentheses: |
I don't think it's a good idea to stop quoting. I think it's good to stop doing `…' which is nowadays ugly (it used not to be the case, as mentioned in the link above). Since the compiler has access to Unicode quotes are an option, broadly I don't think they would pose problem see the discussion here, but that's the kind of change you only really get to know it was problematic after you made it and people start showing up on your issue tracker… |
I like the idea of using bold! We also had an issue for using bold and/or colors in type error messages, #10321. If anyone is interested in improving this topic, I would suggest sending a PR that uses bold when applicable/possible, and keeps the current ASCII quoting otherwise. This is the most likely to be uncontroversial and get merged, and then we can have discussions on even better proposals turned into further PRs. |
There is no strong need to quote identifiers in error messages. Many OCaml error messages don't do it and it's fine:
But I agree it would be even nicer if ASCII double quotes are barely acceptable:
Other ASCII options are just awful:
If Unicode is available, French guillemets win:
But, again, quotes aren't really needed, even more so if bold or color are used. |
Can we please keep accessibility in mind while discussing these matters? FWIW, neither colors nor bold, underline, italics are easily rendered in I am not very excited by unicode either because at the moment it is likely |
I believe that we have configuration tweaks to not use colors in the display. (This is done explicitly if the terminal is detected to be too primitive, but users can also set it explicitly.) In particular, colors should be disabled if the NO_COLOR environment variable is set ( see #10560 ). I would expect a good implementation of 'use colors instead of quotation marks' to revert to quotation marks in this case. That being said, I don't know what is the treatment of bold (currently we don't use bold without colors); I would consider it a color, but this is not completely obvious. |
I think that using bold for when colors are requested and single quotes when they are not is an accessible solution. |
"Colors" in the context of terminals means anything that uses ANSI terminal escape sequences (which includes bold) rather than plain text. |
Many thanks for your contribution, @gasche.
I just wanted to raise the question of what should be the default
behaviour. I do realise that one approach is to sue as defautl behaviour
the one that suits most people and it of course makes sense to do it
that way.
On the other hand, having something that is not accessible by default
and needing users to do configuration steps that may be obscure to them
also feels a bit suboptimal.
|
Daniel Bünzli (2022/10/25 08:38 -0700):
I think that using bold for when colors are requested and single
quotes when they are not is an accessible solution.
Somehow yes, maybe. Just that I don't know how obvious it is for users
how to disable colors in their environment. I also don't know how
portable the `NO_COLORS` variable is.
|
Usually people who do not want colors know that setting
There's no portability problem (unless your system doesn't support |
One important aspect to keep in mind is that we can start by adding a format style for @shindere : in term of accessibility, since OCaml error messages but also quite a few CLI commands use colored CLI output by default, I imagine that your settings is either filtering terminal escape sequences or is already set in a |
Daniel Bünzli (2022/10/26 07:23 -0700):
> I also don't know how portable the `NO_COLORS` variable is.
There's no portability problem (unless your system doesn't support
`getenv`).
Sorry, I meanst, how many programs actually take this variable into
account.
|
NO_COLOR is a sort of informal standard, see https://no-color.org/, which contains a long-ish list of software supporting it, and also many terminal libraries used by many other software. (I realize that we should add OCaml to this list.) |
Florian Angeletti (2022/10/26 07:31 -0700):
@shindere : in term of accessibility, since OCaml error messages but
also quite a few CLI commands use colored CLI output by default, I
imagine that your settings is either filtering terminal escape
sequences
Yes, merely they are ignored by brltty. Wellnot exactly ignored, rather,
not even seen because brltty looks at `/dev/vcsa` which only has the
characters (and the attributes, I think) because the escapbe sequences
have already been interpreted at this stage.
or is already set in a `TERM=dumb` or `NO_COLOR` mode.
I have `TERM=linux` on my machine, and nothing else with respect to
colors as far as environment variables are concerned. The only tool for
which I did need to disable colors is git, so in my `~/.gitconfig` I
have a `[color]` section with just one setting: `ui = off`.
Do you know which option is it?
I hope I replied to your question?
|
Oh! Thanks a lot for the link!
|
Ah that new In general the combination of cli switches ( But someone thought it was a good idea to add one more way for a reason that escapes me – it's pretty clear that this problem is being solved at the wrong level (i.e. your terminal emulator should be in charge of that problem). |
@shindere Thanks for your answer! Taking in account your settings, I have the impression we cannot rely on the Maybe in this case, we could use both double quotes and bold ("rec") except if colors were explicitly requested (with However, when quoting would be only a nicety, I think it is probably fine to use bold directly as a improvement for many users that doesn't impair readability for anyone. (If my memory is right @shindere when we discussed the issue previously the conclusion was that there was simply no real equivalent to this kind of quickly scanned text decoration on a braille terminal) |
You are indeed correct that there is nothing that would make it as easy
to scan a text in braille as it is when reading with eyes. One situation
where quoting may be useful is when the text is not just an identifier
but an expression with spaces etc. In this situations, quoting may be
helpfull. Also, I remember having thought at several occastions that I
found the idio `this expression` in error messages not that useful and
that I would have preferred `the expression` followed by the expression
itself.
|
I think that this issue was either solved or made irrelevant by #12210, which stopped using |
Hi!
I got this error message:
The fact that my variable ends with a single quote makes the error message look somewhat weird, since two single quotes follow each other. imho it looks ugly everywhere too (but who am I to judge, I often use emoji).
There is also a recent trend of removing the ASCII quotes
`…'
in favour of Unicode quotation marks. See ASCII and Unicode quotation marks for a comprehensive history of the question and rationale for the change.The text was updated successfully, but these errors were encountered: