Disable Quelpa updates if not connected to the Internet

This commit is contained in:
contrapunctus 2022-05-31 12:15:34 +05:30
parent 36a81c2797
commit 165d57ce1b
1 changed files with 5 additions and 1 deletions

View File

@ -63,8 +63,12 @@ Some background is important to understand my keybinding choices -
:fetcher git
:url "https://github.com/quelpa/quelpa-use-package.git"))
(require 'quelpa-use-package)
;; Don't upgrade Quelpa packages if there's no connectivity.
;; Courtesy https://emacs.stackexchange.com/a/18515
(defun my-internet-up-p (host)
(= 0 (call-process "ping" nil nil nil "-c" "1" "-W" "1" host)))
(setq quelpa-checkout-melpa-p nil
quelpa-upgrade-p t)
quelpa-upgrade-p (my-internet-up-p "github.com"))
#+END_SRC
* TODO dvorak [60%]