aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJay Belanger2005-02-19 20:01:01 +0000
committerJay Belanger2005-02-19 20:01:01 +0000
commit4601c4773bd86e2b36a73d4e0639e1bab1487181 (patch)
tree29271702bae840f0b27fbc4dd59f0caf54cf3639
parentdba763eec494a744c19b258647a82fed9281d4f0 (diff)
downloademacs-4601c4773bd86e2b36a73d4e0639e1bab1487181.tar.gz
emacs-4601c4773bd86e2b36a73d4e0639e1bab1487181.zip
(calc-user-define-edit): Add local variable.
(calc-edit-top): Move declaration to earlier in file. (calc-edit-macro-repeats): Add local variables.
-rw-r--r--lisp/calc/calc-prog.el20
1 files changed, 11 insertions, 9 deletions
diff --git a/lisp/calc/calc-prog.el b/lisp/calc/calc-prog.el
index 640fa5b665c..05ec668cce9 100644
--- a/lisp/calc/calc-prog.el
+++ b/lisp/calc/calc-prog.el
@@ -671,7 +671,8 @@
671(defun calc-user-define-edit () 671(defun calc-user-define-edit ()
672 (interactive) ; but no calc-wrapper! 672 (interactive) ; but no calc-wrapper!
673 (message "Edit definition of command: z-") 673 (message "Edit definition of command: z-")
674 (let* ((key (read-char)) 674 (let* (cmdname
675 (key (read-char))
675 (def (or (assq key (calc-user-key-map)) 676 (def (or (assq key (calc-user-key-map))
676 (assq (upcase key) (calc-user-key-map)) 677 (assq (upcase key) (calc-user-key-map))
677 (assq (downcase key) (calc-user-key-map)) 678 (assq (downcase key) (calc-user-key-map))
@@ -720,17 +721,19 @@
720 721
721;; Formatting the macro buffer 722;; Formatting the macro buffer
722 723
724(defvar calc-edit-top)
725
723(defun calc-edit-macro-repeats () 726(defun calc-edit-macro-repeats ()
724 (goto-char calc-edit-top) 727 (goto-char calc-edit-top)
725 (while 728 (while
726 (re-search-forward "^\\([0-9]+\\)\\*" nil t) 729 (re-search-forward "^\\([0-9]+\\)\\*" nil t)
727 (setq num (string-to-int (match-string 1))) 730 (let ((num (string-to-int (match-string 1)))
728 (setq line (buffer-substring (point) (line-end-position))) 731 (line (buffer-substring (point) (line-end-position))))
729 (goto-char (line-beginning-position)) 732 (goto-char (line-beginning-position))
730 (kill-line 1) 733 (kill-line 1)
731 (while (> num 0) 734 (while (> num 0)
732 (insert line "\n") 735 (insert line "\n")
733 (setq num (1- num))))) 736 (setq num (1- num))))))
734 737
735(defun calc-edit-macro-adjust-buffer () 738(defun calc-edit-macro-adjust-buffer ()
736 (calc-edit-macro-repeats) 739 (calc-edit-macro-repeats)
@@ -916,7 +919,6 @@
916 (delete-char 3) 919 (delete-char 3)
917 (insert "<return>"))) 920 (insert "<return>")))
918 921
919(defvar calc-edit-top)
920(defun calc-edit-macro-finish-edit (cmdname key) 922(defun calc-edit-macro-finish-edit (cmdname key)
921 "Finish editing a Calc macro. 923 "Finish editing a Calc macro.
922Redefine the corresponding command." 924Redefine the corresponding command."