# HG changeset patch # User Jay Belanger # Date 1108843261 0 # Node ID 259cc4e04cd16d21406421f62fd4cde80c299b46 # Parent c396883e50695098ce387ef2f847bb035199decd (calc-user-define-edit): Add local variable. (calc-edit-top): Move declaration to earlier in file. (calc-edit-macro-repeats): Add local variables. diff -r c396883e5069 -r 259cc4e04cd1 lisp/calc/calc-prog.el --- a/lisp/calc/calc-prog.el Sat Feb 19 19:59:49 2005 +0000 +++ b/lisp/calc/calc-prog.el Sat Feb 19 20:01:01 2005 +0000 @@ -671,7 +671,8 @@ (defun calc-user-define-edit () (interactive) ; but no calc-wrapper! (message "Edit definition of command: z-") - (let* ((key (read-char)) + (let* (cmdname + (key (read-char)) (def (or (assq key (calc-user-key-map)) (assq (upcase key) (calc-user-key-map)) (assq (downcase key) (calc-user-key-map)) @@ -720,17 +721,19 @@ ;; Formatting the macro buffer +(defvar calc-edit-top) + (defun calc-edit-macro-repeats () (goto-char calc-edit-top) (while (re-search-forward "^\\([0-9]+\\)\\*" nil t) - (setq num (string-to-int (match-string 1))) - (setq line (buffer-substring (point) (line-end-position))) - (goto-char (line-beginning-position)) - (kill-line 1) - (while (> num 0) - (insert line "\n") - (setq num (1- num))))) + (let ((num (string-to-int (match-string 1))) + (line (buffer-substring (point) (line-end-position)))) + (goto-char (line-beginning-position)) + (kill-line 1) + (while (> num 0) + (insert line "\n") + (setq num (1- num)))))) (defun calc-edit-macro-adjust-buffer () (calc-edit-macro-repeats) @@ -916,7 +919,6 @@ (delete-char 3) (insert ""))) -(defvar calc-edit-top) (defun calc-edit-macro-finish-edit (cmdname key) "Finish editing a Calc macro. Redefine the corresponding command."