Could you help me with smarter way of handling package-archives? At the moment I have the following in my init.el
;; This is dumb but...
(if (eq system-type 'windows-nt)
(setq package-archives '(("elpa" . "http://elpa.gnu.org/packages/")
("melpa" . "http://melpa.org/packages/")))
(setq package-archives '(("elpa" . "https://elpa.gnu.org/packages/")
("melpa" . "https://melpa.org/packages/"))))
Can I make it more DRY? Like this one (doesn't work):
(defvar package-protocol "https://")
(if (eq system-type 'windows-nt) (setq package-protocol "http://"))
(setq package-archives '(("elpa" . (concat package-protocol "elpa.gnu.org/packages/"))
("melpa" . (concat package-protocol "melpa.org/packages/")))))
thx, combined from the answers, using local variable:
;; Set up packaging system
(let ((package-protocol (if (eq system-type 'windows-nt) "http://" "https://")))
(setq package-archives `(("elpa" . ,(concat package-protocol "elpa.gnu.org/packages/"))
("melpa" . ,(concat package-protocol "melpa.org/packages/")))))