aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Barzilay2015-11-24 13:39:17 -0500
committerEli Barzilay2015-11-29 12:49:06 -0500
commite875e68b325f1d621a21798d4c4244790ecaf77f (patch)
treee65b5b571b455cfd5bba1b4dd76e090b2b1dd837
parent5d74a02eb7c063aeea8f16ea2dcd4dd8b5ee85a1 (diff)
downloademacs-e875e68b325f1d621a21798d4c4244790ecaf77f.tar.gz
emacs-e875e68b325f1d621a21798d4c4244790ecaf77f.zip
* lisp/calculator.el: improve radix modes
Fix prompt for some input radix with decimal output (eg, "BD" instead of the incorrect "B="); also, some minor docstring tweaks for these.
-rw-r--r--lisp/calculator.el17
1 files changed, 9 insertions, 8 deletions
diff --git a/lisp/calculator.el b/lisp/calculator.el
index b1cda28bd25..55ef461990c 100644
--- a/lisp/calculator.el
+++ b/lisp/calculator.el
@@ -621,16 +621,17 @@ argument.
621hex/oct/bin modes can be set for input and for display separately. 621hex/oct/bin modes can be set for input and for display separately.
622Another toggle-able mode is for using degrees instead of radians for 622Another toggle-able mode is for using degrees instead of radians for
623trigonometric functions. 623trigonometric functions.
624The keys to switch modes are (`X' is shortcut for `H'): 624The keys to switch modes are (both `H' and `X' are for hex):
625* `D' switch to all-decimal mode, or toggle degrees/radians 625* `D' switch to all-decimal mode, or toggle degrees/radians
626* `B' `O' `H' `X' binary/octal/hexadecimal modes for input & display 626* `B' `O' `H' `X' binary/octal/hexadecimal modes for input & display
627* `i' `o' followed by one of `D' `B' `O' `H' `X' (case 627* `i' `o' followed by one of `D' `B' `O' `H' `X' (case
628 insensitive) sets only the input or display radix mode 628 insensitive) sets only the input or display radix mode
629The prompt indicates the current modes: 629The prompt indicates the current modes:
630* \"D=\": degrees mode; 630* \"==\": decimal mode (using radians);
631* \"?=\": (? is B/O/H) this is the radix for both input and output; 631* \"D=\": decimal mode using degrees;
632* \"=?\": (? is B/O/H) the display radix (when input is decimal); 632* \"?=\": ? is B/O/H, the radix for both input and output;
633* \"??\": (? is D/B/O/H) 1st char for input radix, 2nd for display. 633* \"=?\": ? is B/O/H, the display radix (with decimal input);
634* \"??\": ? is D/B/O/H, 1st char for input radix, 2nd for display.
634 635
635Also, the quote key can be used to switch display modes for decimal 636Also, the quote key can be used to switch display modes for decimal
636numbers (double-quote rotates back), and the two brace characters 637numbers (double-quote rotates back), and the two brace characters
@@ -831,7 +832,7 @@ The result should not exceed the screen width."
831 (cond ((or in-r out-r) 832 (cond ((or in-r out-r)
832 (concat (or in-r "=") 833 (concat (or in-r "=")
833 (if (equal in-r out-r) "=" 834 (if (equal in-r out-r) "="
834 (or out-r "=")))) 835 (or out-r "D"))))
835 (calculator-deg "D=") 836 (calculator-deg "D=")
836 (t "==")))) 837 (t "=="))))
837 (expr 838 (expr
@@ -1555,8 +1556,8 @@ registers."
1555* I inverse the next trig function \ 1556* I inverse the next trig function \
1556* \\='/\"/{/} - display/display args 1557* \\='/\"/{/} - display/display args
1557* D - switch to all-decimal, or toggle deg/rad mode 1558* D - switch to all-decimal, or toggle deg/rad mode
1558* B/O/H/X - binary/octal/hex mode for i/o (X is a shortcut for H) 1559* B/O/H/X - binary/octal/hex mode for i/o (both H and X are for hex)
1559* i/o - prefix for d/b/o/x - set only input/output modes 1560* i/o - prefix for D/B/O/X - set only input/output modes
1560* enter/= - evaluate current expr. * s/g - set/get a register 1561* enter/= - evaluate current expr. * s/g - set/get a register
1561* space - evaluate & save on list * l/v - list total/average 1562* space - evaluate & save on list * l/v - list total/average
1562* up/down/C-p/C-n - browse saved * C-delete - clear all saved 1563* up/down/C-p/C-n - browse saved * C-delete - clear all saved