-
Notifications
You must be signed in to change notification settings - Fork 2
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
🎨 Option to highligh text without ANSI control sequences #131
Comments
Just wanted to add a note that this would be very useful for me. Narya now has a ProofGeneral mode which in general I'm quite happy with, but its error-reporting is less than ideal because the highlights are not visible. So often when I'm coding in ProofGeneral and I get an error, I have to switch back to the command-line to see the highlighted error that points out where in the line the error happened. I don't know how you were thinking of doing this. One obvious option is the usual sort of ASCII underlining:
But this only works in a monospace font, and I like to use variable-width fonts particularly for Unicode math characters. A fancier option would be to produce the output in some kind of markup language which any editor client could parse and display however it likes. Or is the proper way to do this with #107, or with the LSP package? |
@mikeshulman I'm not familiar with ProofGeneral. Does it put the output into a CompilationMode buffer so that |
No, it uses its own |
@mikeshulman In principle, I and a few other key developers do not like using column numbers, which are confusing. However, if that's the only way, so be it. The format that Emacs should definitely accept is the GNU coding standard on errors. |
Why would column numbers be better than markup? |
@mikeshulman I think markups are always better than column numbers, but I don't know whether ProofGeneral supports any. These are possible approaches, roughly from the best to the worst, in my opinion:
Reading the documentation more, I realized Emacs (correctly) sets the
@mikeshulman BTW, I'm surprised that your variable-width font display all digits ( |
I don't think PG supports markup directly, but I should be able to manage (2). Each prover already has its own derived modes, so I can try to turn on ansi color. Thanks for the suggestion. What gave you the impression that my font displays all digits with the same width? But actually, I have Emacs configured to use an ordinary monospace font for ordinary alphanumeric characters and a different variable-width font for fancier unicode characters. |
Wow, it works! Apparently ProofGeneral already has an (undocumented) configuration variable I did have to use |
Because I believe the outcome would be horrible otherwise. It seems your sophisticated setting avoided all the trouble. 😁
It's just on the general principle that a program should not unconditionally force ANSI coloring. Narya might be one day used in an environment that really does not support ANSI coloring. (For example, maybe someone redirects its output to a file etc.) One common strategy is to implement the |
Oh, Narya already has a special |
@mikeshulman That sounds like a very reasonable approach! |
This is mostly solved by #175 that (1) uses French double quotation marks for ranges when ANSI is disabled, by default, and (2) allows library users to decide whatever quotation marks to use. I'm thus closing this issue. |
No description provided.
The text was updated successfully, but these errors were encountered: