Emacs: Refactor my/straight-check-last-update().

This commit is contained in:
tastytea 2020-03-30 00:22:28 +02:00
parent 8dda526768
commit db01e7d692
1 changed files with 6 additions and 5 deletions

View File

@ -1,6 +1,6 @@
;;; package-management.el --- Initialize package management -*- lexical-binding: t; -*-
;; Time-stamp: <2020-03-29T21:16:55+0200>
;; Time-stamp: <2020-03-30T00:21:50+0200>
;;; Commentary:
;; * Set up straight
@ -48,10 +48,11 @@
(defun my/straight-check-last-update ()
"Notify if 7 days have passed since the last package was built."
(let ((days 7))
(when (> (- (time-to-seconds)
(time-to-seconds (file-attribute-modification-time
(file-attributes (straight--build-dir)))))
(let ((days 7)
(mtime-seconds (time-to-seconds
(file-attribute-modification-time
(file-attributes (straight--build-dir))))))
(when (> (- (time-to-seconds) mtime-seconds)
(* 60 60 24 days))
(message "The last package update was more than %d days ago." days))))
(add-hook 'emacs-startup-hook #'my/straight-check-last-update)