1

I use

(run-with-idle-timer 45 t 'org-save-all-org-buffers)

to automatically save all org-mode buffers when I am idling for 45 seconds. What I don't like about this is that it prints "All org-mode buffers have been saved" to the minibuffer. How can I prevent this output from being shown?

Drew
  • 75,699
  • 9
  • 109
  • 225
CrabMan
  • 255
  • 1
  • 5

1 Answers1

1

The O.P. could use advice to suppress messages for the function at issue, and there is an inhibit-message variable in recent versions of Emacs. However, it is such a small function that can easily be duplicated with a new name by commenting out the two calls to message.

How did I come to this solution? I opened Emacs 26.1 and typed: M-: (aka M-x eval-expression), and then (require 'org) + RET, and then I typed: M-x find-function RET org-save-all-org-buffers RET and took a peek see what makes it tick....

(defun my-org-save-all-org-buffers ()
  "Save all Org buffers without user confirmation."
  (interactive)
  ;;; (message "Saving all Org buffers...")
  (save-some-buffers t (lambda () (derived-mode-p 'org-mode)))
  (when (featurep 'org-id) (org-id-locations-save))
  ;;; (message "Saving all Org buffers... done")
  )

(run-with-idle-timer 45 t 'my-org-save-all-org-buffers)
lawlist
  • 18,826
  • 5
  • 37
  • 118