diff --git a/oni-core.el b/oni-core.el index 86b4b0b..3ee3b6a 100644 --- a/oni-core.el +++ b/oni-core.el @@ -4,7 +4,7 @@ ;; Author: Tom Willemse ;; Keywords: local -;; Version: 2020.0426.153115 +;; Version: 2020.0426.214442 ;; Package-Requires: (oni-data-dir expand-region multiple-cursors embrace helpful) ;; This program is free software; you can redistribute it and/or modify @@ -81,6 +81,11 @@ (end-of-line))) (end-of-line)))) +(defun oni-core-recentf-save-list-silently () + "Call ‘recentf-save-list’ but without showing a message about it." + (let ((inhibit-message t)) + (recentf-save-list))) + (add-to-list 'auto-save-file-name-transforms `(".*" ,oni-core--auto-save-directory t) :append) @@ -149,12 +154,7 @@ (unless oni-core--recentf-idle-timer (setq oni-core--recentf-idle-timer - (run-with-idle-timer - 10 - t - (lambda () - (let ((inhibit-message t)) - (recentf-save-list)))))) + (run-with-idle-timer 10 t #'oni-core-recentf-save-list-silently))) (electric-indent-mode -1) (winner-mode) diff --git a/test/oni-core-test.el b/test/oni-core-test.el index eb9886e..b9cf0d2 100644 --- a/test/oni-core-test.el +++ b/test/oni-core-test.el @@ -65,6 +65,6 @@ ;; We already loaded it with the ‘require’ call above. We load it again so we ;; can check that the timer set up in it doesn’t appear twice. (load-library "oni-core") - (let* ((pred (lambda (elt) (eq 'recentf-save-list (aref elt 5)))) + (let* ((pred (lambda (elt) (eq 'oni-core-recentf-save-list-silently (aref elt 5)))) (matches (delete nil (mapcar pred timer-idle-list)))) (should (eq 1 (length matches)))))