From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tim Visher Newsgroups: gmane.emacs.help Subject: Re: calc-embedded keep equation Date: Wed, 5 Feb 2014 08:17:01 -0500 Message-ID: References: <87ha8d3o4x.fsf@bye.fritz.box> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1391606274 31750 80.91.229.3 (5 Feb 2014 13:17:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 5 Feb 2014 13:17:54 +0000 (UTC) Cc: emacs To: henry atting Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Feb 05 14:18:03 2014 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WB2Ma-00022H-AP for geh-help-gnu-emacs@m.gmane.org; Wed, 05 Feb 2014 14:18:00 +0100 Original-Received: from localhost ([::1]:59183 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WB2MZ-00022w-NQ for geh-help-gnu-emacs@m.gmane.org; Wed, 05 Feb 2014 08:17:59 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33546) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WB2MN-00022n-O0 for help-gnu-emacs@gnu.org; Wed, 05 Feb 2014 08:17:49 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WB2MI-0000cs-2F for help-gnu-emacs@gnu.org; Wed, 05 Feb 2014 08:17:47 -0500 Original-Received: from mail-qc0-x22c.google.com ([2607:f8b0:400d:c01::22c]:42280) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WB2MH-0000cm-UC for help-gnu-emacs@gnu.org; Wed, 05 Feb 2014 08:17:41 -0500 Original-Received: by mail-qc0-f172.google.com with SMTP id c9so542321qcz.31 for ; Wed, 05 Feb 2014 05:17:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=a9noAAJ3zFe1ijrfJhgFpD0TwkZ+ssXlNusbwPNHxJg=; b=E2FJfC8XPQ0SA7XlAz0GAKUgXvKhPFmmRP2arj/1DUM2+/YC0mZ6lTdHgNmisHM8BI lbpwg0zaIwiEAER+EbanJFGDWbYizMv74iCYu0ieLEsMfU1I788T3AE6KtwJ4/lXzMrz y0t8dosRYfwfgeKMca3HHw112sGIuz75WWv4TEDfZjbXEPfagyji6KmSD84OAxLCOFxs JKlMnj7/hH9ViSCKkXsNpMDWeEI5jwRo29gcboNi8nlYvFlJqrd25DOQstkEohSDxxaq TKbPPtbwPI361Ho+rKxQIk5LI0orzVrBFCDdliNPrGHHMpKIBXN0E9XX/o50fURa4KCY xivw== X-Received: by 10.224.167.19 with SMTP id o19mr2229116qay.77.1391606261343; Wed, 05 Feb 2014 05:17:41 -0800 (PST) Original-Received: by 10.140.97.228 with HTTP; Wed, 5 Feb 2014 05:17:01 -0800 (PST) In-Reply-To: <87ha8d3o4x.fsf@bye.fritz.box> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400d:c01::22c X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:95926 Archived-At: On Wed, Feb 5, 2014 at 4:27 AM, henry atting wrote: > Say I have an expression like > > 2 + 2 > > I let calcutate it with calc-embedded > > 4 > > The expression is replaced by the solution. > > Is it possible to keep the whole equation, something like > > 2 + 2 = 4 > > ? (defun replace-with-solved-equation (start-of-equation end-of-equation) (interactive "r") (if (not (region-active-p)) (error "Requires an active region")) (let ((equation-string (buffer-substring start-of-equation end-of-equation))) (calc-embedded nil) (calc-embedded nil) (save-excursion (goto-char start-of-equation) (insert equation-string " = ")))) -- In Christ, Timmy V. http://blog.twonegatives.com/ http://five.sentenc.es/ -- Spend less time on mail