Le 08/05/2020 à 15:44, Nicolas Goaziou a écrit :

> Hello,
>
> tbanelwebmin <tbanelweb...@free.fr> writes:
>
>> `org-table-align' may benefit from recent `org-table-to-lisp'
>> speed-up.
>>
>> The current code contains the following lines in org-table.el. They
>> parse the table into a Lisp structure, which is precisely what
>> `org-table-to-lisp' is supposed to do.
>>
>>   (fields (mapcar
>>            (lambda (l)
>>              (and (not (string-match-p org-table-hline-regexp l))
>>                   (org-split-string l "[ \t]*|[ \t]*")))
>>            (split-string (buffer-substring beg end) "\n" t)))
>>
>> Just replace them by a call to `org-table-to-lisp':
>>
>>   (fields (cl-loop for row in (org-table-to-lisp)
>>                   collect (and (listp row) row)))
> Good catch! I applied a similar change in master. Let me know how it
> goes.
>
> Thank you!
>
> Regards,
>
I ran again my benchmark with your patch. The Emacs profiler is not
accurate enough to tell which one among `mapcar' and `cl-loop' is
best. Anyway, your patch is perfect!

Thanks!


Reply via email to