Q
: How, please, can I incorporate a visual seconds counter that will disappear when an option is selected, or when the clock runs out.
Example -- *Messages*
buffer
You have 10 seconds to make your selction.
You have 9 seconds to make your selection.
. . .
Time's up!
I have a variable that is called init-variable
. When non-nil
, Emacs loads with a full configuration of various user customizations. When nil
, Emacs loads with the equivalent of Emacs -Q
-- i.e., no user customizations are loaded. The function read-char-exclusive
has a nice feature for a seconds counter, and I've incorporated that feature into the code snippet below. Option number 1
sets the init-variable
to nil
; option number 2
or no action result in the default setting of non-nil
.
(defvar init-variable t)
(let* (
(emacs-q (read-char-exclusive nil nil 10)))
(cond
((eq emacs-q ?1)
(setq init-variable nil)
(message "Emacs -Q"))
((eq emacs-q ?2)
(message "Regular Loading."))
(t (message "This is the default.")) ))