mirror of
https://github.com/masscollaborationlabs/emacs.git
synced 2025-07-05 11:49:37 +00:00
Merge pull request from Silex/master
Remove el-get support GitHub-reference: https://github.com/jwiegley/use-package/issues/64
This commit is contained in:
commit
ee0060c3a7
1 changed files with 0 additions and 102 deletions
|
@ -254,43 +254,6 @@
|
||||||
;;
|
;;
|
||||||
;; (use-package tex-site
|
;; (use-package tex-site
|
||||||
;; :ensure auctex)
|
;; :ensure auctex)
|
||||||
;;
|
|
||||||
;; * For el-get users
|
|
||||||
;;
|
|
||||||
;; You can use `use-package' as a way to create source definitions for el-get.
|
|
||||||
;; All that's needed is to add a `:type' keyword to your declaration. When
|
|
||||||
;; this is present, certain keywords get translated to what el-get expects in
|
|
||||||
;; the `el-get-sources' list:
|
|
||||||
;;
|
|
||||||
;; :config -> :after
|
|
||||||
;; :requires -> :depends
|
|
||||||
;;
|
|
||||||
;; A `:name' will be added also, if one is not provided explicitly, which will
|
|
||||||
;; be the same as the name of the package.
|
|
||||||
;;
|
|
||||||
;; But why would you want to use `use-package' when you have el-get? My
|
|
||||||
;; answer is that I'd like to use el-get to install and update some packages,
|
|
||||||
;; but I don't want it managing configuration. Just loading el-get -- without
|
|
||||||
;; call (el-get 'sync) -- takes a quarter second on my machine. That's 25% of
|
|
||||||
;; my load time! `use-package' is designed for performance, so I only want to
|
|
||||||
;; load el-get when it's time to install or update on of my used packages.
|
|
||||||
;;
|
|
||||||
;; Here is the `use-package' declaration I use for setting up el-get, but only
|
|
||||||
;; when I want to install or update:
|
|
||||||
;;
|
|
||||||
;; (defvar el-get-sources nil)
|
|
||||||
;;
|
|
||||||
;; (use-package el-get
|
|
||||||
;; :commands (el-get
|
|
||||||
;; el-get-install
|
|
||||||
;; el-get-update
|
|
||||||
;; el-get-list-packages)
|
|
||||||
;; :config
|
|
||||||
;; (defun el-get-read-status-file ()
|
|
||||||
;; (mapcar #'(lambda (entry)
|
|
||||||
;; (cons (plist-get entry :symbol)
|
|
||||||
;; `(status "installed" recipe ,entry)))
|
|
||||||
;; el-get-sources)))
|
|
||||||
|
|
||||||
;;; Code:
|
;;; Code:
|
||||||
|
|
||||||
|
@ -299,7 +262,6 @@
|
||||||
(require 'diminish nil t)
|
(require 'diminish nil t)
|
||||||
|
|
||||||
(declare-function package-installed-p 'package)
|
(declare-function package-installed-p 'package)
|
||||||
(declare-function el-get-read-recipe 'el-get)
|
|
||||||
|
|
||||||
(defgroup use-package nil
|
(defgroup use-package nil
|
||||||
"A use-package declaration for simplifying your `.emacs'."
|
"A use-package declaration for simplifying your `.emacs'."
|
||||||
|
@ -310,11 +272,6 @@
|
||||||
:type 'boolean
|
:type 'boolean
|
||||||
:group 'use-package)
|
:group 'use-package)
|
||||||
|
|
||||||
(defcustom use-package-debug nil
|
|
||||||
"Whether to report more information, mostly regarding el-get."
|
|
||||||
:type 'boolean
|
|
||||||
:group 'use-package)
|
|
||||||
|
|
||||||
(defcustom use-package-minimum-reported-time 0.01
|
(defcustom use-package-minimum-reported-time 0.01
|
||||||
"Minimal load time that will be reported"
|
"Minimal load time that will be reported"
|
||||||
:type 'number
|
:type 'number
|
||||||
|
@ -336,28 +293,6 @@
|
||||||
|
|
||||||
(put 'with-elapsed-timer 'lisp-indent-function 1)
|
(put 'with-elapsed-timer 'lisp-indent-function 1)
|
||||||
|
|
||||||
(defun use-package-discover-el-get-type (args)
|
|
||||||
(let* ((pkg-name (plist-get args :name))
|
|
||||||
(git-config (expand-file-name
|
|
||||||
(concat pkg-name "/.git/config")
|
|
||||||
(if (boundp 'user-site-lisp-directory)
|
|
||||||
user-site-lisp-directory
|
|
||||||
user-emacs-directory))))
|
|
||||||
|
|
||||||
(catch 'found
|
|
||||||
;; Look for a readable .git/config with at least one defined remote.
|
|
||||||
(if (file-readable-p git-config)
|
|
||||||
(with-temp-buffer
|
|
||||||
(insert-file-contents-literally git-config)
|
|
||||||
(while (re-search-forward "\\[remote" nil t)
|
|
||||||
(if (re-search-forward "url = \\(.+\\)"
|
|
||||||
(save-excursion
|
|
||||||
(re-search-forward "\\[remote" nil t)
|
|
||||||
(point)) t)
|
|
||||||
(nconc args (list :type 'git
|
|
||||||
:url (match-string 1))))))))
|
|
||||||
args))
|
|
||||||
|
|
||||||
(defvar use-package-idle-timer nil)
|
(defvar use-package-idle-timer nil)
|
||||||
(defvar use-package-idle-forms nil)
|
(defvar use-package-idle-forms nil)
|
||||||
|
|
||||||
|
@ -603,43 +538,6 @@ For full documentation. please see commentary.
|
||||||
`(load ,name t)
|
`(load ,name t)
|
||||||
`(require ',name nil t))))
|
`(require ',name nil t))))
|
||||||
|
|
||||||
,(when (boundp 'el-get-sources)
|
|
||||||
(require 'el-get)
|
|
||||||
|
|
||||||
(let ((recipe (ignore-errors
|
|
||||||
(el-get-read-recipe name-symbol))))
|
|
||||||
(if (null recipe)
|
|
||||||
(if use-package-debug
|
|
||||||
(message "No el-get recipe found for package `%s'"
|
|
||||||
name-symbol))
|
|
||||||
(setq args
|
|
||||||
(mapcar #'(lambda (arg)
|
|
||||||
(cond
|
|
||||||
((eq arg :config)
|
|
||||||
:after)
|
|
||||||
((eq arg :requires)
|
|
||||||
:depends)
|
|
||||||
(t
|
|
||||||
arg)))
|
|
||||||
args))
|
|
||||||
|
|
||||||
(nconc args (list :symbol (intern name-string)))
|
|
||||||
|
|
||||||
(let ((elem args))
|
|
||||||
(while elem
|
|
||||||
(unless (plist-get recipe (car elem))
|
|
||||||
(plist-put recipe (car elem) (cadr elem)))
|
|
||||||
(setq elem (cddr elem))))
|
|
||||||
|
|
||||||
(unless (plist-get recipe :name)
|
|
||||||
(nconc recipe (list :name name-string)))
|
|
||||||
|
|
||||||
(unless (plist-get recipe :type)
|
|
||||||
(setq recipe (use-package-discover-el-get-type recipe)))
|
|
||||||
|
|
||||||
(ignore
|
|
||||||
(setq el-get-sources (cons recipe el-get-sources))))))
|
|
||||||
|
|
||||||
,(if (or commands (plist-get args :defer))
|
,(if (or commands (plist-get args :defer))
|
||||||
(let (form)
|
(let (form)
|
||||||
(mapc #'(lambda (command)
|
(mapc #'(lambda (command)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue