kmacro-x

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

commit 184af61ba3766e9b7b4c8f341bed0de4412fdd2e
parent 3f58f5421b98b436122dba2514cf559a7359904d
Author: Wojciech Siewierski <wojciech@siewierski.eu>
Date:   Mon, 28 Apr 2025 19:48:05 +0200

Use with-undo-amalgamate, added in Emacs 29.1

Diffstat:
Mkmacro-x.el | 18++++++------------
1 file changed, 6 insertions(+), 12 deletions(-)

diff --git a/kmacro-x.el b/kmacro-x.el @@ -6,7 +6,7 @@ ;; URL: https://github.com/vifon/kmacro-x.el ;; Keywords: convenience ;; Version: 0.9 -;; Package-Requires: ((emacs "27.2")) +;; Package-Requires: ((emacs "29.1")) ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by @@ -60,18 +60,12 @@ (defun kmacro-x-undo-amalgamate-advice (orig &rest args) "Advice the ORIG function to amalgamate all the edits into one undo. -ARGS are passed verbatim to ORIG. - -An undo boundary is placed beforehand to ensure the consecutive -calls won't get auto-amalgamated." +ARGS are passed verbatim to ORIG." + ;; Place an `undo-boundary' to ensure the consecutive calls won't + ;; get auto-amalgamated. (undo-boundary) - (let ((cg (prepare-change-group))) - (unwind-protect - (progn - (activate-change-group cg) - (apply orig args)) - (undo-amalgamate-change-group cg) - (accept-change-group cg)))) + (with-undo-amalgamate + (apply orig args))) (provide 'kmacro-x)