What do colour codes mean in Isabelle/jEdit? - isabelle

What do the colour codes mean in Isabelle/jEdit? I could not find their description in the Isabelle/jEdit manual. The only thing it writes is
Prover feedback works via colors, boxes, squiggly underline, hyper-
links, popup windows, icons, clickable output — all based on semantic
markup produced by Isabelle in the background.
Colours are used as proof script background and on a vertical bar beside the scrollbar.
Could you point to some documentation or explain it here?

You can see their names and change them in "Plugins/Plugin Options" and then "Isabelle/Rendering". The names give a relatively clear explanation, and you can refer to the manuals from the terms used in the names.
There is a lot of colors so I won't describe them all.
For the most important default colors:
Logic:
blue : free variable
green : bound variable
orange : skolem constant ("free" variables existentially "quantified")
cyan : syntax (not a variable or a constant, like case or if)
Isar Keywords:
sky blue : commands (like lemma, proof or have)
red : tactic-style commands (like apply, done or prefer)
turquoise : statements (like where, fixes, shows or and)
Messages highlighting in output:
red : error
yellow : warning
light blue : info
Highlighting in editor:
red : error
light yellow : current line
gray : quoted text (logic and types)
light gray : comment and formal text (introduced with text or section)
purple : running process on the command (also shown on the right)
pink : unprocessed (outdated) command (also shown on the right)
In general, an underlined command displays a message in the output (possibly associated with an icon and a box on the right). More specifically:
Icons, [boxes] and {in text}:
red exclamation mark [red box] {squiggly red underline} : error
orange exclamation mark [orange box] {squiggly orange underline} : warning
blue i {squiggly blue underline}: information (often provided by automatic tools)
{squiggly gray underline} : the command shows a message in the output
{red text} : comment (like (* This is a comment *))

Related

Testkitchen / KitchenCI - How to change console output colors?

In the present case Ansible is used with KitchenCI/Testkitchen.
Question: How can I control the color of the kitchen output?
I tried different coloroptions in ansible but for kitchen I didn't find any options, but this bugs me, especially if the color of the kitchenoutput turns darkblue suddenly.
Problem:
The color of the kitchen-output changes, depending on ...I don't know...
(It doesn't change every run, but at some time, something initiates the colorchange and then it will keep the color for a while)
Sometimes it's an ugly pink:
Sometimes it's yellow, green or cyan:
... But most annoyingly, if it's darkblue, suddenly, and I can't read stuff:
Setup: i3, xfce4-terminal, zsh, sometimes in tmux, with echo $TERM # -> screen-256color
I think, if something in the folderstructure change, or something in the current ansible environment (the shell-options are always the same), e.g. if I clone the whole directory (at least thats where I recognized it last time). It can even be a different color if I change the directory in the "roles" directory. But all in all I can't point my finger at it and I would be glad for help.
If more Information is needed, I would gladly provide it.
Update:
Maybe it's something in ~/.rvm/gems/ruby-2.5.1/gems/...
Theres a lot of code regarding "tty"
This does not answer the question (that's still interesting! because I don't want the color to change), but targets the underlying problem, meaning the non-readablitity of the blue color.
The reason was the configuration of "xfce4-terminal".
In xfce4-terminal one can define the representation for colors in the right-click: 'preferences' > 'colors' > 'Palette'
If a background-color is set, that would conflict with the color "blue" (dark blue), the representation for the color "blue" can be change (e.g. to grey, or light blue, or everything else).
See the screenshot:

How do I set representations properly in .vmdrc for VMD

I'm trying to setup default representations on load, and currently have added the following to the default .vmdrc file.
display depthcue off
color Display Background white
display projection orthographic
mol default color {index}
mol default style {CPK 1.0 12 0.3 12}
mol default selection {all}
menu main move 62 1236
menu graphics move 166 1477
I have also tried this line:
mol default style CPK
And variations on the selection command, such as {name A}, since I'm using hoomd and A type particles, but all to no avail, it ignores the representation style and color settings no matter what I do, but the other settings work just fine. Anyone able to help me figure out why? Thanks.
This is due to the molecule not being read into vmd upon startup (at the time of your .vmdrc file being read). I suspect you start vmd from command line with "vmd molecule.file" rather than opening up vmd first, then loading in the molecule from the File > New Molecule tab. If you do it the former way, then your "mol" instructions in the .vmdrc file are being applied to a non-existent molecule. The latter should work with the commands you've provided.
See here for how to get these defaults working for you with a command line startup.

Syntax highlighting support for Julia in Nano

I use the minimal Nano text editor quite frequently. Recently, I've began to experiment with the young Julia programming language, but found that the .ji extension does not trigger appropriate highlighting in the editor environment as it does for recognized languages like Python.
Does syntax highlighting support exist for Julia x Nano? If it does not, how could I go about adding syntax highlighting support for a new language to Nano? Is there a standard template for each language?
Quoting Matt B.'s comment, see Google's top result for nano julia syntax is this reddit thread.
Just copy and paste this into your .nanorc (typically located in ~/.nanorc):
syntax "julia" "\.jl$"
color brightblack "\<(begin|break|catch|continue|function|elseif|else|end)\>"
color brightblack "\<(finally|for|global|local|if|include|using|require|macro)\>"
color brightblack "\<(println|return|try|type|while|module)\>"
color brightblue "[A-Za-z_][A-Za-z0-9_]*[[:space:]]*[(]"
color white "[(]"
color red "[-+*/|=%<>&~^]|\<(and|not|or|is|in)\>"
color brightyellow "#[A-Za-z0-9_]+"
color brightmagenta "__[A-Za-z0-9_]+__"
color brightcyan "\<(true|false)\>"
color yellow ""(\\.|[^"])*"|'(\\.|[^'])*'"
color yellow "['][^']*[^\\][']" "[']{3}.*[^\\][']{3}"
color yellow "["][^"]*[^\\]["]" "["]{3}.*[^\\]["]{3}"
color yellow start=""""[^"]" end="""""
color yellow start="'''[^']" end="'''"
color magenta "\\.?"
color cyan "(^|[[:space:]])#([^{].*)?$"
color brightwhite,cyan "TODO:?"
See https://github.com/Naereen/nanorc/blob/master/julia.nanorc for an updated version.

