From 165d57ce1b8388408d1b34aab1bc542d87ee7d77 Mon Sep 17 00:00:00 2001 From: contrapunctus Date: Tue, 31 May 2022 12:15:34 +0530 Subject: [PATCH] Disable Quelpa updates if not connected to the Internet --- init.org | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/init.org b/init.org index f48f299..c98bc4b 100644 --- a/init.org +++ b/init.org @@ -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%]