kmacro-x

a fork of vifon's kmacro-x
git clone https://git.trogloxene.org/kmacro-x.git
Log | Files | Refs | README | LICENSE

commit a351644a691cf9ef83a819daf8a5ba91b1c1865d
parent 262943ccca516241185eaa0b9bc9059c56f13191
Author: Wojciech Siewierski <wojciech@siewierski.eu>
Date:   Mon,  6 Mar 2023 01:53:19 +0100

Place the mark on the point position before macro execution

Diffstat:
Mkmacro-x-mc.el | 11+++++++++++
1 file changed, 11 insertions(+), 0 deletions(-)

diff --git a/kmacro-x-mc.el b/kmacro-x-mc.el @@ -219,6 +219,17 @@ argument behavior." (when (overlay-get ov 'region-active) (activate-mark)) (call-last-kbd-macro))) + ;; Push the original point to the `mark-ring', so it's easy to + ;; return there if needed. Calculated from the original cursor's + ;; overlay boundaries which should be correct even with the text + ;; before it shifting around. Note, this is the position from + ;; before the macro was recorded, not from right after it got + ;; recorded but before it got replayed. The latter would be + ;; a little more troublesome to calculate. Definitely possible but + ;; for now I don't see any benefit in one over the other. + (push-mark (let ((ov kmacro-x-mc-main-cursor)) + (+ (overlay-start ov) + (car (overlay-get ov 'offsets))))) (run-hooks 'kmacro-x-mc-post-apply-hook) (kmacro-x-mc-mode 0))