]> git.eshelyaron.com Git - emacs.git/commit
* lisp/calculator.el: more improvements and bugfixes.
authorEli Barzilay <eli@barzilay.org>
Sun, 29 Nov 2015 20:24:27 +0000 (15:24 -0500)
committerEli Barzilay <eli@barzilay.org>
Sun, 29 Nov 2015 22:30:52 +0000 (17:30 -0500)
commitf248292ede3940dde5e4ac29d96f8a0294788b0a
tree35eccd8580548628d7e399f6ad6f5644c5e2adf0
parent1b4570bc08b35ba98d48b3a8465948949cf5a31f
* lisp/calculator.el: more improvements and bugfixes.

- Mark `calculator-paste-decimals' as obsolete.  (It wasn't having an
  effect anyway.)

- Simplify `calculator-number-to-string' by throwing most of the work
  onto `number-to-string', leaving just some tweaks for decimal inputs.
  This leads to some minor changes, for example, pasting "1x1" in hex
  mode would warn that "x" is ignored and result in "11" (and it wasn't
  done in decimal mode), whereas now it just ignores everything from the
  "x" and on and result in a "1" just like in decimal input mode.  Also,
  overflows are left for `number-to-string' to deal with.

- `calculator-paste' is very simple as a result.

- Extend the simplified `calculator-paste': with a prefix argument it
  pastes a string as if the characters were entered.  This can be used
  to reduce expressions, but note that it's a simple literal operation,
  so precedence can be messed, a number can be paster while entering a
  number, spaces and newlines matter, etc.

- Fix a minor bug where "e+" in hex mode wouldn't use "+" as an
  operator.

- Fix a bug in `calculator-put-value': avoid grouping in the display
  that is used to construct `calculator-curnum'.  This would trigger
  when pasting or getting a value from a register in some radix mode
  with a large enough value.  Another fix: make the output radix equal
  the input one, otherwise numbers could be converted twice.
lisp/calculator.el