diff options
| author | Jay Belanger | 2010-04-17 23:13:09 -0500 |
|---|---|---|
| committer | Jay Belanger | 2010-04-17 23:13:09 -0500 |
| commit | f8b91752dda437746ff89e62a63760aa6efe0dda (patch) | |
| tree | 2328c333e5d1edb200ea5d0f601034b47d7c68f3 | |
| parent | a0d3397536d7507875fd3d5e2a8bb4b840c49013 (diff) | |
| download | emacs-f8b91752dda437746ff89e62a63760aa6efe0dda.tar.gz emacs-f8b91752dda437746ff89e62a63760aa6efe0dda.zip | |
calc-bin.el (calc-radix): Have the O option turn on twos-complement mode.
| -rw-r--r-- | doc/misc/ChangeLog | 6 | ||||
| -rw-r--r-- | doc/misc/calc.texi | 38 | ||||
| -rw-r--r-- | lisp/ChangeLog | 7 | ||||
| -rw-r--r-- | lisp/calc/README | 6 | ||||
| -rw-r--r-- | lisp/calc/calc-bin.el | 2 |
5 files changed, 43 insertions, 16 deletions
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog index e9aa87e8d50..996c788738b 100644 --- a/doc/misc/ChangeLog +++ b/doc/misc/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2010-04-18 Jay Belanger <jay.p.belanger@gmail.com> | ||
| 2 | |||
| 3 | * calc.texi (Radix modes): Mention that the option prefix will | ||
| 4 | turn on twos-complement mode. | ||
| 5 | (Inverse and Hyperbolic Flags): Mention the Option flag. | ||
| 6 | |||
| 1 | 2010-04-15 Carsten Dominik <carsten.dominik@gmail.com> | 7 | 2010-04-15 Carsten Dominik <carsten.dominik@gmail.com> |
| 2 | 8 | ||
| 3 | * org.texi (LaTeX and PDF export): Add a footnote about xetex. | 9 | * org.texi (LaTeX and PDF export): Add a footnote about xetex. |
diff --git a/doc/misc/calc.texi b/doc/misc/calc.texi index 51b475dbc06..7647dd4d61a 100644 --- a/doc/misc/calc.texi +++ b/doc/misc/calc.texi | |||
| @@ -12289,15 +12289,21 @@ may be executed with @kbd{x} or @kbd{M-x}. Their effect is simply to | |||
| 12289 | toggle the Inverse and/or Hyperbolic flags and then execute the | 12289 | toggle the Inverse and/or Hyperbolic flags and then execute the |
| 12290 | corresponding base command (@code{calc-sin} in this case). | 12290 | corresponding base command (@code{calc-sin} in this case). |
| 12291 | 12291 | ||
| 12292 | The Inverse and Hyperbolic flags apply only to the next Calculator | 12292 | @kindex O |
| 12293 | command, after which they are automatically cleared. (They are also | 12293 | @pindex calc-option |
| 12294 | cleared if the next keystroke is not a Calc command.) Digits you | 12294 | The @kbd{O} key (@code{calc-option}) sets another flag, the |
| 12295 | type after @kbd{I} or @kbd{H} (or @kbd{K}) are treated as prefix | 12295 | @dfn{Option Flag}, which also can alter the subsequent Calc command in |
| 12296 | arguments for the next command, not as numeric entries. The same | 12296 | various ways. |
| 12297 | is true of @kbd{C-u}, but not of the minus sign (@kbd{K -} means to | 12297 | |
| 12298 | subtract and keep arguments). | 12298 | The Inverse, Hyperbolic and Option flags apply only to the next |
| 12299 | 12299 | Calculator command, after which they are automatically cleared. (They | |
| 12300 | The third Calc prefix flag, @kbd{K} (keep-arguments), is discussed | 12300 | are also cleared if the next keystroke is not a Calc command.) Digits |
| 12301 | you type after @kbd{I}, @kbd{H} or @kbd{O} (or @kbd{K}) are treated as | ||
| 12302 | prefix arguments for the next command, not as numeric entries. The | ||
| 12303 | same is true of @kbd{C-u}, but not of the minus sign (@kbd{K -} means | ||
| 12304 | to subtract and keep arguments). | ||
| 12305 | |||
| 12306 | Another Calc prefix flag, @kbd{K} (keep-arguments), is discussed | ||
| 12301 | elsewhere. @xref{Keep Arguments}. | 12307 | elsewhere. @xref{Keep Arguments}. |
| 12302 | 12308 | ||
| 12303 | @node Calculation Modes, Simplification Modes, Inverse and Hyperbolic, Mode Settings | 12309 | @node Calculation Modes, Simplification Modes, Inverse and Hyperbolic, Mode Settings |
| @@ -13175,12 +13181,13 @@ in the current radix. (Larger integers will still be displayed in their | |||
| 13175 | entirety.) | 13181 | entirety.) |
| 13176 | 13182 | ||
| 13177 | @cindex Two's complements | 13183 | @cindex Two's complements |
| 13178 | With the binary, octal and hexadecimal display modes, Calc can | 13184 | Calc can display @expr{w}-bit integers using two's complement |
| 13179 | display @expr{w}-bit integers using two's complement notation. This | 13185 | notation, although this is most useful with the binary, octal and |
| 13180 | option is selected with the key sequences @kbd{C-u d 2}, @kbd{C-u d 8} | 13186 | hexadecimal display modes. This option is selected by using the |
| 13181 | and @kbd{C-u d 6}, respectively, and a negative word size might be | 13187 | @kbd{O} option prefix before setting the display radix, and a negative word |
| 13182 | appropriate (@pxref{Binary Functions}). In two's complement | 13188 | size might be appropriate (@pxref{Binary Functions}). In two's |
| 13183 | notation, the integers in the (nearly) symmetric interval from | 13189 | complement notation, the integers in the (nearly) symmetric interval |
| 13190 | from | ||
| 13184 | @texline @math{-2^{w-1}} | 13191 | @texline @math{-2^{w-1}} |
| 13185 | @infoline @expr{-2^(w-1)} | 13192 | @infoline @expr{-2^(w-1)} |
| 13186 | to | 13193 | to |
| @@ -35461,6 +35468,7 @@ keystrokes are not listed in this summary. | |||
| 35461 | @r{ @: M @: @: @:calc-more-recursion-depth@:} | 35468 | @r{ @: M @: @: @:calc-more-recursion-depth@:} |
| 35462 | @r{ @: I M @: @: @:calc-less-recursion-depth@:} | 35469 | @r{ @: I M @: @: @:calc-less-recursion-depth@:} |
| 35463 | @r{ a@: N @: @: 5 @:evalvn@:(a)} | 35470 | @r{ a@: N @: @: 5 @:evalvn@:(a)} |
| 35471 | @r{ @: O @:command @: 32 @:@:Option} | ||
| 35464 | @r{ @: P @: @: @:@:pi} | 35472 | @r{ @: P @: @: @:@:pi} |
| 35465 | @r{ @: I P @: @: @:@:gamma} | 35473 | @r{ @: I P @: @: @:@:gamma} |
| 35466 | @r{ @: H P @: @: @:@:e} | 35474 | @r{ @: H P @: @: @:@:e} |
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 2edd1522658..d47d9bae82a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2010-04-18 Jay Belanger <jay.p.belanger@gmail.com> | ||
| 2 | |||
| 3 | * calc.el (calc-mode-map): Bind "O" to `calc-missing-key'. | ||
| 4 | |||
| 5 | * calc-bin.el (calc-radix): Have the "O" option turn on | ||
| 6 | twos-complement mode. | ||
| 7 | |||
| 1 | 2010-04-17 Jay Belanger <jay.p.belanger@gmail.com> | 8 | 2010-04-17 Jay Belanger <jay.p.belanger@gmail.com> |
| 2 | 9 | ||
| 3 | * calc-ext.el (calc-init-extensions): Add keybinding for 'calc-option'. | 10 | * calc-ext.el (calc-init-extensions): Add keybinding for 'calc-option'. |
diff --git a/lisp/calc/README b/lisp/calc/README index 9e095252fc1..3e3acaebb27 100644 --- a/lisp/calc/README +++ b/lisp/calc/README | |||
| @@ -72,6 +72,12 @@ opinions. | |||
| 72 | Summary of changes to "Calc" | 72 | Summary of changes to "Calc" |
| 73 | ------- -- ------- -- ---- | 73 | ------- -- ------- -- ---- |
| 74 | 74 | ||
| 75 | Emacs 24.1 | ||
| 76 | |||
| 77 | * Added "O" option prefix. | ||
| 78 | |||
| 79 | * Used "O" prefix to "d r" (`calc-radix') to turn on twos-complement mode. | ||
| 80 | |||
| 75 | Emacs 23.2 | 81 | Emacs 23.2 |
| 76 | 82 | ||
| 77 | * Added twos-complement display. | 83 | * Added twos-complement display. |
diff --git a/lisp/calc/calc-bin.el b/lisp/calc/calc-bin.el index 7af60e92140..0e31fbe681c 100644 --- a/lisp/calc/calc-bin.el +++ b/lisp/calc/calc-bin.el | |||
| @@ -175,7 +175,7 @@ the size of a Calc bignum digit.") | |||
| 175 | (progn | 175 | (progn |
| 176 | (calc-change-mode | 176 | (calc-change-mode |
| 177 | (list 'calc-number-radix 'calc-twos-complement-mode) | 177 | (list 'calc-number-radix 'calc-twos-complement-mode) |
| 178 | (list n (and (or (= n 2) (= n 8) (= n 16)) arg)) t) | 178 | (list n (or arg (calc-is-option))) t) |
| 179 | ;; also change global value so minibuffer sees it | 179 | ;; also change global value so minibuffer sees it |
| 180 | (setq-default calc-number-radix calc-number-radix)) | 180 | (setq-default calc-number-radix calc-number-radix)) |
| 181 | (setq n calc-number-radix)) | 181 | (setq n calc-number-radix)) |