unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Christian Johansson <christian@cvj.se>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: I want to add a package to GNU ELPA: infix-notation-calculator
Date: Tue, 17 Aug 2021 09:32:37 +0200	[thread overview]
Message-ID: <90971c32-68c7-f59e-c426-ef0ecc5af0d0@cvj.se> (raw)
In-Reply-To: <jwv1r6txdk8.fsf-monnier+emacs@gnu.org>

Hi!

Sure, I think calc and calculator are more full-focused calculators that 
require a learning-curve, this plugin is more of an quick ad-hoc 
calculator that calculates values like (infix notation)

* 1+3*5
* 4 + 4.5 - (34/(8*3+-3))
* -56 + 2
* 3^2

So you can just select a region (regardless of mode) containing any 
expression like that and you will get the calculated result in the echo 
area and in the calculation log buffer.

You can also use the mode infix-notation-calculator-mode in a buffer to 
make calculations at chosen places in the buffer, so you can mix notes 
with calculations (like a spreadsheet but less advanced), example 
buffer-contents:
---

Morgage:
100000*0.05
=5000.0

Skates to my daughter:
6000+2000+1500
=9500.0

;; Some random notes here

Ratio:
4 + 4.5 - (34/(8*3+-3))
=6.880952380952381
---

Here the calculations are inserted automatically on the next line when 
pressing <C-return>. This is very handy I think when making everyday 
ad-hoc notes

Lastly you can calculate any input in the mini-buffer on demand

Hälsningar / Best Regards
Christian

On 17/08/2021 00:01, Stefan Monnier wrote:
> Christian Johansson [2021-08-16 23:14:27] wrote:
>
>> Hi!
>>
>> Here is the plugin:
>> https://github.com/cjohansson/emacs-infix-notation-calculator
>>
>> Features are:
>> * Calculate selected text
>> * Calculate input in minibuffer
>> * A calculate-mode where calculation of line is done automatically when
>>      pressing C-return
>> * A history buffer of all calculations
> Any chance you could expand a bit on what this does?
> The `README.md` and the `Commentary:` are both fairly limited, basically
> the only description of what it computes is given by the package's name.
>
> I think it needs some description of the format it accepts, and maybe
> a brief comparison with other Emacs calculators (such as the bundled
> `calc` and `calculator`).
>
>
>          Stefan
>
>



  reply	other threads:[~2021-08-17  7:32 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-16 21:14 I want to add a package to GNU ELPA: infix-notation-calculator Christian Johansson
2021-08-16 22:01 ` Stefan Monnier
2021-08-17  7:32   ` Christian Johansson [this message]
2021-08-17 11:01     ` Eric S Fraga
2021-08-17 11:20       ` Christian Johansson
2021-08-17 15:21         ` Eric S Fraga
2021-08-17 15:27           ` Christian Johansson
2021-08-17 15:54             ` Eric S Fraga
2021-08-17 16:55               ` Christian Johansson
2021-08-17 23:28     ` Stefan Monnier
2021-08-18  6:40       ` Michael Heerdegen
2021-08-18  9:03       ` Christian Johansson
2021-08-18 10:47         ` Eric S Fraga

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=90971c32-68c7-f59e-c426-ef0ecc5af0d0@cvj.se \
    --to=christian@cvj.se \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).