[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/vundo ecc0e2c367: Add special hook vundo-after-undo-fun
From: |
ELPA Syncer |
Subject: |
[elpa] externals/vundo ecc0e2c367: Add special hook vundo-after-undo-functions |
Date: |
Wed, 14 Jun 2023 03:59:54 -0400 (EDT) |
branch: externals/vundo
commit ecc0e2c3678ba1d879e1477c08c65c53b9237da6
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>
Add special hook vundo-after-undo-functions
The idea is to allow users to call functions that act on the
vundo--orig-buffer.
---
vundo.el | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/vundo.el b/vundo.el
index 29bd6599ec..4ad828c2d1 100644
--- a/vundo.el
+++ b/vundo.el
@@ -1117,6 +1117,11 @@ the INCREMENTAL option in `vundo--refresh-buffer'
anymore."
(message "Trimmed to: %s"
(vundo-m-idx possible-trim-point))))))
+(defvar vundo-after-undo-functions nil
+ "Special hook that runs after `vundo' motions.
+Functions aasigned to this hook are called with one argument: the
+original buffer `vundo' operates on.")
+
(defun vundo-forward (arg)
"Move forward ARG nodes in the undo tree.
If ARG < 0, move backward."
@@ -1145,7 +1150,8 @@ If ARG < 0, move backward."
vundo--orig-buffer dest vundo--prev-mod-list)
;; Refresh display.
(vundo--refresh-buffer
- vundo--orig-buffer (current-buffer) 'incremental))))))
+ vundo--orig-buffer (current-buffer) 'incremental))))
+ (run-hook-with-args 'vundo-after-undo-functions vundo--orig-buffer)))
(defun vundo-backward (arg)
"Move back ARG nodes in the undo tree.
@@ -1175,7 +1181,8 @@ If ARG < 0, move forward."
vundo--orig-buffer dest vundo--prev-mod-list)
(vundo--refresh-buffer
vundo--orig-buffer (current-buffer)
- 'incremental)))))))
+ 'incremental)))))
+ (run-hook-with-args 'vundo-after-undo-functions vundo--orig-buffer)))
(defun vundo-previous (arg)
"Move to node above the current one. Move ARG steps."
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [elpa] externals/vundo ecc0e2c367: Add special hook vundo-after-undo-functions,
ELPA Syncer <=