emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] [PATH] Speedups to org-table-recalculate


From: Nicolas Goaziou
Subject: Re: [O] [PATH] Speedups to org-table-recalculate
Date: Sat, 22 Nov 2014 00:30:31 +0100

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,



reply via email to

[Prev in Thread] Current Thread [Next in Thread]