|
From: | Nathaniel Flath |
Subject: | Re: [O] [PATH] Speedups to org-table-recalculate |
Date: | Mon, 1 Dec 2014 01:15:20 -0500 |
Changed it to just a function - you are correct, for this purpose I don't need a macro.On Fri, Nov 21, 2014 at 6:30 PM, Nicolas Goaziou <address@hidden> wrote:Nathaniel Flath <address@hidden> writes:
> OK, I think I fixed that.
Thanks.
I didn't verify it compiles, but your macro still looks suspicious.
> +(defmacro org-table-execute-once-per-second (t1 &rest body)
> + "If there has been more than one second since T1, execute BODY.
> +Updates T1 to 'current-time' if this condition is met. If T1 is
> +nil, always execute body."
> + `(let ((t1 ,t1))
> + (if t1
> + (let ((curtime (current-time)))
> + (when (< 0 (nth 1 (time-subtract curtime t1)))
> + (setq t1 curtime)
> + ,@body))
> + ,@body)))
You shouldn't splice BODY twice in your macro. Also, I don't get why you
need to (setq t1 curtime).
Do you need a macro at all for this task? ISTM you only need to display
a message conditionally and update a time value.
Regard,
0001-org-table.el-org-table-recalculate-early-returns(1).patch
Description: Binary data
0001-org-table.el-org-table-recalculate-is-quieter.patch
Description: Binary data
[Prev in Thread] | Current Thread | [Next in Thread] |