From: Thierry Volpiatto <thierry.volpiatto@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Quick math calc on any buffer
Date: Sat, 21 Feb 2009 20:50:45 +0100 [thread overview]
Message-ID: <87ljrzpo16.fsf@tux.homenetwork> (raw)
In-Reply-To: AvCdndxnys-4zD3UnZ2dnUVZ_jqWnZ2d@sysmatrix.net
"B. T. Raven" <nihil@nihilo.net> writes:
> 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-<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.
Also,
C-u M-x eshell-command RET (+ 2 3) RET
will insert the result (5) at point in current buffer.
--
A + Thierry Volpiatto
Location: Saint-Cyr-Sur-Mer - France
next prev parent reply other threads:[~2009-02-21 19:50 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <mailman.1378.1235234577.31690.help-gnu-emacs@gnu.org>
2009-02-21 19:08 ` Quick math calc on any buffer B. T. Raven
2009-02-21 19:50 ` Thierry Volpiatto [this message]
2009-02-21 22:53 ` Marc Tfardy
2009-02-21 23:37 ` Richard Riley
2009-02-22 12:45 ` Scott Frazer
2009-02-22 14:30 ` Rodrigo Lazo
2009-02-22 17:16 ` Marc Tfardy
2009-02-24 23:20 ` Chetan
2009-02-24 23:29 ` Marc Tfardy
2009-02-25 0:22 ` Chetan
2009-02-24 15:25 Xavier Maillard
-- strict thread matches above, loose matches on Subject: below --
2009-02-21 16:42 Rodrigo Lazo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87ljrzpo16.fsf@tux.homenetwork \
--to=thierry.volpiatto@gmail.com \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.