sulami/literate-calc-mode.el

org-todo: Match data clobbered by buffer modification hooks

joekain opened this issue · 2 comments

Hi this package seems awesome but I've run into one problem.

I have (setq org-log-done 'time) in my config and when I have literate-calc-minor-mode enabled then marking an org TODO item done gives the following message:

org-todo: Match data clobbered by buffer modification hooks

and no timestamp is inserted.

I just had the same issue. With some quick testing, I believe it's fixed by wrapping the body of literate-calc--process-line with a call to save-match-data. I'll submit a PR for evaluation by @sulami, but in the meantime, you can try pasting the following into your config:

(defun ad-wrap-with-save-match-data (fn &rest args)
  (save-match-data
    (apply fn args)))

(advice-add 'literate-calc--process-line :around #'ad-wrap-with-save-match-data)

This appears to fix a few other issues I had with using this mode in org-buffers, like broken commands for manipulating timestamps.

Thanks! This is working for me now.