           archive))
     ad-do-it))
 
-;;------------------------------------------------------------------------------
-;; On-demand installation of packages
-;;------------------------------------------------------------------------------
++
+;;; On-demand installation of packages
 
 (defun require-package (package &optional min-version no-refresh)
   "Ask elpa to install given PACKAGE, optionally requiring MIN-VERSION.

        (require-package package min-version t)))))


;;------------------------------------------------------------------------------
;; Standard package repositories
;;------------------------------------------------------------------------------

;; (add-to-list 'package-archives '("marmalade" . "http://marmalade-repo.org/packages/"))

;; We include the org repository for completeness, but don't use it.
;; lock org-mode temporarily
;; (add-to-list 'package-archives '("org" . "http://orgmode.org/elpa/"))


;; well, melpa does not bother supporting emacs23 any more, but cl-lib is still required
;; TODO: in half a year, I will remove gnu elpa because emacs 24.3 is the minimum version
(setq package-archives '(("gnu" . "http://elpa.gnu.org/packages/")
                         ("melpa" . "http://melpa.milkbox.net/packages/")
                         ("melpa-stable" . "http://melpa-stable.milkbox.net/packages/")
                         ))

;; Un-comment below line if you download zip file from https://github.com/redguardtoo/myelpa/archive/master.zip and extract its content into ~/myelpa/
;; (setq package-archives '(("myelpa" . "~/myelpa")))

;; Find and load the correct package.el

;; When switching between Emacs 23 and 24, we always use the bundled package.el in Emacs 24
(let ((package-el-site-lisp-dir
       (expand-file-name "site-lisp/package" user-emacs-directory)))
  (when (and (file-directory-p package-el-site-lisp-dir)
             (> emacs-major-version 23))
    (message "Removing local %s package.el from load-path to avoid shadowing bundled version" package-el-site-lisp-dir)
