Skip to content

Commit a82ef64

Browse files
committed
Only abort playback on C-g. WIP
During recording, I noticed certain last-input-events such as: (file-notify ((30 . 0) (modify) "2024-12-29 21-00-31.mkv" 0) file-notify--callback-inotify These are not so helpful, but since I don't immediately know the range of other such inputs, it was better to relax the checks. C-g is supported. Most users should know it and it will stop errant macros from proceeding to destroy the system. The comprehensive solution is to prevent fat-finger inputs in the first place. It would be better to also support having the macro just dump remaining events into unread-command-events whenever direction keys are called during playback. I might still want to bind in the special map to block unwanted fat fingers. It is the only way to ensure that they don't corrupt the recorded sequence.
1 parent f5e5c6e commit a82ef64

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

NEWS.org

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ Fixing bugs and filling some gaps in new features.
2929
- ~dslide-deck-forward~ no longer no-ops in some circumstances
3030
- kmacro action properly skips over non-matching directions when both forward and backward elements are present in a slide
3131
- 🚧 kmacro playback of =M-<return>= and =M-<backspace>= and others is now correct. There are likely more events that don't round trip nicely from ~last-kbd-macro~ through ~key-description~ and back through ~read-kbd-macro~. *File issues*.
32+
- 🚧 kmacro playback no longer aborts when inputs from file-notify etc occur. It can be quit with =C-g=. A more comprehensive solution is being developed.
3233
* v0.6.0 Fighting Spam 💌
3334
- There is less markup (especially for babel)
3435
- Old actions are easier to use

dslide.el

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2079,9 +2079,8 @@ some other input event and quit."
20792079
(let ((frequency (plist-get args :frequency))
20802080
(jitter (plist-get args :jitter))
20812081
(events (plist-get args :events))
2082-
(last-input (plist-get args :last-input))
20832082
(index (plist-get args :index)))
2084-
(if (eq last-input last-input-event)
2083+
(if (not (eq last-input-event 7))
20852084
(if (length> events index)
20862085
(let ((k (aref events index)))
20872086
(setq unread-command-events (if unread-command-events
@@ -2092,14 +2091,12 @@ some other input event and quit."
20922091
(run-with-timer
20932092
(dslide--laplace-jitter frequency jitter)
20942093
nil #'dslide--kmacro-reanimate
2095-
:last-input k
20962094
:events events :index (1+ index)
20972095
:frequency frequency :jitter jitter)))
20982096
(setq dslide--kmacro-timer nil))
20992097
;; TODO attempt to block unwanted input. Test other implementations.
21002098
(setq dslide--kmacro-timer nil)
2101-
(message "Out-of-band input detected: %s" last-input-event)
2102-
(message "Aborting playback."))))
2099+
(message "Playback quit."))))
21032100

21042101
(defun dslide--laplace-jitter (freq jitter)
21052102
"Mutate FREQ by JITTER shape parameter.

0 commit comments

Comments
 (0)