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