Added set-alarm.

Pascal J. Bourguignon [2020-11-01 22:56]
Added set-alarm.
Filename
pjb-emacs.el
diff --git a/pjb-emacs.el b/pjb-emacs.el
index a71de92..b3bccaf 100644
--- a/pjb-emacs.el
+++ b/pjb-emacs.el
@@ -876,6 +876,18 @@ DO:     Insert in the current buffer a list of colors and
                       :key (function timer--function))))


+(defun alarm-ring (&optional name)
+  (message (if name
+               (format "Alarm %s!" name)
+               "Alarm!"))
+  (loop repeat 10 do (beep) (sleep 0.3)))
+
+(defun set-alarm (delay-seconds &optional name)
+  (interactive "NDelay (seconds): ")
+  (run-at-time delay-seconds nil 'alarm-ring name))
+
+
+
 (defun chronometre (lambda-body &optional outstream)
   "
 DO:     Chronometre the execution of `lambda-body'.
ViewGit