Function: kmacro-menu--do-region
kmacro-menu--do-region is a byte-compiled function defined in
kmacro.el.gz.
Signature
(kmacro-menu--do-region FUNCTION)
Documentation
Run FUNCTION on macros in the region or on the current line at the line start.
If there is an active region, for each line in the region, move to the beginning of the line and apply FUNCTION to the table entry ID of the line. If there is no region, apply FUNCTION only to the table entry ID of the current line.
When there is no active region, advance to the beginning of the next line after applying FUNCTION.
Source Code
;; Defined in /usr/src/emacs/lisp/kmacro.el.gz
(defun kmacro-menu--do-region (function)
"Run FUNCTION on macros in the region or on the current line at the line start.
If there is an active region, for each line in the region, move to the
beginning of the line and apply FUNCTION to the table entry ID of the
line. If there is no region, apply FUNCTION only to the table entry ID
of the current line.
When there is no active region, advance to the beginning of the next
line after applying FUNCTION."
(if (use-region-p)
(save-excursion
(let* ((reg-beg (region-beginning))
(reg-end (region-end))
(line-beg (progn
(goto-char reg-beg)
(pos-bol)))
(line-end (progn
(goto-char reg-end)
(if (bolp)
reg-end
(pos-bol 2)))))
(goto-char line-beg)
(let ((id))
(while (and (< (point) line-end)
(setq id (tabulated-list-get-id)))
(kmacro-menu--assert-row id)
(funcall function id)
(forward-line 1)))))
(let ((id (tabulated-list-get-id)))
(kmacro-menu--assert-row id)
(goto-char (pos-bol))
(funcall function id)
(forward-line 1))))