comparison lisp/calc/calc-prog.el @ 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 5f8090982771
children fb44bc67721e 6d92d69fae33
comparison
equal deleted inserted replaced
59640:767c8c2a2d5c 59641:292caf631179
700 (get func 'calc-user-defn))) 700 (get func 'calc-user-defn)))
701 (kys (concat "z" (char-to-string (car def)))) 701 (kys (concat "z" (char-to-string (car def))))
702 (intcmd (symbol-name (cdr def))) 702 (intcmd (symbol-name (cdr def)))
703 (algcmd (substring (symbol-name func) 9))) 703 (algcmd (substring (symbol-name func) 9)))
704 (if (and defn (calc-valid-formula-func func)) 704 (if (and defn (calc-valid-formula-func func))
705 (progn 705 (let ((niceexpr (math-format-nice-expr defn (frame-width))))
706 (calc-wrapper 706 (calc-wrapper
707 (calc-edit-mode 707 (calc-edit-mode
708 (list 'calc-finish-formula-edit (list 'quote func)) 708 (list 'calc-finish-formula-edit (list 'quote func))
709 nil 709 nil
710 (format "Editing formula (%s, %s, bound to %s).\n" 710 (format (concat
711 intcmd algcmd kys)) 711 "Editing formula (%s, %s, bound to %s).\n"
712 "Original formula: %s\n")
713 intcmd algcmd kys niceexpr))
712 (insert (math-showing-full-precision 714 (insert (math-showing-full-precision
713 (math-format-nice-expr defn (frame-width))) 715 niceexpr)
714 "\n")) 716 "\n"))
715 (calc-show-edit-buffer)) 717 (calc-show-edit-buffer))
716 (error "That command's definition cannot be edited"))))))) 718 (error "That command's definition cannot be edited")))))))
717 719
718 ;; Formatting the macro buffer 720 ;; Formatting the macro buffer