Skip to content

Commit

Permalink
tweak(core): provide +lazy-delay
Browse files Browse the repository at this point in the history
  • Loading branch information
abougouffa committed Jul 24, 2023
1 parent c6dca7e commit 1ab081d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion elisp/+minemacs.el
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,11 @@ If NO-MESSAGE-LOG is non-nil, do not print any message to *Messages* buffer."
:group 'minemacs-core
:type 'float)

(defcustom +lazy-delay 1.0
"The default delay (in seconds) to consider in `+lazy!' macro."
:group 'minemacs-core
:type 'float)

;;;###autoload
(defun +eval-when-idle (delay &rest fns)
"Queue FNS to be processed when Emacs becomes idle."
Expand Down Expand Up @@ -180,7 +185,7 @@ If NO-MESSAGE-LOG is non-nil, do not print any message to *Messages* buffer."
(defmacro +lazy! (&rest body)
"Run BODY as a lazy block (see `minemacs-lazy')."
`(with-eval-after-load 'minemacs-lazy
(+eval-when-idle-for! 1.0
(+eval-when-idle-for! +lazy-delay
,@body)))

;;;###autoload
Expand Down

0 comments on commit 1ab081d

Please sign in to comment.