5

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

american-ninja-warrior
  • 3,773
  • 2
  • 21
  • 40

2 Answers2

7

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))))))
xuchunyang
  • 14,302
  • 1
  • 18
  • 39
4

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.

muffinmad
  • 2,250
  • 7
  • 11