%PDF- %PDF-
Direktori : /usr/local/share/emacs/27.2/lisp/ |
Current File : //usr/local/share/emacs/27.2/lisp/calculator.elc |
;ELC ;;; Compiled ;;; in Emacs version 27.2 ;;; with all optimizations. ;;; This file uses dynamic docstrings, first added in Emacs 19.29. ;;; This file does not contain utf-8 non-ASCII characters, ;;; and so can be loaded in Emacs versions earlier than 23. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (byte-code "\300\301\302\303\304\305\306\307\310\311\310\312&\210\313\314\315\316\317DD\320\321\322\310\301&\210\313\323\315\316\324DD\325\321\322\310\301&\210\313\326\315\316\327DD\330\321\322\310\301&\210\313\331\315\316\332DD\333\321\334\310\301&\210\313\335\315\316\336DD\337\321\340\310\301&\210\313\341\315\316\342DD\343\321\344\310\301&\210\313\345\315\316\346DD\347\321\322\310\301&\210\313\350\315\316\351DD\352\321\344\310\301&\210\313\353\315\316\354DD\355\321\340\310\301&\210\313\356\315\316\357DD\360\321\361\310\301&\210\313\362\315\316\363DD\364\321\365\310\301&\210\313\366\315\316\367DD\370\321\371\310\301&\210\313\372\315\316\373DD\374\321\322\310\301&\210\375\372\376\377#\210\313\201@ \315\316\201A DD\201B \321\322\310\301&\210\313\201C \315\316\201D DD\201E \321\322\310\301&\210\313\201F \315\316\201G DD\201H \321\201I \310\301&\210\313\201J \315\316\201K DD\201L \321\201M \201N \201O \310\301& \210\313\201P \315\316\201Q DD\201R \321\201S \310\301&\210\201T \201U !\207" [custom-declare-group calculator nil "Simple Emacs calculator." :prefix "calculator" :version "21.1" :group tools applications custom-declare-variable calculator-electric-mode funcall function #[0 "\300\207" [nil] 1] "Run `calculator' electrically, in the echo area.\nElectric mode saves some place but changes the way you interact with the\ncalculator." :type boolean calculator-use-menu #[0 "\300\207" [t] 1] "Make `calculator' create a menu.\nNote that this requires easymenu. Must be set before loading." calculator-bind-escape #[0 "\300\207" [nil] 1] "If non-nil, set escape to exit the calculator." calculator-unary-style #[0 "\300\207" [postfix] 1] "Value is either `prefix' or `postfix'.\nThis determines the default behavior of unary operators." (choice (const prefix) (const postfix)) calculator-prompt #[0 "\300\207" [#1="Calc=%s> "] 1 #1#] "The prompt used by the Emacs calculator.\nIt should contain a \"%s\" somewhere that will indicate the i/o radixes;\nthis will be a two-character string as described in the documentation\nfor `calculator-mode'." string calculator-number-digits #[0 "\300\207" [3] 1] "The calculator's number of digits used for standard display.\nUsed by the `calculator-standard-display' function - it will use the\nformat string \"%.NC\" where this number is N and C is a character given\nat runtime." integer calculator-radix-grouping-mode #[0 "\300\207" [t] 1] "Use digit grouping in radix output mode.\nIf this is set, chunks of `calculator-radix-grouping-digits' characters\nwill be separated by `calculator-radix-grouping-separator' when in radix\noutput mode is active (determined by `calculator-output-radix')." calculator-radix-grouping-digits #[0 "\300\207" [4] 1] "The number of digits used for grouping display in radix modes.\nSee `calculator-radix-grouping-mode'." calculator-radix-grouping-separator #[0 "\300\207" [#2="'"] 1 #2#] "The separator used in radix grouping display.\nSee `calculator-radix-grouping-mode'." calculator-remove-zeros #[0 "\300\207" [t] 1] "Non-nil value means delete all redundant zero decimal digits.\nIf this value is not t and not nil, redundant zeros are removed except\nfor one.\nUsed by the `calculator-remove-zeros' function." (choice (const t) (const leave-decimal) (const nil)) calculator-displayer #[0 "\300\207" [(std 110)] 1] "A displayer specification for numerical values.\nThis is the displayer used to show all numbers in an expression. Result\nvalues will be displayed according to the first element of\n`calculator-displayers'.\n\nThe displayer is a symbol, a string or an expression. A symbol should\nbe the name of a one-argument function, a string is used with a single\nargument and an expression will be evaluated with the variable `num'\nbound to whatever should be displayed. If it is a function symbol, it\nshould be able to handle special symbol arguments, currently `left' and\n`right' which will be sent by special keys to modify display parameters\nassociated with the displayer function (for example to change the number\nof digits displayed).\n\nAn exception to the above is the case of the list (std C [G]) where C is\na character and G is an optional boolean, in this case the\n`calculator-standard-displayer' function will be used with these as\narguments." (choice (function) (string) (sexp) (list (const std) character) (list (const std) character boolean)) calculator-displayers #[0 "\300\207" [(((std 110) "Standard display, decimal point or scientific") (calculator-eng-display "Eng display") ((std 102 t) "Standard display, decimal point with grouping") ((std 101) "Standard display, scientific") ("%S" "Emacs printer"))] 1] "A list of displayers.\nEach element is a list of a displayer and a description string. The\nfirst element is the one which is currently used, this is for the\ndisplay of result values not values in expressions. A displayer\nspecification is the same as the values that can be stored in\n`calculator-displayer'.\n\n`calculator-rotate-displayer' rotates this list." sexp calculator-paste-decimals #[0 "\300\207" [t] 1] "If non-nil, convert pasted integers so they have a decimal point.\nThis makes it possible to paste big integers since they will be read as\nfloats, otherwise the Emacs reader will fail on them." make-obsolete-variable "it is no longer used." "26.1" calculator-copy-displayer #[0 "\300\207" [nil] 1] "If non-nil, this is any value that can be used for\n`calculator-displayer', to format a string before copying it with\n`calculator-copy'. If nil, then `calculator-displayer's normal value is\nused." calculator-2s-complement #[0 "\300\207" [nil] 1] "If non-nil, show negative numbers in 2s complement in radix modes.\nOtherwise show as a negative number." calculator-mode-hook #[0 "\300\207" [nil] 1] "List of hook functions for `calculator-mode' to run.\nNote: if `calculator-electric-mode' is on, then this hook will get\nactivated in the minibuffer -- in that case it should not do much more\nthan local key settings and other effects that will change things\noutside the scope of calculator related code." hook calculator-user-registers #[0 "\300\207" [nil] 1] "An association list of user-defined register bindings.\nEach element in this list is a list of a character and a number that\nwill be stored in that character's register.\n\nFor example, use this to define the golden ratio number:\n (setq calculator-user-registers \\='((?g . 1.61803398875)))\nbefore you load calculator." (repeat (cons character number)) :set #[514 "\302\300!\203 \303\"\211\211\207" [calculator-registers calculator-user-registers boundp append] 5 "\n\n(fn _ VAL)"] calculator-user-operators #[0 "\300\207" [nil] 1] "A list of additional operators.\nThis is a list in the same format as specified in the documentation for\n`calculator-operators', that you can use to bind additional calculator\noperators. It is probably not a good idea to modify this value with\n`customize' since it is too complex...\n\nExamples:\n\n* A very simple one, adding a postfix \"x-to-y\" conversion keys, using\n t as a prefix key:\n\n (setq calculator-user-operators\n \\='((\"tf\" cl-to-fr (+ 32 (/ (* X 9) 5)) 1)\n (\"tc\" fr-to-cl (/ (* (- X 32) 5) 9) 1)\n (\"tp\" kg-to-lb (/ X 0.453592) 1)\n (\"tk\" lb-to-kg (* X 0.453592) 1)\n (\"tF\" mt-to-ft (/ X 0.3048) 1)\n (\"tM\" ft-to-mt (* X 0.3048) 1)))\n\n* Using a function-like form is simple: use `X' for the argument (`Y'\n for a second one in case of a binary operator), `TX' is a truncated\n version of `X' and `F' for a recursive call. Here is a [very\n inefficient] Fibonacci number operator:\n\n (add-to-list \\='calculator-user-operators\n \\='(\"F\" fib\n (if (<= TX 1) 1 (+ (F (- TX 1)) (F (- TX 2))))))\n\n Note that this will be either postfix or prefix, according to\n `calculator-unary-style'." (repeat (list string symbol sexp integer integer)) require cl-lib] 12) #@418 A list of initial operators. This is a list in the same format as `calculator-operators'. Whenever `calculator' starts, it looks at the value of this variable, and if it is not empty, its contents is prepended to `calculator-operators' and the appropriate key bindings are made. This variable is then reset to nil. Don't use this if you want to add user-defined operators, use `calculator-user-operators' instead. (defvar calculator-initial-operators '(("=" = identity 1 -1) (nobind "+" + + 2 4) (nobind "-" - - 2 4) (nobind "+" + + -1 9) (nobind "-" - - -1 9) ("(" \( identity -1 -1) (")" \) identity 1 10) ("|" or (logior TX TY) 2 2) ("#" xor (logxor TX TY) 2 2) ("&" and (logand TX TY) 2 3) ("*" * * 2 5) ("/" / / 2 5) ("\\" div (/ TX TY) 2 5) ("%" rem (% TX TY) 2 5) ("L" log log 2 6) ("S" sin (sin DX) x 6) ("C" cos (cos DX) x 6) ("T" tan (tan DX) x 6) ("IS" asin (D (asin X)) x 6) ("IC" acos (D (acos X)) x 6) ("IT" atan (D (atan X)) x 6) ("Q" sqrt sqrt x 7) ("^" ^ calculator-expt 2 7) ("!" ! calculator-fact x 7) (";" 1/ (/ 1 X) 1 7) ("_" - - 1 8) ("~" ~ (lognot TX) x 8) (">" repR calculator-repR 1 8) ("<" repL calculator-repL 1 8) ("v" avg (/ (apply '+ L) (length L)) 0 8) ("l" tot (apply '+ L) 0 8)) (#$ . 8419)) #@1344 The calculator operators, each a list with: 1. The key(s) that is bound to for this operation, a string that is used with `kbd'; 2. The displayed symbol for this function; 3. The function symbol, or a form that uses the variables `X' and `Y', (if it is a binary operator), `TX' and `TY' (truncated integer versions), `DX' (converted to radians if degrees mode is on), `D' (function for converting radians to degrees if deg mode is on), `L' (list of saved values), `F' (function for recursive iteration calls) and evaluates to the function value -- these variables are capital; 4. The function's arity, optional, one of: 2 => binary, -1 => prefix unary, +1 => postfix unary, 0 => a 0-arg operator func (note that using such a function replaces the currently entered number, if any), non-number (the default) => postfix or prefix as determined by `calculator-unary-style'; 5. The function's precedence -- should be in the range of 1 (lowest) to 9 (highest) (optional, defaults to 1); It it possible have a unary prefix version of a binary operator if it comes later in this list. If the list begins with the symbol `nobind', then no key binding will take place -- this is only used for predefined keys. Use `calculator-user-operators' to add operators to this list, see its documentation for an example. (defvar calculator-operators nil (#$ . 9655)) #@44 Stack contents -- operations and operands. (defvar calculator-stack nil (#$ . 11050)) #@45 Current number being entered (as a string). (defvar calculator-curnum nil (#$ . 11142)) #@50 Cons of the stack and its string representation. (defvar calculator-stack-display nil (#$ . 11236)) #@69 A table to convert input characters to corresponding radix symbols. (defvar calculator-char-radix '((68) (66 . bin) (79 . oct) (72 . hex) (88 . hex)) (#$ . 11342)) #@69 The mode for display, one of: nil (decimal), `bin', `oct' or `hex'. (defvar calculator-output-radix nil (#$ . 11512)) #@67 The mode for input, one of: nil (decimal), `bin', `oct' or `hex'. (defvar calculator-input-radix nil (#$ . 11636)) #@66 Non-nil if trig functions operate on degrees instead of radians. (defvar calculator-deg nil (#$ . 11757)) #@35 A list of saved values collected. (defvar calculator-saved-list nil (#$ . 11869)) #@42 The pointer to the current saved number. (defvar calculator-saved-ptr 0 (#$ . 11957)) #@60 Bound to t when a value should be added to the saved-list. (defvar calculator-add-saved nil (#$ . 12049)) #@68 When non-nil, we see something that the next digit should replace. (defvar calculator-display-fragile nil (#$ . 12161)) #@32 The current calculator buffer. (defvar calculator-buffer nil (#$ . 12287)) #@50 Internal value used by `calculator-eng-display'. (defvar calculator-eng-extra nil (#$ . 12368)) #@50 Internal value used by `calculator-eng-display'. (defvar calculator-eng-tmp-show nil (#$ . 12470)) #@98 The last binary operation and its arguments. Used for repeating operations in calculator-repR/L. (defvar calculator-last-opXY nil (#$ . 12575)) #@53 The association list of calculator register values. (defvar calculator-registers (byte-code "\303\304 B\305\nBD\"\207" [calculator-user-registers float-e float-pi append 101 112] 5) (#$ . 12725)) #@57 Used to hack restarting with the electric mode changed. (defvar calculator-restart-other-mode nil (#$ . 12928)) #@20 (fn KEY CMD MAP) (defalias 'calculator-define-key #[771 ";\203 \300!\202\f \301!\302#\210\211\204( \303 \262\304\305\"\210\306\"\210\211CG\307\211W\205\205 \211H\310!\311\242\"\312\nGSU\203\\ \313!\204| \211$\210\202| \313!\203j \240\210\202| \303 $\210\240\266\266\211T\262\202- \266\202\262\207" [kbd keymap-parent define-key make-sparse-keymap suppress-keymap t set-keymap-parent 0 vector lookup-key #[1028 "\300\242#\210\301!\2051 \302X\203 \303X\204% \304X\2051 \305X\2051 \300\242\306\307\310\"!#\207" [define-key characterp 65 90 97 122 vector logxor 32] 10 "\n\n(fn M C K X)"] keymapp] 19 (#$ . 13046)]) #@25 The calculator key map. (defvar calculator-mode-map (byte-code "\304 \305\306\"\210\307\211\203/ \211@\310A!\211\203' \211@\311@#\210A\266\202\202 \210A\266\202\202 \210\203C \311\312\313#\210\311\314\313#\210\202I \311\315\313#\210 \204S \311\316\317#\210\n\203U\320\321!\204U\322\323\324\"\325\326\327!\210\330\321\331\332\333\334\335\336\334\337\340\334\341\342\343\"\344\345\"\346\347\350\"\351\352\"\353\354\"\355\356\"\357\360\361\"\362\363\"\364\365\"\366\367\"\370\371\"\372\373\"\374\375\376\"\377\201@ \"\201A \201B \" \201C \201D \"\257\201E \201F \201G \201H \201I \201J \334\201K \201L \"\201M \201N \"\257 \201O \201P \201Q \201R \334\201S \322\201T \"\201U \201S \322\201V \"\201W \322\201X \"#BC\"BBBB\201Y \201S \322\201Z \"\201[ \"B\201\\ BBBBBBBBBBBBBB$\266\211\207" [calculator-bind-escape window-system calculator-use-menu calculator-displayers make-sparse-keymap suppress-keymap t ((calculator-digit "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "a" "b" "c" "d" "f" "<kp-0>" "<kp-1>" "<kp-2>" "<kp-3>" "<kp-4>" "<kp-5>" "<kp-6>" "<kp-7>" "<kp-8>" "<kp-9>") (calculator-open-paren "[") (calculator-close-paren "]") (calculator-op-or-exp "+" "-" "<kp-add>" "<kp-subtract>") (calculator-op "<kp-divide>" "<kp-multiply>") (calculator-decimal "." "<kp-decimal>") (calculator-exp "e") (calculator-dec/deg-mode "D") (calculator-set-register "s") (calculator-get-register "g") (calculator-radix-mode "H" "X" "O" "B") (calculator-radix-input-mode "iD" "iH" "iX" "iO" "iB") (calculator-radix-output-mode "oD" "oH" "oX" "oO" "oB") (calculator-rotate-displayer "'") (calculator-rotate-displayer-back "\"") (calculator-displayer-prev "{") (calculator-displayer-next "}") (calculator-saved-up "<up>" "C-p") (calculator-saved-down "<down>" "C-n") (calculator-quit "q" "C-g") (calculator-enter "<enter>" "<linefeed>" "<kp-enter>" "<return>" "RET" "LFD") (calculator-save-on-list "SPC" "<space>") (calculator-clear-saved "C-c" "<C-delete>") (calculator-save-and-quit "<C-return>" "<C-kp-enter>") (calculator-paste "<insert>" "<S-insert>" "<paste>" "<mouse-2>" "C-y") (calculator-clear "<delete>" "DEL" "C-d") (calculator-help "h" "?" "<f1>" "<help>") (calculator-copy "<C-insert>" "<copy>") (calculator-backspace "<backspace>")) reverse calculator-define-key "ESC" calculator-quit "<escape>" "ESC ESC ESC" "C-h" calculator-backspace boundp calculator-menu mapcar #[257 "\300@\301\3028D\303\304\305\3028\306\307\310\311\312\fA@DE\310\313\312 A@DEE&\300@\314P\315\3028D\305\316\3028\227P\303\304\306\310\311\312\fA@DE&\300@\317P\320\3028D\305\321\3028\227P\303\304\306\310\313\312 A@DE&E\207" [vector calculator-radix-mode 2 :style radio :keys :selected and eq calculator-input-radix quote calculator-output-radix " Input" calculator-radix-input-mode "i" " Output" calculator-radix-output-mode "o"] 15 "\n\n(fn X)"] (("Decimal" nil "D") ("Binary" bin "B") ("Octal" oct "O") ("Hexadecimal" hex "H")) #[514 "\300\301D\302$\207" [vector calculator-op :keys] 7 "\n\n(fn NAME KEY)"] (lambda (#1=#:def-tmp-var) (defvar calculator-menu #1# #2="Calculator menu.")) nil easy-menu-do-define #2# "Calculator" ["Help" (let ((last-command 'calculator-help)) (calculator-help)) :keys "?"] "---" ["Copy" calculator-copy] ["Paste" calculator-paste] ["Electric mode" (progn (calculator-quit) (setq calculator-restart-other-mode t) (run-with-timer 0.1 nil (lambda nil (message nil))) (calculator)) :active (not calculator-electric-mode)] ["Normal mode" (progn (setq calculator-restart-other-mode t) (calculator-quit)) :active calculator-electric-mode] "Functions" "Repeat-right" ">" "Repeat-left" "<" "------General------" "Reciprocal" ";" "Log" "L" "Square-root" "Q" "Factorial" "!" "------Trigonometric------" "Sinus" "S" "Cosine" "C" "Tangent" "T" "Inv-Sinus" "IS" "Inv-Cosine" "IC" "Inv-Tangent" "IT" "------Bitwise------" "Or" "|" "Xor" "#" "And" "&" "Not" "~" "Saved List" ["Eval+Save" calculator-save-on-list] ["Prev number" calculator-saved-up] ["Next number" calculator-saved-down] ["Delete current" calculator-clear :active (and calculator-display-fragile calculator-saved-list (= (car calculator-stack) (nth calculator-saved-ptr calculator-saved-list)))] ["Delete all" calculator-clear-saved] "List-total" "l" "List-average" "v" ("Registers" ["Get register" calculator-get-register] ["Set register" calculator-set-register]) "Modes" ["Radians" (progn (when (or calculator-input-radix calculator-output-radix) (calculator-radix-mode "D")) (when calculator-deg (calculator-dec/deg-mode))) :keys "D" :style radio :selected (not (or calculator-input-radix calculator-output-radix calculator-deg))] ["Degrees" (progn (when (or calculator-input-radix calculator-output-radix) (calculator-radix-mode "D")) (unless calculator-deg (calculator-dec/deg-mode))) :keys "D" :style radio :selected (and calculator-deg (not (or calculator-input-radix calculator-output-radix)))] append car "Separate I/O" #[257 "\211A@\207" [] 2 "\n\n(fn X)"] ("---") #[257 "\3008\207" [2] 3 "\n\n(fn X)"] "Decimal Display" #[257 "\300A@\301\302DD\"\207" [vector calculator-rotate-displayer quote] 6 "\n\n(fn D)"] ("---" ["Change Prev Display" calculator-displayer-prev] ["Change Next Display" calculator-displayer-next]) ("---" ["Copy+Quit" calculator-save-and-quit] ["Quit" calculator-quit])] 38) (#$ . 13728)) (defvar calculator-mode-hook nil) (byte-code "\300\301N\204\f \302\300\301\303#\210\304\305!\204 \302\305\306\307#\210\300\207" [calculator-mode-hook variable-documentation put "Hook run after entering Calculator mode.\nNo problems result if this variable is not bound.\n`add-hook' automatically binds it. (This is true for all hook variables.)" boundp calculator-mode-map definition-name calculator-mode] 4) (defvar calculator-mode-map (make-sparse-keymap)) (byte-code "\301\302N\204 \303\301\302\304\305!#\210\306\307!\204 \303\307\310\311#\210\312\313 !\210\307\302N\204- \303\307\302\304\314!#\210\306\300!\204B \303\300\310\311#\210\315\316\300\317\"\210!\210\300\302N\204P \303\300\302\304\320!#\210\303\311\321\317#\207" [calculator-mode-abbrev-table calculator-mode-map variable-documentation put purecopy "Keymap for `calculator-mode'." boundp calculator-mode-syntax-table definition-name calculator-mode (lambda (#1=#:def-tmp-var) (defvar calculator-mode-syntax-table #1#)) make-syntax-table "Syntax table for `calculator-mode'." (lambda (#1#) (defvar calculator-mode-abbrev-table #1#)) define-abbrev-table nil "Abbrev table for `calculator-mode'." derived-mode-parent] 5) #@4783 A [not so] simple calculator for Emacs. This calculator is used in the same way as other popular calculators like xcalc or calc.exe -- but using an Emacs interface. Expressions are entered using normal infix notation, parens are used as normal. Unary functions are usually postfix, but some depends on the value of `calculator-unary-style' (if the style for an operator below is specified, then it is fixed, otherwise it depends on this variable). `+' and `-' can be used as either binary operators or prefix unary operators. Numbers can be entered with exponential notation using `e', except when using a non-decimal radix mode for input (in this case `e' will be the hexadecimal digit). Here are the editing keys: * `RET' `=' evaluate the current expression * `C-insert' copy the whole current expression to the `kill-ring' * `C-return' evaluate, save result the `kill-ring' and exit * `insert' paste a number if the one was copied (normally) * `delete' `C-d' clear last argument or whole expression (hit twice) * `backspace' delete a digit or a previous expression element * `h' `?' pop-up a quick reference help * `ESC' `q' exit (`ESC' can be used if `calculator-bind-escape' is non-nil, otherwise use three consecutive `ESC's) These operators are pre-defined: * `+' `-' `*' `/' the common binary operators * `\' `%' integer division and remainder * `_' `;' postfix unary negation and reciprocal * `^' `L' binary operators for x^y and log(x) in base y * `Q' `!' unary square root and factorial * `S' `C' `T' unary trigonometric operators: sin, cos and tan * `|' `#' `&' `~' bitwise operators: or, xor, and, not The trigonometric functions can be inverted if prefixed with an `I', see below for the way to use degrees instead of the default radians. Two special postfix unary operators are `>' and `<': whenever a binary operator is performed, it is remembered along with its arguments; then `>' (`<') will apply the same operator with the same right (left) argument. hex/oct/bin modes can be set for input and for display separately. Another toggle-able mode is for using degrees instead of radians for trigonometric functions. The keys to switch modes are (both `H' and `X' are for hex): * `D' switch to all-decimal mode, or toggle degrees/radians * `B' `O' `H' `X' binary/octal/hexadecimal modes for input & display * `i' `o' followed by one of `D' `B' `O' `H' `X' (case insensitive) sets only the input or display radix mode The prompt indicates the current modes: * "==": decimal mode (using radians); * "D=": decimal mode using degrees; * "?=": ? is B/O/H, the radix for both input and output; * "=?": ? is B/O/H, the display radix (with decimal input); * "??": ? is D/B/O/H, 1st char for input radix, 2nd for display. Also, the quote key can be used to switch display modes for decimal numbers (double-quote rotates back), and the two brace characters ("{" and "}" change display parameters that these displayers use, if they handle such). If output is using any radix mode, then these keys toggle digit grouping mode and the chunk size. Values can be saved for future reference in either a list of saved values, or in registers. The list of saved values is useful for statistics operations on some collected data. It is possible to navigate in this list, and if the value shown is the current one on the list, an indication is displayed as "[N]" if this is the last number and there are N numbers, or "[M/N]" if the M-th value is shown. * `SPC' evaluate the current value as usual, but also adds the result to the list of saved values * `l' `v' computes total / average of saved values * `up' `C-p' browse to the previous value in the list * `down' `C-n' browse to the next value in the list * `delete' `C-d' remove current value from the list (if it is on it) * `C-delete' `C-c' delete the whole list Registers are variable-like place-holders for values: * `s' followed by a character attach the current value to that character * `g' followed by a character fetches the attached value There are many variables that can be used to customize the calculator. Some interesting customization variables are: * `calculator-electric-mode' use only the echo-area electrically. * `calculator-unary-style' set most unary ops to pre/postfix style. * `calculator-user-registers' to define user-preset registers. * `calculator-user-operators' to add user-defined operators. See the documentation for these variables, and "calculator.el" for more information. \{calculator-mode-map} This mode runs the hook `calculator-mode-hook', as the final or penultimate step during initialization. (defalias 'calculator-mode #[0 "\306\300!\210\307\310 \210\311\312\313!\210\314\f!\210 )\315\316!\207" [delay-mode-hooks major-mode mode-name calculator-mode-map calculator-mode-syntax-table calculator-mode-abbrev-table make-local-variable t kill-all-local-variables calculator-mode "Calculator" use-local-map set-syntax-table run-mode-hooks calculator-mode-hook local-abbrev-table] 2 (#$ . 20282) nil]) #@93 Run the Emacs calculator. See the documentation for `calculator-mode' for more information. (defalias 'calculator #[0 "\203 ?\n\203 \306\n!\210\307\306!\210\310\311! \203u \312 \313\314\315\316\317!\320\"\321$\216\322\323!\210\324\307!\210\325\326 !\314\307/\327\326 \f\"\210\330\326 !\210\331 \210\332 \210\3330!\210\334\335!\210\313\314\336\316\317!\337\"\340$\216\3412m \342\341\343\307\344$0\210+\210)\210\202\256 \345\f!\204\225 \3211\330\346\347 \203\211 \350\202\212 \351!!\210\352\f!\210)\202\241 p\f=\204\241 \330\345\f!!\210\353 \210\3542\331 \210\324\355!\210\205\270 \205\270 \356 \207" [calculator-restart-other-mode calculator-electric-mode calculator-initial-operators calculator-user-operators calculator-buffer garbage-collection-messages calculator-add-operators nil get-buffer-create "*calculator*" current-window-configuration make-byte-code 0 "\301\300!\207" vconcat vector [set-window-configuration] 2 require electric message window-buffer minibuffer-window set-window-buffer select-window calculator-reset calculator-update-display use-local-map run-hooks calculator-mode-hook "\302\303 \300\"\210\304 !\207" [calculator-buffer set-window-buffer minibuffer-window kill-buffer] 3 calculator-done Electric-command-loop #[0 "\300\207" [noprompt] 1] #[514 "\300 \207" [calculator-update-display] 3 "\n\n(fn X Y)"] get-buffer-window split-window-below calculator-need-3-lines -3 -2 switch-to-buffer calculator-mode t "Hit `?' For a quick help screen." calculator echo-keystrokes calculator-mode-map window-min-height buffer-read-only] 8 (#$ . 25480) nil]) (defalias 'calculator-need-3-lines #[0 "\300\301\302\"\300\303\302\"\250\203 \211\250\203 \211W\206&