diff options
author | Kim F. Storm <storm@cua.dk> | 2006-05-05 23:37:37 +0000 |
---|---|---|
committer | Kim F. Storm <storm@cua.dk> | 2006-05-05 23:37:37 +0000 |
commit | 4224caf8571da124f7b9a45e7560ef56e5626bc3 (patch) | |
tree | 83664bdb71a1e54ebe0ea540e6c7e867fb2fb5ed /lisp/kmacro.el | |
parent | 77e5aef9ad757adbb7e4a64156cdab82a036059d (diff) | |
download | emacs-4224caf8571da124f7b9a45e7560ef56e5626bc3.tar.gz |
(kmacro-push-ring): Use add-to-history.
(kmacro-ring-length): Remove unused defun.
(kmacro-start-macro): Use kmacro-push-ring.
Diffstat (limited to 'lisp/kmacro.el')
-rw-r--r-- | lisp/kmacro.el | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/lisp/kmacro.el b/lisp/kmacro.el index 4566d4c32c3..e54b65ddb34 100644 --- a/lisp/kmacro.el +++ b/lisp/kmacro.el @@ -349,10 +349,7 @@ and `kmacro-counter-format'.") (defun kmacro-push-ring (&optional elt) "Push ELT or current macro onto `kmacro-ring'." (when (setq elt (or elt (kmacro-ring-head))) - (let ((len (length kmacro-ring))) - (setq kmacro-ring (cons elt kmacro-ring)) - (if (>= len kmacro-ring-max) - (setcdr (nthcdr len kmacro-ring) nil))))) + (add-to-history 'kmacro-ring elt kmacro-ring-max t))) (defun kmacro-split-ring-element (elt) @@ -377,11 +374,6 @@ Non-nil arg RAW means just return raw first element." (kmacro-pop-ring1 raw))) -(defun kmacro-ring-length () - "Return length of macro ring, including pseudo head." - (+ (if last-kbd-macro 1 0) (length kmacro-ring))) - - (defun kmacro-ring-empty-p (&optional none) "Tell user and return t if `last-kbd-macro' is nil or `kmacro-ring' is empty. Check only `last-kbd-macro' if optional arg NONE is non-nil." @@ -577,13 +569,8 @@ Use \\[kmacro-bind-to-key] to bind it to a key sequence." (let ((append (and arg (listp arg)))) (unless append (if last-kbd-macro - (let ((len (length kmacro-ring))) - (setq kmacro-ring - (cons - (list last-kbd-macro kmacro-counter kmacro-counter-format-start) - kmacro-ring)) - (if (>= len kmacro-ring-max) - (setcdr (nthcdr len kmacro-ring) nil)))) + (kmacro-push-ring + (list last-kbd-macro kmacro-counter kmacro-counter-format-start))) (setq kmacro-counter (or (if arg (prefix-numeric-value arg)) kmacro-initial-counter-value 0) |