Function: calculator-copy
calculator-copy is an interactive and byte-compiled function defined
in calculator.el.gz.
Signature
(calculator-copy)
Documentation
Copy current number to the kill-ring.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/calculator.el.gz
(defun calculator-copy ()
"Copy current number to the `kill-ring'."
(interactive)
(let ((calculator-displayer
(or calculator-copy-displayer calculator-displayer))
(calculator-displayers
(if calculator-copy-displayer nil calculator-displayers)))
(calculator-enter)
;; remove trailing spaces and an index
(let ((s (cdr calculator-stack-display)))
(when s
(kill-new (replace-regexp-in-string
"^\\([^ ]+\\) *\\(\\[[0-9/]+\\]\\)? *$" "\\1" s))))))