Skip to content

Commit d44c3e1

Browse files
committed
Allow location to be priority
1 parent 9b7153a commit d44c3e1

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

lisp/_prepare.el

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -785,10 +785,19 @@ Eask file in the workspace."
785785
786786
If LOCATION is a URL string, replace the default URL from `eask-source-mapping'
787787
to it's value. Optional argument PRIORITY can be use to register to variable
788-
`package-archive-priorities'."
788+
`package-archive-priorities'.
789+
790+
If LOCATION is a number, it will be treated like PRIORITY. When both optional
791+
arguments LOCATION and PRIORITY are defined in number, then we will respect the
792+
latter one."
789793
(when (assoc name package-archives)
790794
(eask-error "Multiple definition of source `%s'" name))
791-
(setq location (or location (cdr (assq (intern name) eask-source-mapping))))
795+
(let ((default-location (cdr (assq (intern name) eask-source-mapping))))
796+
(cond ((numberp location)
797+
(setq priority (or priority location) ; still respect priority
798+
location default-location))
799+
(t
800+
(setq location (or location default-location)))))
792801
(unless location (eask-error "Unknown package archive `%s'" name))
793802
(when (and location
794803
(gnutls-available-p)

0 commit comments

Comments
 (0)