1

I want to check if there is an update for the org package every time my emacs daemon starts. I was looking at package.el for clues on how to check if the current version of a package was older than the version available in the package repository of GNU and Org, but I couldn't follow the code in package-menu--find-upgrades, so I'm not sure how should I get the package version of the installed package and the version of the package available for the upgrade.

0

Have a look at the package: auto-package-update

This package provides functionality for automatically updating your Emacs packages periodically. It is specially useful for people that work in multiple machines and tend to forget to manually update packages from time to time.

The main idea is that you set a desired periodicity for the updates, and when you start Emacs, the packages will be automatically updated if enough days have passed since the last update.

This snippet shows you if a package is up-to-date:

(require 'package)
(let* ((newest-desc (cadr (assq package package-archive-contents)))
           (installed-desc (cadr (or (assq package package-alist)
                                     (assq package package--builtins))))
           (newest-version  (package-desc-version newest-desc))
           (installed-version (package-desc-version installed-desc)))
      (version-list-<= newest-version installed-version))
  • 2
    Thanks for suggesting a solution. It is necessary to have all-inclusive answers. If the answer has links that point to external web-sites, then there is no guarantee that that link is function as now in future; thus deeming the answer useless. You can put the link as reference, but please also provide the necessary code within the answer itself. – Kaushal Modi Jun 10 '16 at 13:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.