summaryrefslogtreecommitdiff
path: root/lisp/macros.el
diff options
context:
space:
mode:
authorJim Blandy <jimb@redhat.com>1991-08-14 22:50:16 +0000
committerJim Blandy <jimb@redhat.com>1991-08-14 22:50:16 +0000
commitbcc78bc020f3fee689e0a9d1a20e8b120868d650 (patch)
tree219f45d6b2a1a25129b5bcb7eb7886280f74b237 /lisp/macros.el
parenta755d8e506e4da8f7bb8a2094cf095e3d13cb8f8 (diff)
downloademacs-bcc78bc020f3fee689e0a9d1a20e8b120868d650.tar.gz
*** empty log message ***
Diffstat (limited to 'lisp/macros.el')
-rw-r--r--lisp/macros.el13
1 files changed, 8 insertions, 5 deletions
diff --git a/lisp/macros.el b/lisp/macros.el
index 8770ac58a2f..630565fbc5e 100644
--- a/lisp/macros.el
+++ b/lisp/macros.el
@@ -106,8 +106,8 @@ C-l -- redisplay screen and ask again."
;;;###autoload
(defun apply-macro-to-region-lines (top bottom &optional macro)
- "For each complete line in the current region, move to the beginning of
-the line, and run the last keyboard macro.
+ "For each complete line between point and mark, move to the beginning
+of the line, and run the last keyboard macro.
When called from lisp, this function takes two arguments TOP and
BOTTOM, describing the current region. TOP must be before BOTTOM.
@@ -146,8 +146,11 @@ and then select the region of un-tablified names and use
`\\[apply-macro-to-region-lines]' to build the table from the names.
"
(interactive "r")
- (if (null last-kbd-macro)
- (error "No keyboard macro has been defined."))
+ (or macro
+ (progn
+ (if (null last-kbd-macro)
+ (error "No keyboard macro has been defined."))
+ (setq macro last-kbd-macro)))
(save-excursion
(let ((end-marker (progn
(goto-char bottom)
@@ -158,7 +161,7 @@ and then select the region of un-tablified names and use
(forward-line 1))
(while (< (point) end-marker)
(save-excursion
- (execute-kbd-macro (or macro last-kbd-macro)))
+ (execute-kbd-macro macro))
(forward-line 1)))))
;;;###autoload