Created
January 17, 2017 17:40
-
-
Save kaz-yos/4225e5fcc4bd93149cd123a7793f9af9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; Suppress messages | |
;; http://qiita.com/itiut@github/items/d917eafd6ab255629346 | |
;; http://emacs.stackexchange.com/questions/14706/suppress-message-in-minibuffer-when-a-buffer-is-saved | |
(defmacro with-suppressed-message (&rest body) | |
"Suppress new messages temporarily in the echo area and the `*Messages*' buffer while BODY is evaluated." | |
(declare (indent 0)) | |
(let ((message-log-max nil)) | |
`(with-temp-message (or (current-message) "") ,@body))) | |
;;; | |
;;; super-save.el | |
;; http://emacsredux.com/blog/2016/01/30/super-save/ | |
;; https://github.com/bbatsov/super-save | |
(use-package super-save | |
:config | |
;; https://www.gnu.org/software/emacs/manual/html_node/elisp/Advising-Functions.html | |
(defun quiet-super-save-command (orig-fun) | |
(with-suppressed-message (funcall orig-fun))) | |
(advice-add 'super-save-command | |
:around | |
#'quiet-super-save-command) | |
;; Only when idle for some time | |
;; This is active in ssh buffers, too | |
(setq super-save-auto-save-when-idle t) | |
(setq super-save-idle-duration 5) | |
;; Activate | |
(super-save-mode +1)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment