Dieter Deyke <[email protected]> writes:

> (defun add-fitness (steps km kcal)
>   "Add fitness data (STEPS KM KCAL)."
>   (interactive "nsteps: \nnkm: \nnkcal: ")
>   (find-file (locate-user-emacs-file "org/fitness.org"))
>   (goto-char (point-max))
>   (forward-line -1)
>   (insert (format-time-string "| <%Y-%m-%d %a %H:%M> | ") (number-to-string 
> steps) " | " (number-to-string km) " | " (number-to-string kcal) " | | | |\n")
>   (if (string-search "Sat " (current-time-string))
>       (insert "|--\n"))
>   (forward-line -1)
>   (org-ctrl-c-ctrl-c)
>   (org-ctrl-c-star)
>   (save-buffer))

Works in my tests (and emacs -Q)

> but it stopped working a couple of days ago and now throws an error. I
> guess that I am not supposed to call org-ctrl-c-ctrl-c and
> org-ctrl-c-star in this way from a program, but I cannot figure out the
> correct way to get what I need. Can you point me in the right direction?

It would help if you shared the error.
See https://orgmode.org/manual/Feedback.html#Feedback

-- 
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