Skip to content

Commit

Permalink
Allow users to customise where the package list is downloaded from
Browse files Browse the repository at this point in the history
See #6
  • Loading branch information
Wilfred committed Oct 27, 2018
1 parent 4eff295 commit 216cd16
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pip-requirements.el
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@
:type 'hook
:risky t)

(defcustom pip-requirements-index-url
"https://pypi.org/simple/"
"The URL used to fetch the list of packages used for completion."
:group 'pip-requirements
:type 'string)

;;;###autoload
(add-to-list 'auto-mode-alist
`(,(rx ".pip" string-end) . pip-requirements-mode))
Expand Down Expand Up @@ -122,7 +128,7 @@
"Get a list of all packages available on PyPI and store them in `pip-packages'.
Assumes Emacs is compiled with libxml."
(setq pip-http-buffer
(url-retrieve "https://pypi.org/simple/"
(url-retrieve pip-requirements-index-url
#'pip-requirements-callback nil t)))

(defun pip-requirements-complete-at-point ()
Expand Down

0 comments on commit 216cd16

Please sign in to comment.