This seems so obvious that I feel sure that I've just missed something in the manual. I frequently do a calculation and then want to use that calculation elsewhere. But let's say my stack is currently:
--- Emacs Calculator Mode ---
1: 42
.
Any way I've tried to copy the value 42
with incantations of M-w
, what I get when I yank is
1: 42
including the newline.
The manual says
Although a whole line is always deleted, C-k with no argument copies only the number itself into the kill ring, whereas C-k with a prefix argument of 1 copies the number with its trailing newline.
but that only works with C-k
, weirdly, not with M-w
(though otherwise the commands respond to arguments similarly), and still, that doesn't solve my problem, as I still get the stack number.
Amazingly, even moving the cursor, setting mark on 4
and point after 2
to set a region (which is highlighted, making me think this should work) doesn't get my the value: it still gives me the entire line.
I know about M-x quick-calc
, which lets me enter an algebraic expression into the minibuffer whose result is placed into the kill ring, but that's not helpful if I'm doing a complex calculation or simply want to use the normal Calc RPN interface. (While there are methods described about how to move a quick-calc
result into the calculator stack, I don't see a way to gain access to the stack from quick-calc
. $1
, etc., refer to prior results of quick-calc
instead.)
calc-copy-to-buffer
is bound conveniently to y
, but I often want to use the result in the minibuffer or even in another program via kill-ring/clipboard integration, so this isn't a solution, either.
Of course I can yank or copy to a buffer and then edit the result and re-kill the edited result, but I do this so frequently and again, it seems like such an obvious use case that I really think I'm just missing something.
(I know there are Orgmode and database solutions for bulk transfer of Calc data, but I just want a single value to yank; it shouldn't be that hard.)