/[emacs]/emacs/lisp/calc/calc-prog.el
ViewVC logotype

Diff of /emacs/lisp/calc/calc-prog.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.17 by jpb, Sun Jan 2 04:51:06 2005 UTC revision 1.18 by jpb, Sun Jan 2 06:48:17 2005 UTC
# Line 474  Line 474 
474     (let ((lang calc-language))     (let ((lang calc-language))
475       (calc-edit-mode (list 'calc-finish-user-syntax-edit (list 'quote lang))       (calc-edit-mode (list 'calc-finish-user-syntax-edit (list 'quote lang))
476                       t                       t
477                       (format "Editing %s-Mode Syntax Table"                       (format "Editing %s-Mode Syntax Table. "
478                               (cond ((null lang) "Normal")                               (cond ((null lang) "Normal")
479                                     ((eq lang 'tex) "TeX")                                     ((eq lang 'tex) "TeX")
480                                     (t (capitalize (symbol-name lang))))))                                     (t (capitalize (symbol-name lang))))))
# Line 684  Line 684 
684                      (eq (car-safe (nth 3 cmd)) 'calc-execute-kbd-macro)))                      (eq (car-safe (nth 3 cmd)) 'calc-execute-kbd-macro)))
685             (let* ((mac (elt (nth 1 (nth 3 cmd)) 1))             (let* ((mac (elt (nth 1 (nth 3 cmd)) 1))
686                    (str (edmacro-format-keys mac t))                    (str (edmacro-format-keys mac t))
687                    (macbeg))                    (macbeg)
688                      (kys (nth 3 (nth 3 cmd))))
689               (calc-edit-mode               (calc-edit-mode
690                (list 'calc-edit-macro-finish-edit cmdname (nth 3 (nth 3 cmd)))                (list 'calc-edit-macro-finish-edit cmdname kys)
691                t "Calc Macro Edit Mode")                t (format "Editing keyboard macro (%s, bound to %s).\n"
692                            cmdname kys))
693               (goto-char (point-max))               (goto-char (point-max))
694               (insert "Original keys: " (elt (nth 1 (nth 3 cmd)) 0)  "\n" )               (insert "Original keys: " (elt (nth 1 (nth 3 cmd)) 0)  "\n" )
695               (setq macbeg (point))               (setq macbeg (point))
# Line 700  Line 702 
702            (t (let* ((func (calc-stack-command-p cmd))            (t (let* ((func (calc-stack-command-p cmd))
703                      (defn (and func                      (defn (and func
704                                 (symbolp func)                                 (symbolp func)
705                                 (get func 'calc-user-defn))))                                 (get func 'calc-user-defn)))
706                        (kys (concat "z" (char-to-string (car def))))
707                        (intcmd (symbol-name (cdr def)))
708                        (algcmd (substring (symbol-name func) 9)))
709                 (if (and defn (calc-valid-formula-func func))                 (if (and defn (calc-valid-formula-func func))
710                     (progn                     (progn
711                       (calc-wrapper                       (calc-wrapper
712                        (calc-edit-mode (list 'calc-finish-formula-edit                        (calc-edit-mode
713                                              (list 'quote func)))                         (list 'calc-finish-formula-edit (list 'quote func))
714                           nil
715                           (format "Editing formula (%s, %s, bound to %s).\n"
716                                   intcmd algcmd kys))
717                        (insert (math-showing-full-precision                        (insert (math-showing-full-precision
718                                 (math-format-nice-expr defn (frame-width)))                                 (math-format-nice-expr defn (frame-width)))
719                                "\n"))                                "\n"))
720                       (calc-show-edit-buffer))                       (calc-show-edit-buffer)
721                         (goto-char (point-min))
722                         (forward-line 2))
723                   (error "That command's definition cannot be edited")))))))                   (error "That command's definition cannot be edited")))))))
724    
725  ;; Formatting the macro buffer  ;; Formatting the macro buffer
# Line 822  Line 832 
832          match)          match)
833      (goto-char (line-beginning-position))      (goto-char (line-beginning-position))
834      (kill-line 1)      (kill-line 1)
835      (if (string-equal line "1")      (if (member line '("0" "1" "2" "3" "4" "5" "6" "7" "8" "9"))
836            (insert line "\t\t\t;; calc quick variable\n")            (insert line "\t\t\t;; calc quick variable\n")
837        (setq curline (calc-edit-macro-command))        (setq curline (calc-edit-macro-command))
838        (while (and curline        (while (and curline
# Line 936  Redefine the corresponding command." Line 946  Redefine the corresponding command."
946                            'arg key)))))))                            'arg key)))))))
947    
948  (defun calc-finish-formula-edit (func)  (defun calc-finish-formula-edit (func)
949      (goto-char (point-min))
950      (forward-line 2)
951    (let ((buf (current-buffer))    (let ((buf (current-buffer))
952          (str (buffer-substring (point) (point-max)))          (str (buffer-substring (point) (point-max)))
953          (start (point))          (start (point))

Legend:
Removed from v.1.17  
changed lines
  Added in v.1.18

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26