From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Scott Frazer Newsgroups: gmane.emacs.help Subject: Re: Quick math calc on any buffer Date: Sun, 22 Feb 2009 04:45:57 -0800 (PST) Organization: http://groups.google.com Message-ID: <866ac838-c9b2-4507-acca-08df9ddf5b94@l1g2000yqj.googlegroups.com> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1235310076 30255 80.91.229.12 (22 Feb 2009 13:41:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 22 Feb 2009 13:41:16 +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 14:42:30 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 1LbEbA-0000xo-HV for geh-help-gnu-emacs@m.gmane.org; Sun, 22 Feb 2009 14:42:24 +0100 Original-Received: from localhost ([127.0.0.1]:49497 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LbEZq-0000Ra-4w for geh-help-gnu-emacs@m.gmane.org; Sun, 22 Feb 2009 08:41:02 -0500 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!l1g2000yqj.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 19 Original-NNTP-Posting-Host: 71.70.208.214 Original-X-Trace: posting.google.com 1235306757 5462 127.0.0.1 (22 Feb 2009 12:45:57 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Sun, 22 Feb 2009 12:45:57 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: l1g2000yqj.googlegroups.com; posting-host=71.70.208.214; posting-account=mTP6TAoAAADeO2EO3QMjJrmUPGLwlQy3 User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.0.6) Gecko/2009011912 Firefox/3.0.6,gzip(gfe),gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:166955 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:62263 Archived-At: On Feb 21, 11:42=A0am, 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 =3D 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. > (defun my-calc-result (beg end) (interactive "r") (insert " =3D " (calc-eval (buffer-substring beg end))))