simple repositories

This commit is contained in:
Jesús 2018-07-23 21:43:11 -05:00
parent 318d3479f5
commit ea49634a14
No known key found for this signature in database
GPG Key ID: F6EE7BC59A315766

View File

@ -2,20 +2,21 @@
;; Repositories
;; ================
(let* ((no-ssl (and (memq system-type '(windows-nt ms-dos))
(not (gnutls-available-p))))
(proto (if no-ssl "http" "https")))
;; Comment/uncomment these two lines to enable/disable MELPA and MELPA Stable as desired
(add-to-list 'package-archives (cons "melpa" (concat proto "://melpa.org/packages/")) t)
;;(add-to-list 'package-archives (cons "melpa-stable" (concat proto "://stable.melpa.org/packages/")) t)
(when (< emacs-major-version 24)
;; For important compatibility libraries like cl-lib
(add-to-list 'package-archives '("gnu" . (concat proto "://elpa.gnu.org/packages/")))))
(setq package-archives
'(("melpa" . "https://melpa.org/packages/")
;;("melpa-stable" . "https://stable.melpa.org/packages/")
("gnu" . "https://elpa.gnu.org/packages/")
("org" . "https://orgmode.org/elpa/")))
(setq package-archive-priorities
'(("melpa" . 4)
("melpa-stable" . 0)
("gnu" . 1)
("org" . 3)))
;; =================
;;; Find packages if not installed
;; =================
;; ================================
;;; On-demand installation of packages
(defun require-package (package &optional min-version no-refresh)
"Install given PACKAGE, optionally requiring MIN-VERSION.
@ -31,7 +32,7 @@ re-downloaded in order to locate PACKAGE."
(progn
(package-refresh-contents)
(require-package package min-version t)))))
;; =================
;; ================================
(package-initialize)