|
From: | B. T. Raven |
Subject: | Re: Quick math calc on any buffer |
Date: | Sat, 21 Feb 2009 13:08:23 -0600 |
User-agent: | Thunderbird 2.0.0.19 (Windows/20081209) |
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 expression2 + 3I 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. Ed
[Prev in Thread] | Current Thread | [Next in Thread] |