Isn’t that what emacs -f full-calc is for? https://www.gnu.org/software/emacs/manual//html_node/calc/Standalone-Operation.html
emacs -f full-calc
That’s how this started – but it launched very slowly without -Q, but then it launched with a lot of unnecessary UI, so I had to add Emacs Lisp to disable some UI modes, and then I discovered some platform inconsistencies… and so on.
But the primary reason to create this script is actually to massage calc-mode into being slightly more user-friendly for non-Emacs users.
full-calc is what the script is calling, after some setup.
I don’t think full-calc has a postfix mode. Postfix can be useful for incremental calculations.
If RPN’s what you’re after, I’ve also used and quite liked qalculate in RPN mode, which has a nice GTK+ interface.
While it might not be the best, xcalc -rpn is also relatively nice (especially with the Debian Xresources).
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”.
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…
The existence of calc-c-language is a revelation already. I will revisit now that I know it exists, thanks.
[Comment removed by author]
This is an interesting comment, but I’m not sure it belongs here. Perhaps it should be its own post.