Skip to content

Commit

Permalink
Allow location to be priority
Browse files Browse the repository at this point in the history
  • Loading branch information
jcs090218 committed Dec 18, 2022
1 parent 9b7153a commit d44c3e1
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions lisp/_prepare.el
Original file line number Diff line number Diff line change
Expand Up @@ -785,10 +785,19 @@ Eask file in the workspace."
If LOCATION is a URL string, replace the default URL from `eask-source-mapping'
to it's value. Optional argument PRIORITY can be use to register to variable
`package-archive-priorities'."
`package-archive-priorities'.
If LOCATION is a number, it will be treated like PRIORITY. When both optional
arguments LOCATION and PRIORITY are defined in number, then we will respect the
latter one."
(when (assoc name package-archives)
(eask-error "Multiple definition of source `%s'" name))
(setq location (or location (cdr (assq (intern name) eask-source-mapping))))
(let ((default-location (cdr (assq (intern name) eask-source-mapping))))
(cond ((numberp location)
(setq priority (or priority location) ; still respect priority
location default-location))
(t
(setq location (or location default-location)))))
(unless location (eask-error "Unknown package archive `%s'" name))
(when (and location
(gnutls-available-p)
Expand Down

0 comments on commit d44c3e1

Please sign in to comment.