From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "B. T. Raven" Newsgroups: gmane.emacs.help Subject: Re: Quick math calc on any buffer Date: Sat, 21 Feb 2009 13:08:23 -0600 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1235245297 15882 80.91.229.12 (21 Feb 2009 19:41:37 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 21 Feb 2009 19:41:37 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Feb 21 20:42:54 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 1LaxkR-00029C-5i for geh-help-gnu-emacs@m.gmane.org; Sat, 21 Feb 2009 20:42:51 +0100 Original-Received: from localhost ([127.0.0.1]:41298 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Laxj6-0003Rp-Km for geh-help-gnu-emacs@m.gmane.org; Sat, 21 Feb 2009 14:41:28 -0500 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!news1.google.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.sysmatrix.net!news.sysmatrix.net.POSTED!not-for-mail Original-NNTP-Posting-Date: Sat, 21 Feb 2009 13:08:21 -0600 User-Agent: Thunderbird 2.0.0.19 (Windows/20081209) Original-Newsgroups: gnu.emacs.help In-Reply-To: Original-Lines: 30 X-Usenet-Provider: http://www.giganews.com Original-NNTP-Posting-Host: 12.73.132.231 Original-X-Trace: sv3-tRgYthIAzpoRGGI56vJPVPFqiusYjq2FJPDK3CuVzew83mZd3bJnBeIZ9BFjITrD/44YYRluaz/w8oa!AW66dpd+wVtY7Q6lamXRGSQlZ4nyq1ECzZSY02mjc6w4TDcVybVJ3BYMkFMq7KdBdLeP2lWDToNb!+qel3SmGph5/TBHMoBJE7iKclIr69As= Original-X-Complaints-To: abuse@sysmatrix.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.39 Original-Xref: news.stanford.edu gnu.emacs.help:166938 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:62247 Archived-At: 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-. 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