bbatsov / super-save

Save Emacs buffers when they lose focus
313 stars 20 forks source link

Would it be possible to completely disable all modification notices? #28

Closed alienbogart closed 2 years ago

alienbogart commented 5 years ago

I tried (set-buffer-modified-p nil) (setq set-buffer-modified-p nil) but it doesn't seem to work.

zino23 commented 2 years ago

TL; DR

(defun suppress-message-advice (old-func &rest args)
  "Stop logging and displaying saving related messages in echo area.
Explicitly call OLD-FUNC with ARGS"
  (let (message-log-max)
    (with-temp-message (or (current-message) "")
      (apply old-func args))))

(use-package super-save
  :diminish
  :config
  (super-save-mode t)
  (advice-add 'super-save-command :around 'suppress-message-advice)
  (setq super-save-auto-save-when-idle t))

More details: super-save produces two kinds of messages, "Saving file ..." invoked by save-buffer; "Wrote ..." by write-region C primitive when Emacs actually writes the file to disk. Disable these two altogether when super-save does its work should be a sane decision

alienbogart commented 2 years ago

That works, thanks!