• Eli Barzilay's avatar
    * lisp/calculator.el: more improvements and bugfixes. · f248292e
    Eli Barzilay authored
    - 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.
    f248292e
calculator.el 67 KB