changeset 59641:292caf631179

(calc-user-define-edit): Put original formula in formula editing buffer.
author Jay Belanger <jay.p.belanger@gmail.com>
date Wed, 19 Jan 2005 17:20:34 +0000
parents 767c8c2a2d5c
children 68123d2e2540
files lisp/calc/calc-prog.el
diffstat 1 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/calc/calc-prog.el	Wed Jan 19 16:58:06 2005 +0000
+++ b/lisp/calc/calc-prog.el	Wed Jan 19 17:20:34 2005 +0000
@@ -702,15 +702,17 @@
                     (intcmd (symbol-name (cdr def)))
                     (algcmd (substring (symbol-name func) 9)))
 	       (if (and defn (calc-valid-formula-func func))
-		   (progn
+		   (let ((niceexpr (math-format-nice-expr defn (frame-width))))
 		     (calc-wrapper
 		      (calc-edit-mode 
                        (list 'calc-finish-formula-edit (list 'quote func))
                        nil
-                       (format "Editing formula (%s, %s, bound to %s).\n"
-                               intcmd algcmd kys))
+                       (format (concat
+                                "Editing formula (%s, %s, bound to %s).\n"
+                                "Original formula: %s\n")
+                               intcmd algcmd kys niceexpr))
 		      (insert  (math-showing-full-precision
-                                (math-format-nice-expr defn (frame-width)))
+                                niceexpr)
                                "\n"))
 		     (calc-show-edit-buffer))
 		 (error "That command's definition cannot be edited")))))))