1. 2

    I love emacs cals and use it a lot, but it does not seem to have programmers in mind. Maybe that can be fixed, though.

    I often have to paste hexadecimal numbers (often addresses) and perform some operations on them. First, to reliably do so, this requires me to go into algebraic mode (’) and paste the number into the modeline. Then, calc does not recognize the now ubiquitous 0x prefix, wanting me to replace it with its “16#…” prefix instead. Same with binary (0b…/2#…).

    Finally, I don’t remember the keyboard commands that I often need well (shift left/right, binary AND, OR, NOT…), but I guess I would get used to them if the previous problems were not happening.

    Instead, I now mostly just fire up the python repl, where I can paste the numbers prefixed with 0x into anywhere in the terminal, and directly type in stuff like “(0xf00f1234 >> 20) & 0xffffffffc”.

    1. 3

      If you turn on the C mode (calc-c-language, d C) you can enter hexadecimal numbers in the algebraic entry that start with 0x, btw. I guess that this could be patched so that entering 0x with calc-c-language turn on would real a hexadecimal number…

      1. 2

        The existence of calc-c-language is a revelation already. I will revisit now that I know it exists, thanks.