core: remove unused functions

configuration-layer/load-or-install-protected-package
configuration-layer/load-or-install-package
This commit is contained in:
syl20bnr 2017-07-01 18:06:47 -04:00
parent dfad77dc47
commit 3419247ee8

View file

@ -2158,51 +2158,6 @@ depends on it."
(spacemacs-buffer//center-line)
(insert "\n")))))
(defun configuration-layer/load-or-install-protected-package
(pkg &optional install log file-to-load)
"Load PKG package, and protect it against being deleted as an orphan.
See `configuration-layer/load-or-install-package' for more information."
(push pkg configuration-layer--protected-packages)
(configuration-layer/load-or-install-package pkg log file-to-load))
(defun configuration-layer/load-or-install-package
(pkg &optional install log file-to-load)
"Load PKG package. PKG will be installed if it is not already installed.
Whenever the initial require fails the absolute path to the package
directory is returned.
If INSTALL is non-nil then try to install the package if needed.
If LOG is non-nil a message is displayed in spacemacs-buffer-mode buffer.
FILE-TO-LOAD is an explicit file to load after the installation."
(let ((warning-minimum-level :error))
(unless (require pkg nil 'noerror)
;; not installed, we try to initialize package.el only if required to
;; precious seconds during boot time
(require 'cl)
(let ((pkg-elpa-dir
(configuration-layer/get-elpa-package-install-directory pkg)))
(if pkg-elpa-dir
(add-to-list 'load-path pkg-elpa-dir)
;; install the package
(when install
(when log
(spacemacs-buffer/append
(format "Installing package: %s...\n" pkg))
(spacemacs//redisplay))
(configuration-layer/retrieve-package-archives 'quiet)
(let ((delayed-warnings-backup delayed-warnings-list))
(package-install pkg)
(unless init-file-debug
(setq delayed-warnings-list delayed-warnings-backup)))
(setq pkg-elpa-dir
(configuration-layer/get-elpa-package-install-directory pkg))))
(unless (configuration-layer/get-package pkg)
(let ((obj (configuration-layer/make-package pkg 'system)))
(configuration-layer//add-package obj)))
(require pkg nil 'noerror)
(when file-to-load
(load-file (concat pkg-elpa-dir file-to-load)))
pkg-elpa-dir))))
(defun configuration-layer//get-indexed-elpa-package-names ()
"Return a list of all ELPA packages in indexed packages and dependencies."
(let (result)