summaryrefslogtreecommitdiff
path: root/lisp/calc/calc-prog.el
diff options
context:
space:
mode:
authorJay Belanger <jay.p.belanger@gmail.com>2005-02-19 20:01:01 +0000
committerJay Belanger <jay.p.belanger@gmail.com>2005-02-19 20:01:01 +0000
commit4601c4773bd86e2b36a73d4e0639e1bab1487181 (patch)
tree29271702bae840f0b27fbc4dd59f0caf54cf3639 /lisp/calc/calc-prog.el
parentdba763eec494a744c19b258647a82fed9281d4f0 (diff)
downloademacs-4601c4773bd86e2b36a73d4e0639e1bab1487181.tar.gz
emacs-4601c4773bd86e2b36a73d4e0639e1bab1487181.tar.bz2
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.
Diffstat (limited to 'lisp/calc/calc-prog.el')
-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 @@
(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 "<return>")))
-(defvar calc-edit-top)
(defun calc-edit-macro-finish-edit (cmdname key)
"Finish editing a Calc macro.
Redefine the corresponding command."