emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/pacmacs 375d85e49b 344/472: Add pacmacs-replay-finished-ho


From: ELPA Syncer
Subject: [nongnu] elpa/pacmacs 375d85e49b 344/472: Add pacmacs-replay-finished-hook
Date: Thu, 6 Jan 2022 21:59:38 -0500 (EST)

branch: elpa/pacmacs
commit 375d85e49bf417dec4dad49065f3d4e977cac74c
Author: rexim <reximkut@gmail.com>
Commit: rexim <reximkut@gmail.com>

    Add pacmacs-replay-finished-hook
    
    It will help to write scripts for automated it cases replaying
---
 tools/pacmacs-rr.el | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/tools/pacmacs-rr.el b/tools/pacmacs-rr.el
index 31e2ed87a4..b673e112e4 100644
--- a/tools/pacmacs-rr.el
+++ b/tools/pacmacs-rr.el
@@ -42,6 +42,7 @@
 (defvar pacmacs--tick-counter 0)
 (defvar pacmacs--recorded-actions nil)
 (defvar pacmacs--tick-times nil)
+(defvar pacmacs-replay-finished-hook nil)
 
 (defun pacmacs--record-action (action-name)
   (add-to-list 'pacmacs--recorded-actions
@@ -97,12 +98,13 @@
                (pacmacs--measure-time
                 (pacmacs-tick)))
 
-  (if (not pacmacs--recorded-actions)
-      (pacmacs-quit)
-    (-let ((((action . tick-number) . _) pacmacs--recorded-actions))
-      (when (= tick-number pacmacs--tick-counter)
-        (funcall action)
-        (setq pacmacs--recorded-actions (cdr pacmacs--recorded-actions))))))
+  (if pacmacs--recorded-actions
+      (-let ((((action . tick-number) . _) pacmacs--recorded-actions))
+        (when (= tick-number pacmacs--tick-counter)
+          (funcall action)
+          (setq pacmacs--recorded-actions (cdr pacmacs--recorded-actions))))
+    (pacmacs-quit)
+    (run-hooks 'pacmacs-replay-finished-hook)))
 
 (define-derived-mode pacmacs-it-recorder-mode pacmacs-mode 
"pacmacs-it-recorder-mode"
   (define-key pacmacs-it-recorder-mode-map (kbd "<up>") 'pacmacs-record-up)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]