Slava Barinov <raysl...@gmail.com> writes:

> The :tblfm keyword adds formulas to the end of table so they are applied right
> after collection is done and the table is generated.
>
> * lisp/org-collector.el (org-dblock-write:propview): Add support for the
> :tblfm keyword.

Thanks for the patch, and do note that org-collector and other libraries
in org-contrib repository are only maintained minimally.

If you are an active user of org-collect and willing to contribute to
it, may I suggest you to consider stepping up as a maintainer?
See https://git.sr.ht/~bzg/org-contrib

> +     (when tblfm
> +       (save-excursion
> +            (goto-char (point-min))
> +            (when (re-search-forward "^#\\+TBLFM:" nil t)
> +              (setq tblfm-pos (match-beginning 0))
> +              (delete-region tblfm-pos (line-end-position))))
> +       (unless (looking-back "\n" 1)
> +            (insert "\n"))
> +       (insert (concat "#+TBLFM:" tblfm)))

I am not familiar with org-collector code, but (goto-char (point-min))
seems dangerous - what if current Org buffer has multiple tables with
TBLFM lines?

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>

Reply via email to