Skip to content
This repository has been archived by the owner on Oct 21, 2022. It is now read-only.

Commit

Permalink
Rename paradox--refresh-star-count to paradox--refresh-remote-data
Browse files Browse the repository at this point in the history
It is now responsible for multiple data hashes. Also cleanup some
spelling and formatting.
  • Loading branch information
sambrightman committed Nov 15, 2016
1 parent b693226 commit 5c17338
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# make all
#

VERSIONS = 24.2 24.3 24.4 25.1
VERSIONS = 24.2 24.3 24.4 24.5 25.1

all :: $(VERSIONS)

Expand Down
11 changes: 6 additions & 5 deletions paradox-menu.el
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ Return (PKG-DESC [STAR NAME VERSION STATUS DOC])."
(or homepage
(and (setq extras (gethash name paradox--package-repo-list))
(format "https://github.com/%s" extras)))))

(defun paradox--get-or-return-package (pkg)
"Take a marker or package name PKG and return a package name."
(if (or (markerp pkg) (null pkg))
Expand Down Expand Up @@ -344,8 +345,8 @@ automatically decides whether to download asynchronously based on
(paradox--update-downloads-in-progress 'paradox--data))
`(package--with-work-buffer ,location ,file ,@body)))

(defun paradox--refresh-star-count ()
"Download the star-count file and populate the respective variable."
(defun paradox--refresh-remote-data ()
"Download metadata and populate the respective variables."
(interactive)
(when (boundp 'package--downloads-in-progress)
(add-to-list 'package--downloads-in-progress 'paradox--data))
Expand All @@ -369,11 +370,11 @@ automatically decides whether to download asynchronously based on
'paradox-star-face))))

(defun paradox--star-predicate (A B)
"Non-nil t if star count of A is larget than B."
"Non-nil t if star count of A is larger than B."
(> (string-to-number (elt (cadr A) paradox--column-index-star))
(string-to-number (elt (cadr B) paradox--column-index-star))))
(defun paradox--download-predicate (A B)
"Non-nil t if download count of A is larget than B."
"Non-nil t if download count of A is larger than B."
(> (get-text-property 0 'value (elt (cadr A) paradox--column-index-download))
(get-text-property 0 'value (elt (cadr B) paradox--column-index-download))))

Expand Down Expand Up @@ -510,7 +511,7 @@ Letters do not insert themselves; instead, they are commands.
(setq tabulated-list-sort-key (cons "Status" nil))
(add-hook 'tabulated-list-revert-hook #'paradox-menu--refresh nil t)
(add-hook 'tabulated-list-revert-hook #'paradox-refresh-upgradeable-packages nil t)
;; (add-hook 'tabulated-list-revert-hook #'paradox--refresh-star-count nil t)
;; (add-hook 'tabulated-list-revert-hook #'paradox--refresh-remote-data nil t)
(add-hook 'tabulated-list-revert-hook #'paradox--update-mode-line 'append t)
(tabulated-list-init-header)
;; We need package-menu-mode to be our parent, otherwise some
Expand Down
4 changes: 2 additions & 2 deletions paradox.el
Original file line number Diff line number Diff line change
Expand Up @@ -152,14 +152,14 @@ for packages.
(unless no-fetch
(if is-25
(add-to-list 'package--downloads-in-progress 'paradox--data)
(paradox--refresh-star-count)))
(paradox--refresh-remote-data)))
(package-list-packages no-fetch)
(unless no-fetch
(when (stringp paradox-github-token)
(paradox--refresh-user-starred-list
(bound-and-true-p package-menu-async)))
(when is-25
(paradox--refresh-star-count))))))
(paradox--refresh-remote-data))))))

;;;###autoload
(defun paradox-upgrade-packages (&optional no-fetch)
Expand Down

0 comments on commit 5c17338

Please sign in to comment.