Save all buffers on org refile

Just a quick word:

I had this bit of code I got from one of Dave’s streams to save all buffers after refiling so you wouldn’t have to save each buffer by hand.

(advice-add 'org-refile :after 'org-save-all-org-buffers)

Unfortunately, with org-ql, it gives an error. (It still refiles though).

So, I found the solution here:

Which is this:

(advice-add 'org-refile :after
        (lambda (&rest _)
        (org-save-all-org-buffers)))

I tested it with org-ql refiling and it does work perfectly. So any of you who were using that previous code and have issues with org-ql refiling, you can replace it with this and it should work.

5 Likes