256 colors in zsh-syntax-highlighting?

OK, so I'm using this little fancy cutting edge technology called zsh-syntax-highlighting and although I'm overall happy with the result I don't know how to set styles to anything but 8 basic colors (black, red, green, yellow, blue, magenta, cyan, white), e.g.
#works
ZSH_HIGHLIGHT_STYLES[path]='fg=red'
ZSH_HIGHLIGHT_STYLES[path]='fg=1'
#doesn't work
ZSH_HIGHLIGHT_STYLES[path]='fg=31m'
ZSH_HIGHLIGHT_STYLES[path]='fg=\e[31m'
ZSH_HIGHLIGHT_STYLES[path]='fg=%{\e[31m%}'
ZSH_HIGHLIGHT_STYLES[path]='31m'
ZSH_HIGHLIGHT_STYLES[path]='\e[31m'
ZSH_HIGHLIGHT_STYLES[path]='%{\e[31m%}'
ZSH_HIGHLIGHT_STYLES[path]='%{\e[1;38;5;118m%}'
So, how do I set more fancy colors for this zshzle plugin?
As you pointed out in the comment to chepner answer terminator is a fork of gnome-terminal and it still uses a lot of functions from gnome. In fact it seems that the whole terminator VTE widget comes from gnome and gnome-terminal by defaults "supports" only 8 basic colors. You can check that with echotc Co command. It will return 8 for both of them and for xterm too (although in xterm case this is true and only 8 colors), so basically all 3 terminal emulators you tried so far.
Now, you noted that teminator (and gnome-terminal) can in fact display more colors, but this is only because it more or less processes all those special color codes without paying attention to TERM settings what does not obey standards but well, this is gnome. Anyway to make long story short you need to set TERM environment variable to something like xterm-256color and check again with echotc Co - you should now see 256, and your ZSH_HIGHLIGHT_STYLES[path]='fg=217' should work as well.
To always start with 256 colors you can put into you .zshrc
[[ "$TERM" == "xterm" ]] && export TERM=xterm-256color
and if you have any gnome shortcuts with terminator then change them as follows
terminator -e "TERM=xterm-256color pine"
http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Character-Highlighting suggests that the value for fg be a single integer from 0 to 255:
ZSH_HIGHLIGHT_STYLES[path]='fg=167' # Whatever color 167 is in the 256-color palette.
I Notice you are using [path], it could be that a custom path with it's own color setting is interfering with your highlight setting. Try testing with a different item such as [command]:
ZSH_HIGHLIGHT_STYLES[command]='fg=222'
I tried the above line and it works for me. I tried using the same value for path already knowing my custom prompt has its own colors and my prompts custom colors won out over the highlight.
I use a ZSH helper called Oh-My-ZSH so the following may be a bit different or not apply to you:
Make sure you are changing the color definition after the highlight plugin is loaded. On my setup it will actually generate an error but since I only tested on my syetem (OSX10,9, ZSH 5.0.7, Oh-My-ZSH, iTerm v2) your experience may be different.
Doesn't work:
ZSH_HIGHLIGHT_STYLES[command]='fg=222'
...
plugins=(git osx jim colorize zsh-syntax-highlighting)
Does work:
plugins=(git osx jim colorize zsh-syntax-highlighting)
...
ZSH_HIGHLIGHT_STYLES[command]='fg=222'

QMessageBox warning yellow exclamation mark icon

How is possible to display a QMessageBox::warning with the triangular exclamation mark symbol like the one following?
I can't find any option in QMessageBox::warning, I only get the red circular symbol.
The triangular icon should be the default for the QMessageBox::warning dialog, while the red circular one is the default for the QMessageBox::critical dialog.
In my python code I use either
QMessageBox.warning(None,QString("..."),QString("...."))
or the more complex
msg = "..."
q = QMessageBox(QMessageBox.Warning, "...", QString(msg))
q.setStandardButtons(QMessageBox.Ok);
i = QIcon()
i.addPixmap(QPixmap("..."), QIcon.Normal)
q.setWindowIcon(i)
q.exec_()
And both of them works well.
Eventually can you show the code you use to show the dialog ?
You can use the QMessageBox.setIcon() function to configure which symbol you see when the dialog is displayed.
The predefined icon property types are listed here: https://doc.qt.io/qt-5/qmessagebox.html#severity-levels-and-the-icon-and-pixmap-properties
Here is my C++ example of a message box with the yellow triangle icon:
QMessageBox msgWarning;
msgWarning.setText("WARNING!\nRunning low on coffee.");
msgWarning.setIcon(QMessageBox::Warning);
msgWarning.setWindowTitle("Caution");
msgWarning.exec();
And here is my C++ example of a message box with the red circle icon:
QMessageBox msgError;
msgError.setText("CRITICAL ERROR!\nThe McRib is no longer available!");
msgError.setIcon(QMessageBox::Critical);
msgError.setWindowTitle("Danger");
msgError.exec();

Resources