emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 54e3734: Document the optional prefix to `calc-yank


From: Jay Belanger
Subject: [Emacs-diffs] master 54e3734: Document the optional prefix to `calc-yank'.
Date: Sun, 11 Oct 2015 03:09:37 +0000

branch: master
commit 54e3734a322aca9d396e4c7b0e73f08ac6c12501
Author: Jay Belanger <address@hidden>
Commit: Jay Belanger <address@hidden>

    Document the optional prefix to `calc-yank'.
    
    * doc/misc/calc.texi (Yanking into the Stack): Document the optional
    prefix to `calc-yank'.
    * lisp/calc/calc-yank.el (calc-yank): Ensure that things killed from
    the Calc buffer are yanked back unchanged.
---
 doc/misc/calc.texi     |   13 +++++++++++++
 lisp/calc/calc-yank.el |    2 +-
 2 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/doc/misc/calc.texi b/doc/misc/calc.texi
index ecf2ef9..8579d0f 100644
--- a/doc/misc/calc.texi
+++ b/doc/misc/calc.texi
@@ -29903,6 +29903,19 @@ number in its displayed form, 3.142.  (Since the 
default display modes
 show all objects to their full precision, this feature normally makes no
 difference.)
 
+The @kbd{C-y} command can be given a prefix, which will interpret the
+text being yanked with a different radix.  If the text being yanked can be
+interpreted as a binary, octal, hexadecimal, or decimal number, then a
+prefix of @kbd{2}, @kbd{8}, @kbd{6} or @kbd{0} will have Calc
+interpret the yanked text as a number in the appropriate base.  For example, 
+if @samp{111} has just been killed and is yanked into Calc with a command
+of @kbd{C-2 C-y}, then the number @samp{7} will be put on the stack.
+If you use the plain prefix @kbd{C-u}, then you will be prompted for a
+base to use, which can be any integer from 2 to 36.  If Calc doesn't
+allow the text being yanked to be read in a different base (such as if
+the text is an algebraic expression), then the prefix will have no
+effect.
+
 @node Saving Into Registers, Inserting From Registers, Yanking Into Stack, 
Kill and Yank
 @section Saving into Registers
 
diff --git a/lisp/calc/calc-yank.el b/lisp/calc/calc-yank.el
index c93b64b..cd44750 100644
--- a/lisp/calc/calc-yank.el
+++ b/lisp/calc/calc-yank.el
@@ -195,7 +195,7 @@ alteration."
                        (concat radix-notation "\\&")
                        thing-raw))
                   thing-raw)))))
-      (if (eq (car-safe calc-last-kill) thing)
+      (if (eq (car-safe calc-last-kill) thing-raw)
           (cdr calc-last-kill)
         (if (stringp thing)
             (let ((val (math-read-exprs (calc-clean-newlines thing))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]