Commit be6dbd4b authored by Artur Malabarba's avatar Artur Malabarba

* emacs-lisp/package.el (package--read-pkg-desc): New function.

Read a `define-package' form in current buffer. Return the pkg-desc,
with desc-kind set to KIND.
parent 69f36afa
2015-01-16 Artur Malabarba <bruce.connor.am@gmail.com>
* emacs-lisp/package.el (package--read-pkg-desc): New
function. Read a `define-package' form in current buffer. Return
the pkg-desc, with desc-kind set to KIND.
2015-01-16 Jorgen Schaefer <contact@jorgenschaefer.de>
* emacs-lisp/package.el: Provide repository priorities.
......
......@@ -1277,19 +1277,25 @@ The return result is a `package-desc'."
(unless tar-desc
(error "No package descriptor file found"))
(with-current-buffer (tar--extract tar-desc)
(goto-char (point-min))
(unwind-protect
(let* ((pkg-def-parsed (read (current-buffer)))
(pkg-desc
(if (not (eq (car pkg-def-parsed) 'define-package))
(error "Can't find define-package in %s"
(tar-header-name tar-desc))
(apply #'package-desc-from-define
(append (cdr pkg-def-parsed))))))
(setf (package-desc-kind pkg-desc) 'tar)
pkg-desc)
(package--read-pkg-desc 'tar)
(kill-buffer (current-buffer))))))
(defun package--read-pkg-desc (kind)
"Read a `define-package' form in current buffer.
Return the pkg-desc, with desc-kind set to KIND."
(goto-char (point-min))
(unwind-protect
(let* ((pkg-def-parsed (read (current-buffer)))
(pkg-desc
(if (not (eq (car pkg-def-parsed) 'define-package))
(error "Can't find define-package in %s"
(tar-header-name tar-desc))
(apply #'package-desc-from-define
(append (cdr pkg-def-parsed))))))
(setf (package-desc-kind pkg-desc) kind)
pkg-desc)))
;;;###autoload
(defun package-install-from-buffer ()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment