How can I tell emacs init el to tell/warn me if the emacs version behind the latest cutting edge version published on the internet.
I forgot to mention: I'm a mostly up to date MacOS user
How can I tell emacs init el to tell/warn me if the emacs version behind the latest cutting edge version published on the internet.
I forgot to mention: I'm a mostly up to date MacOS user
GNU Emacs Release History displays the latest version of Emacs, here is a little command utilizing the page.
(defun chunyang-check-emacs-update ()
"Check for Emacs update."
(interactive)
(url-retrieve
"https://www.gnu.org/software/emacs/history.html"
(lambda (status)
(pcase (plist-get status :error)
('nil (let ((latest (save-match-data
(re-search-forward "Emacs \\([.0-9]+\\) released")
(match-string 1))))
(if (version< emacs-version latest)
(warn "Your Emacs %s is outdated, upgrade it to %s"
emacs-version latest)
(message "You are running the latest version (%s) of Emacs"
emacs-version))))
(`(,error-symbol . ,data) (signal error-symbol data))))))
If you have directory with emacs repo then git
can help:
(with-temp-buffer
(shell-command
"cd /path/to/emacs--git; git remote update -p > /dev/null; git log --oneline ..@{u}"
(current-buffer))
(let ((cnt (count-lines (point-min) (point-max))))
(when (> cnt 0)
(message "Emacs version behind the latest cutting edge version published on the internet by %d commit(s)." cnt))))
Just change /path/to/emacs--git
to repo directory. In my case it is ~/Library/Caches/Homebrew/emacs--git
.