From a3e31a11ac0dd2ae5b52fe2f184ffb2df4478fe9 Mon Sep 17 00:00:00 2001 From: David Florness Date: Wed, 6 Sep 2017 08:26:36 -0600 Subject: [PATCH] Check for gnutls when adding melpa package archive This is identical to the installation code on [melpa.org](http://melpa.org/#/getting-started) without the part for compatibility for emacs < 24 --- init.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/init.el b/init.el index 7c84c52..068f948 100644 --- a/init.el +++ b/init.el @@ -37,9 +37,10 @@ (require 'package) ;;; Add melpa archives -(add-to-list 'package-archives - '("melpa" . "https://melpa.org/packages/") - t) +(let* ((no-ssl (and (memq system-type '(windows-nt ms-dos)) + (not (gnutls-available-p)))) + (url (concat (if no-ssl "http" "https") "://melpa.org/packages/"))) + (add-to-list 'package-archives (cons "melpa" url) t)) ;;; Load and activate lisp packages (package-initialize) -- 2.38.4