help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Quick math calc on any buffer


From: Marc Tfardy
Subject: Re: Quick math calc on any buffer
Date: Sat, 21 Feb 2009 23:53:25 +0100
User-agent: Thunderbird 2.0.0.19 (Windows/20081209)

Rodrigo Lazo schrieb:
Hi all,

Is there a way to compute a math expression on any buffer? I mean, if I
have a buffer with the following expression

2 + 3
I want to mark the region and compute the result

2 + 3 = 5

It doesn't seems too hard to do, I've looked on calculator.el for a
"computing" function I can call but I didn't find it.

Try with embeded mode of calc: C-x * E (no need to mark the region)
and similar commands (J or W in place of E). You need to type C-x * E
again to exit the embeded mode.


Another solution:

 - mark the region with math expression and put it into kill-ring (M-w)
 - type SPC = SPC
 - run the calc (C-x * c)
 - type ' (apostrophe) and yank yor math expression (C-y)
 - type RET
 - type y (or C-x * y) to copy the result into buffer
 - exit calc (q)


regards
marc




reply via email to

[Prev in Thread] Current Thread [Next in Thread]