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: Thierry Volpiatto
Subject: Re: Quick math calc on any buffer
Date: Sat, 21 Feb 2009 20:50:45 +0100
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.90 (gnu/linux)

"B. T. Raven" <nihil@nihilo.net> writes:

> Rodrigo Lazo wrote:
>> 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. 
>>
>> Regards
>>
>
> Bind the calculator-save-and-quit function to a key-chord. I use
> C-<enter>. Then the same combo will copy result to kill-ring and exit
> (that is, kill calc buffer). C-y will paste result into buffer from
> which the calculator was invoked. If you don't like this solution, you
> can open a line in a buffer in any mode and then evaluate the lisp
> expression on that line
>
> (+ 2 3) C-x C-e
>
> shows 5 in the mini-buffer.
Also, 

C-u M-x eshell-command RET (+ 2 3) RET

will insert the result (5) at point in current buffer.

-- 
A + Thierry Volpiatto
Location: Saint-Cyr-Sur-Mer - France





reply via email to

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