1
0
Fork 0

Fix oni-core tests

This commit is contained in:
Tom Willemse 2020-04-26 21:45:30 -07:00
parent 18807d5461
commit 3da3700fae
2 changed files with 8 additions and 8 deletions

View file

@ -4,7 +4,7 @@
;; Author: Tom Willemse <tom@ryuslash.org> ;; Author: Tom Willemse <tom@ryuslash.org>
;; Keywords: local ;; Keywords: local
;; Version: 2020.0426.153115 ;; Version: 2020.0426.214442
;; Package-Requires: (oni-data-dir expand-region multiple-cursors embrace helpful) ;; Package-Requires: (oni-data-dir expand-region multiple-cursors embrace helpful)
;; This program is free software; you can redistribute it and/or modify ;; This program is free software; you can redistribute it and/or modify
@ -81,6 +81,11 @@
(end-of-line))) (end-of-line)))
(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 (add-to-list 'auto-save-file-name-transforms
`(".*" ,oni-core--auto-save-directory t) `(".*" ,oni-core--auto-save-directory t)
:append) :append)
@ -149,12 +154,7 @@
(unless oni-core--recentf-idle-timer (unless oni-core--recentf-idle-timer
(setq oni-core--recentf-idle-timer (setq oni-core--recentf-idle-timer
(run-with-idle-timer (run-with-idle-timer 10 t #'oni-core-recentf-save-list-silently)))
10
t
(lambda ()
(let ((inhibit-message t))
(recentf-save-list))))))
(electric-indent-mode -1) (electric-indent-mode -1)
(winner-mode) (winner-mode)

View file

@ -65,6 +65,6 @@
;; We already loaded it with the require call above. We load it again so we ;; We already loaded it with the require call above. We load it again so we
;; can check that the timer set up in it doesnt appear twice. ;; can check that the timer set up in it doesnt appear twice.
(load-library "oni-core") (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)))) (matches (delete nil (mapcar pred timer-idle-list))))
(should (eq 1 (length matches))))) (should (eq 1 (length matches)))))