I always have been using em-dashes with specific spacing:
1. replacing parentheses —given that the em-dash in pairs for me mark more-relevant-to-the-main content than a parenthesized expression would— so I use the same spacing as `()`
2. replacing colon or just finishing the sentence with a subsentence— so the spacing goes like for a colon.
Probably unfounded grammatically and against any style guides, but this spacing makes sense to me.
And some time later, someone shouts “72!” Everyone chuckles except from the one in the corner cell, who laughs so loud and for so long people think he'll have a heart attack. When eventually he stops laughing, someone yells: “Hey Fred, why did you laugh so much?”
“I'd never heard that one!”
Ah yes, that often amuses me too .. I've gotten the Orics "Ready" prompt burned into my eyeballs after all these years, to see the same thing in Cyrillic is kind of hilarious and triggers my inner hacker nerd every single time.
> Having had apps with YAML for config, and having had nightmares trying to copy/paste config directives from various sources, I just find whitespace to be unwieldy.
Convert your YaML into JSON and save it in your YaML file. There is probably an online converter, but writing one in your language of choice should be less than ten lines of code.
Do the same YaML→JSON for the “source” configuration you want to copy from, and copy-paste the parts you want. Leave them as JSON.
Complaining about Python's significant whitespace, I get it. I don't mind it personally, but it's obligatory and you can't overcome it (unless you do `coding: with_braces` tricks, of course). But why one would complain about YaML's whitespace? It is not obligatory.
> But why one would complain about YaML's whitespace? It is not obligatory.
The problem (as felt by me and also as identified by the person you replied to) is that you can't copy-paste/munge some stuff into the right spot and then just let the formatter to fix the indentation. It's not a problem that the format "at rest" has whatever certain indentation to be correct, its that while being actively editing your formatter cannot automatically set the correct indentation.
The flow that you're talking about of converting yaml to json and then putting it into yaml could work in some cases but thats very much a kludge. It will have numerous bad side effects unavoidable, including that it would discard comments in the middle since JSON doesn't allow for comments at all, theres no timestamps in JSON, there's no octal numbers, etc.
> The problem (as felt by me and also as identified by the person you replied to) is that you can't copy-paste/munge some stuff into the right spot and then just let the formatter to fix the indentation.
That problem I undestand, and that is why I suggested to convert both into JSON —or YaML with default_flow_style=True which would preserve datetimes and other non-JSON stuff— and copy-paste without the hassle of having to indent/unindent correctly. Of course that doesn't help with copying comments. That would need extra copy-paste operations, but still one hasn't the hassle of significant whitespace. The following is also valid YaML:
{"some_key": {
"attr1":
# an intermittent comment
"val1", "attr2": 12312 # more comments!
}
}
My gripe with json is the lack of support for comments. Whenever I come across a config file that has comments about what the config line(s) mean, I am so grateful.
Whenever I come across a json config file, I kind of despair a little and start poking at the code in hopes there are comments about what the config means.
I totally agree with your gripe about JSON's lack of comments. There were people AFAIK who tried to write a spec with comments (and maybe dangling commas? was it called JSON5?) but by then it probably was too late.
My biggest issue with JSON5 is as far as I'm aware, if you update settings programmatically, you tend to lose comments... not sure of any implementation that preserves them.
Ctrl-Shift-C/V/X are not implemented in bash; it's the terminal emulator program that handles these. So the default terminal emulator of Ubuntu (gnome-terminal I assume, but ICBW) knows about a “system” clipboard and copies stuff to it and on paste feeds bash with the copied data. If you press Ctrl-Alt-F1 (and F2, F3, depends on your distribution's defaults) you can login and in your login shell, which I understand is bash, Ctrl-Shift-C/V/X have no difference to shiftless Ctrl-C/V/X.
When you press CTRL and a letter or symbol at the terminal, shift doesn't do anything (unless it's required for the symbol, as in CTRL-@). The code that gets sent is the same either way. Emacs users have to be wary when setting custom keybindings because GUI Emacs can see the difference but terminal Emacs can't.
Likewise, ALT just sends ESC assuming you're using the standard US keymap.
1. replacing parentheses —given that the em-dash in pairs for me mark more-relevant-to-the-main content than a parenthesized expression would— so I use the same spacing as `()`
2. replacing colon or just finishing the sentence with a subsentence— so the spacing goes like for a colon.
Probably unfounded grammatically and against any style guides, but this spacing makes sense to me.