 (defun kotct/package-latest-available (package)
   "Get the lastest-available package-desc for PACKAGE, preferring repositories
 as listed in `package-archive-priorities' or `kotct/package-ordered-archives'.
+
 Does not automatically refresh the package list."
   (if (version< emacs-version "25.1")
       ;; no package-archive-priorities, so use kotct/package-ordered-archives


;;;###autoload
(defun kotct/packup ()
  "Creates an interactive buffer to install/update packages."
  (interactive)
  (let ((old-buf (current-buffer))
        (buffer (get-buffer-create "*packup*")))

    (cadr (assoc package package-archive-contents))))

(defun kotct/package-up-to-date-p (package)
  "Return non-nil if PACKAGE is installed and up-to-date.

Does not automatically refresh package list.
Before Emacs 25, we have to manually check in preferred-repository order."
  (let ((latest (kotct/package-latest-available package)))
    (when latest
      (package-installed-p package (package-desc-version latest)))))

(defun kotct/packup-insert-package-row (package-name package-desc-version)
  "Insert a package row into current buffer."
  (let ((inhibit-read-only t))
    (insert (format "[%c] %s -> %s\n" kotct/packup-marker-char package-name package-desc-version))))

