comparison lisp/kmacro.el @ 47361:5e3418a37a64

(kmacro-call-macro): Deal with a non-numeric prefix arg.
author Miles Bader <miles@gnu.org>
date Tue, 10 Sep 2002 01:23:22 +0000
parents 5a8754f590f4
children 56bcf85aafae
comparison
equal deleted inserted replaced
47360:c17030759a04 47361:5e3418a37a64
581 last-input-event)) 581 last-input-event))
582 repeat-key-str) 582 repeat-key-str)
583 (if end-macro 583 (if end-macro
584 (kmacro-end-macro arg) 584 (kmacro-end-macro arg)
585 (call-last-kbd-macro arg #'kmacro-loop-setup-function)) 585 (call-last-kbd-macro arg #'kmacro-loop-setup-function))
586 (when (consp arg)
587 (setq arg (car arg)))
586 (when (and (or (null arg) (> arg 0)) 588 (when (and (or (null arg) (> arg 0))
587 (setq repeat-key 589 (setq repeat-key
588 (if (eq kmacro-call-repeat-key t) repeat-key kmacro-call-repeat-key))) 590 (if (eq kmacro-call-repeat-key t)
591 repeat-key
592 kmacro-call-repeat-key)))
589 (setq repeat-key-str (format-kbd-macro (vector repeat-key) nil)) 593 (setq repeat-key-str (format-kbd-macro (vector repeat-key) nil))
590 (while repeat-key 594 (while repeat-key
591 (message "Repeat macro %swith `%s'..." 595 (message "Repeat macro %swith `%s'..."
592 (if (and kmacro-call-repeat-with-arg 596 (if (and kmacro-call-repeat-with-arg
593 arg (> arg 1)) 597 arg (> arg 1))
594 (format "%d times " arg) "") 598 (format "%d times " arg) "")
595 repeat-key-str) 599 repeat-key-str)
596 (if (equal repeat-key (read-event)) 600 (if (equal repeat-key (read-event))
597 (progn 601 (progn
598 (clear-this-command-keys t) 602 (clear-this-command-keys t)
599 (call-last-kbd-macro (and kmacro-call-repeat-with-arg arg) #'kmacro-loop-setup-function) 603 (call-last-kbd-macro (and kmacro-call-repeat-with-arg arg)
604 #'kmacro-loop-setup-function)
600 (setq last-input-event nil)) 605 (setq last-input-event nil))
601 (setq repeat-key nil))) 606 (setq repeat-key nil)))
602 (when last-input-event 607 (when last-input-event
603 (clear-this-command-keys t) 608 (clear-this-command-keys t)
604 (setq unread-command-events (list last-input-event)))))) 609 (setq unread-command-events (list last-input-event))))))