File: calculator.el.html

A calculator for Emacs.

Why should you reach for your mouse to get xcalc (calc.exe, gcalc or whatever), when you have Emacs running already?

You can bind this to a key by adding this to your Init file:

  (keymap-global-set "C-<return>" #'calculator)

Written by Eli Barzilay, eli@barzilay.org

Defined variables (41)

calculator-2s-complementIf non-nil, show negative numbers in 2s complement in radix modes.
calculator-add-savedBound to t when a value should be added to the saved-list.
calculator-bind-escapeIf non-nil, set escape to exit the calculator.
calculator-bufferThe current calculator buffer.
calculator-char-radixA table to convert input characters to corresponding radix symbols.
calculator-copy-displayerIf non-nil, this is any value that can be used for
calculator-curnumCurrent number being entered (as a string).
calculator-degNon-nil if trig functions operate on degrees instead of radians.
calculator-display-fragileWhen non-nil, we see something that the next digit should replace.
calculator-displayerA displayer specification for numerical values.
calculator-displayersA list of displayers.
calculator-electric-modeRun ‘calculator’ electrically, in the echo area.
calculator-eng-extraInternal value used by ‘calculator-eng-display’.
calculator-eng-tmp-showInternal value used by ‘calculator-eng-display’.
calculator-initial-operatorsA list of initial operators.
calculator-input-radixThe mode for input, one of: nil (decimal), ‘bin’, ‘oct’ or ‘hex’.
calculator-last-opXYThe last binary operation and its arguments.
calculator-menuCalculator menu.
calculator-mode-abbrev-tableAbbrev table for ‘calculator-mode’.
calculator-mode-hookList of hook functions for ‘calculator-mode’ to run.
calculator-mode-mapThe calculator key map.
calculator-mode-syntax-tableSyntax table for ‘calculator-mode’.
calculator-number-digitsThe calculator’s number of digits used for standard display.
calculator-operatorsThe calculator operators, each a list with:
calculator-output-radixThe mode for display, one of: nil (decimal), ‘bin’, ‘oct’ or ‘hex’.
calculator-paste-decimalsIf non-nil, convert pasted integers so they have a decimal point.
calculator-promptThe prompt used by the Emacs calculator.
calculator-radix-grouping-digitsThe number of digits used for grouping display in radix modes.
calculator-radix-grouping-modeUse digit grouping in radix output mode.
calculator-radix-grouping-separatorThe separator used in radix grouping display.
calculator-registersThe association list of calculator register values.
calculator-remove-zerosNon-nil value means delete all redundant zero decimal digits.
calculator-restart-other-modeUsed to hack restarting with the electric mode changed.
calculator-saved-listA list of saved values collected.
calculator-saved-ptrThe pointer to the current saved number.
calculator-stackStack contents -- operations and operands.
calculator-stack-displayCons of the stack and its string representation.
calculator-unary-styleValue is either ‘prefix’ or ‘postfix’.
calculator-use-menuMake ‘calculator’ create a menu.
calculator-user-operatorsA list of additional operators.
calculator-user-registersAn association list of user-defined register bindings.

Defined functions (60)

calculator()
calculator-add-operators(MORE-OPS)
calculator-backspace()
calculator-clear()
calculator-clear-fragile(&optional OP)
calculator-clear-saved()
calculator-close-paren()
calculator-copy()
calculator-dec/deg-mode()
calculator-decimal()
calculator-define-key(KEY CMD MAP)
calculator-digit()
calculator-displayer-next()
calculator-displayer-prev()
calculator-eng-display(NUM)
calculator-enter()
calculator-exp()
calculator-expt(X Y)
calculator-fact(X)
calculator-funcall(F &optional X Y)
calculator-get-display()
calculator-get-register(REG)
calculator-groupize-number(STR N SEP &optional FROMLEFT)
calculator-help()
calculator-last-input(&optional KEYS)
calculator-menu(ARG1)
calculator-message(STRING &rest ARGUMENTS)
calculator-mode()
calculator-number-to-string(NUM)
calculator-op(&optional KEYS)
calculator-op-arity(OP)
calculator-op-or-exp()
calculator-op-prec(OP)
calculator-open-paren()
calculator-paste(ARG)
calculator-push-curnum()
calculator-put-value(VAL)
calculator-quit()
calculator-radix-input-mode(&optional KEYS)
calculator-radix-mode(&optional KEYS)
calculator-radix-output-mode(&optional KEYS)
calculator-reduce-stack(PREC)
calculator-reduce-stack-once(PREC)
calculator-register-read-with-preview(PROMPT)
calculator-remove-zeros(NUMSTR)
calculator-repL(X)
calculator-repR(X)
calculator-reset()
calculator-rotate-displayer(&optional NEW-DISP)
calculator-rotate-displayer-back()
calculator-save-and-quit()
calculator-save-on-list()
calculator-saved-down()
calculator-saved-move(N)
calculator-saved-up()
calculator-set-register(REG)
calculator-standard-displayer(NUM &optional CHAR GROUP-P)
calculator-string-to-number(STR)
calculator-truncate(N)
calculator-update-display(&optional FORCE)

Defined faces (0)