From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Richard Riley Newsgroups: gmane.emacs.help Subject: Re: Quick math calc on any buffer Date: Sun, 22 Feb 2009 00:37:07 +0100 Organization: A noiseless patient Spider Message-ID: References: <70bev5F87qbU1@mid.individual.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1235259696 21494 80.91.229.12 (21 Feb 2009 23:41:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 21 Feb 2009 23:41:36 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Feb 22 00:42:51 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Lb1Ug-0003xw-6o for geh-help-gnu-emacs@m.gmane.org; Sun, 22 Feb 2009 00:42:50 +0100 Original-Received: from localhost ([127.0.0.1]:50667 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lb1TL-0004xw-Sx for geh-help-gnu-emacs@m.gmane.org; Sat, 21 Feb 2009 18:41:27 -0500 Original-Path: news.stanford.edu!headwall.stanford.edu!newsfeed.news2me.com!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!newsfeed0.kamp.net!newsfeed.kamp.net!news.motzarella.org!motzarella.org!rileyrgdev.motzarella.org!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 46 Original-X-Trace: news.eternal-september.org U2FsdGVkX18qaM6HiKx7mGu4DH0K2cxvoGx7WpA3HVMDP6sZBLNGTTaXSQMQMUkTu/cZUvVJ4oJ14gUE9B8W3yerWaQ73CbAg+ljN+fdENOwwfISNCk+UDgonS3MAxxRft5t8YHcYKYAvVu6L7h7Pg== Original-X-Complaints-To: Please send complaints to abuse@motzarella.org with full headers Original-NNTP-Posting-Date: Sat, 21 Feb 2009 23:37:01 +0000 (UTC) X-Auth-Sender: U2FsdGVkX18uDWqshr2vk+/yA0STlAq0vdnc5hn+UF9ISdlZEwhT9A== Cancel-Lock: sha1:4bsWM+jlt+Q2UWnSzf62msNhLvk= User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.90 (gnu/linux) Original-Xref: news.stanford.edu gnu.emacs.help:166946 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:62254 Archived-At: Marc Tfardy writes: > 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 > > You might consider using "anything". There is a plugin "anything-c-source-calculation-result". http://www.emacswiki.org/emacs/Anything http://www.emacswiki.org/emacs-en/init-anything.el -- important and urgent problems of the technology of today are no longer the satisfactions of the primary needs or of archetypal wishes, but the reparation of the evils and damages by the technology of yesterday. ~Dennis Gabor, Innovations: Scientific, Technological and Social, 1970