emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/lisp/calc/calc-store.el


From: Jay Belanger
Subject: [Emacs-diffs] Changes to emacs/lisp/calc/calc-store.el
Date: Sun, 15 May 2005 23:55:11 -0400

Index: emacs/lisp/calc/calc-store.el
diff -c emacs/lisp/calc/calc-store.el:1.15 emacs/lisp/calc/calc-store.el:1.16
*** emacs/lisp/calc/calc-store.el:1.15  Sun May 15 05:20:59 2005
--- emacs/lisp/calc/calc-store.el       Mon May 16 03:55:11 2005
***************
*** 387,392 ****
--- 387,412 ----
    (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




reply via email to

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