You could try:
(defun my-run-fkpiawh ()
(remove-hook 'pre-command-hook #'my-run-fkpiawh)
(run-with-idle-timer 1200 t (lambda ()
After which you can use add functions to first-keypress-in-a-...
I guess a solution of your problem is setting a flag with an idle timer, https://www.gnu.org/software/emacs/manual/html_node/elisp/Idle-Timers.html
and checking/unsetting it with post-self-insert-hook or a similar hook of your choice.
The following works for me:
(defvar *my-idle-flag* nil)
(run-with-idle-timer 900 t (lambda () (setq *my-idle-flag* t)))
Idle timers won't be touched until the call stack has been cleared, so sitting won't actually help, it is only once all execution has stopped with the timer be run, so in your case, the idle timer won't run until 3 seconds of idle time after your whole test has run.
To combat this, you can call ert-run-idle-timers from ert-x.el in your test.
(defun run-with-local-idle-timer (secs repeat function &rest args)
"Like `run-with-idle-timer', but always runs in the `current-buffer'.
Cancels itself, if this buffer was killed."
(let* (;; Chicken and egg problem.
(fns (make-symbol "local-idle-timer"))
(timer (apply 'run-with-idle-timer secs repeat fns args))
A comment on this question mentions that a package named symon makes use of such a feature.
It is achieved by spamming non-logged messages when the minibuffer is inactive, and by stopping the redisplay everytime a command is issued. The boilerplate for that is rather short, and after a few minutes of usage, I couldn't notice any problems with that: messages ...
After three seconds of idleness, both timers will be triggered (and experimentally it is likely to be the second function which runs first, although I'm not sure if that's always going to be the case).
Executing an idle timer function does not cause Emacs to cease to be idle! That requires user input:
Emacs becomes "idle" when it starts waiting for user ...
(force-mode-line-update) or all with the optional t: "Force redisplay of the current buffer’s mode line and header line. With optional non-nil ALL, force redisplay of all mode lines and header lines. This function also forces recomputation of the menu bar menus and the frame title." Here is a link to the manual entry: https://www.gnu.org/software/emacs/...
I can't help with the pop up but, in place of that, I suggest that you use a bell sound.
You should have a wav sound file for this and you could use a bell sound like org-pomodoro's.
From C-h f org-timer-set-timer (org-timer-set-timer function help):
With two ‘C-u’ prefix arguments, use ‘org-timer-default-timer’ without
prompting the user for a ...
No idea whether this works, but what happens if you bind timer-idle-list to nil for the period when you want to prevent an idle timer from going off?
C-h v says that it's the list of active timers. If it's nil then maybe that will do what you want.
FWIW, I found timer-idle-list just by using C-h v and typing timer S-TAB, with Icicles (S-TAB does apropos ...
The O.P. could use advice to suppress messages for the function at issue, and there is an inhibit-message variable in recent versions of Emacs. However, it is such a small function that can easily be duplicated with a new name by commenting out the two calls to message.
How did I come to this solution? I opened Emacs 26.1 and typed: M-: (aka M-x eval-...
The minor mode buftime-mode defined below measures the active buffer time. By active buffer time I mean the time you are running commands interactively in the buffer.
The modeline displays the active buffer time in seconds as minor mode lighter in angular braces.
Note, that measuring the active buffer time is no replacement for work time clocking like org-...
The error means that the file was mis-compiled. More specifically, for some reason, when the file was byte-compiled, Emacs had no knowledge about the pabbrev-debug-message macro and hence assumed it must be a function.
How did you install pabbrev? The 4.2.1 version on GNU ELPA doesn't seem to suffer from such a problem on my end. I suggest you file a bug-...
The answer, IMO, is no. The echo area is for ephemeral messages. And lots of things explicitly erase anything that might have been echoed there. So realizing what you request in any reasonable way is problematic, IMO.
In sum, use an alternative. Here are some:
Use some other buffer (e.g. a small frame or window that you keep open for this purpose). Simple ...