What does HackerNews think of xcompose?

for sharing .XCompose keybindings

Language: Emacs Lisp

it sums products, but convolution is summing products in a particular way that is not general matrix multipication

i typed special characters with the compose key; cf. https://github.com/kragen/xcompose

not as easy as latex but more compatible

Another possible solution is to define a compose key (I use SysRq) to type characters not on the keyboard, such that (for example) the three-key sequence "SysRq . Z" is Ż.

Here's the XCompose file I use:

https://github.com/kragen/xcompose

Consistent cmd+x/c/v is great.

I've tried replicating this experience in Linux in many different ways over the years, but the best approach was to add `altwin(ctrl_alt_win)` to xkeyboard preferences together with custom `ctrl_space_toggle` for layout toggle. It achieves almost the same effect as Kinto without an additional daemon: physical Alt maps to Ctrl (Cmd in terms of Mac layout), Ctrl works as Super and Super/Win works as Alt — the closest, I think, to Apple keyboard layout. It event works fine in Wayland (sway).

Considering the terminal, remap your favorite terminal emulator to send control codes via Super+A..Z (physical Ctrl+A..Z), and unmap/remap to the required action Ctrl+A..Z (physical "Cmd"+A..Z). It works fine in Konsole and great in Alacritty. (unfortunately, I also have to add a second set of mappings for my native non-latin keyboard layout, because at toolkit-level keys are translated to latin layout, but remapping works only for a single layout).

Of course, it's only a half of the equation. Another part is Option/Compose. On Mac I used MathUnicode.keylayout. It was great, and it was a pleasure to tweak it for my needs. Xkeyboard with .XCompose (e.g. [1]) has two disadvantages: you can't use a key as both Multi key and e.g. Alt modifier simultaneously, and you don't see the composition preview. On Lenovo at least you can use `compose(prsc)` to make your left Win key an «Option-modifier» and its right PrtSc counterpart an «Option-compose». [1]: https://github.com/kragen/xcompose

Maybe one day I will buy another Mac... but shall we prefer comfort to freedom?

> TODO: figure out a reliable way to add new sequences to fill in the gaps

You can do that with an .XCompose file in your home directory. See https://github.com/kragen/xcompose for more info.

That's right. I'm sorry I didn't post the correct name in the first place; I don't have https://github.com/kragen/xcompose set up on my hand computer (because it doesn't run X).
> If the Linux compose key supported more of the common mathematical symbols,

Google '.xcompose github' (without quotes) and see what you come up with. I use this one, myself:

https://github.com/kragen/xcompose

but there are a lot of others.

The most legitimate use for this is for top-level namespaces, which need to be short or they'll junk up your code like crazy. jQuery already took $, and Underscore took _. Maybe , , _, , , , (not , that's illegal!), , , , , , , , , , , , or as mentioned below, ? is probably too obnoxious though.

For no particularly good reason, and are illegal. I think the Plan9 strategy of considering non-ASCII characters as identifier characters by default is probably a better one than changing the language grammar every time the Unicode standard revs.

(As mentioned in another comment, http://canonical.org/~kragen/setting-up-keyboard.html https://github.com/kragen/xcompose. The Chinese I copied and pasted from http://www.mdbg.net/chindict/chindict.php?page=radicals though.)

If the variable name is Chinese, use an appropriate input method. Otherwise, maybe set up your keyboard with a compose key (and lowercase parens) http://canonical.org/~kragen/setting-up-keyboard.html and possibly install a bigger XCompose map so you can type Greek letters conveniently https://github.com/kragen/xcompose.
I have compoſe-f-s as the key combination for long s in my .xcompoſe file: https://github.com/kragen/xcompose. You, too, can compoſe miſsives uſing our dear antiquated friend, ſhould you ſo deſire.