From: Jay Belanger Date: Mon, 16 May 2005 03:55:11 +0000 (+0000) Subject: (calc-copy-special-constant): New function. X-Git-Tag: ttn-vms-21-2-B4~252 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=04587c6eb4e74308ca969a6a73b03275ccf24dba;p=emacs.git (calc-copy-special-constant): New function. --- diff --git a/lisp/calc/calc-store.el b/lisp/calc/calc-store.el index 966f9acbdd7..fa61acb0f5f 100644 --- a/lisp/calc/calc-store.el +++ b/lisp/calc/calc-store.el @@ -387,6 +387,26 @@ (interactive) (calc-recall (intern (format "var-q%c" last-command-char)))) +(defun calc-copy-special-constant (&optional sconst var) + (interactive) + (let ((sc '(("") + ("e" . (special-const (math-e))) + ("pi" . (special-const (math-pi))) + ("i" . (special-const (math-imaginary 1))) + ("phi" . (special-const (math-phi))) + ("gamma" . (special-const (math-gamma-const)))))) + (calc-wrapper + (or sconst (setq sconst (completing-read "Special constant: " sc nil t))) + (unless (string= sconst "") + (let ((value (cdr (assoc sconst sc)))) + (or var (setq var (calc-read-var-name + (format "Copy special constant %s, to: " + sconst)))) + (if var + (let ((msg (calc-store-value var value ""))) + (message (concat "Special constant \"%s\" copied to \"%s\"" msg) + sconst (calc-var-name var))))))))) + (defun calc-copy-variable (&optional var1 var2) (interactive) (calc-wrapper