mirror of
https://github.com/correl/melpa.git
synced 2024-12-22 19:17:27 +00:00
After interactively building a package, prompt to install locally
This commit is contained in:
parent
58bf468f42
commit
41c3ab7c49
1 changed files with 18 additions and 5 deletions
|
@ -672,6 +672,16 @@ FILES is a list of (SOURCE . DEST) relative filepath pairs."
|
|||
(let* ((entry (rassoc target files)))
|
||||
(when entry (car entry))))
|
||||
|
||||
(defun pb/find-package-file (name)
|
||||
"Return the filename of the most recently built package of NAME."
|
||||
(let* ((pkg-info (cdr (assoc name (package-build-archive-alist))))
|
||||
(version (package-version-join (aref pkg-info 0)))
|
||||
(flavour (aref pkg-info 3)))
|
||||
(expand-file-name
|
||||
(format "%s-%s.%s" name version (if (eq flavour 'single) "el" "tar"))
|
||||
package-build-archive-dir)))
|
||||
|
||||
|
||||
;;; Public interface
|
||||
;;;###autoload
|
||||
(defun package-build-archive (name)
|
||||
|
@ -818,11 +828,14 @@ FILES is a list of (SOURCE . DEST) relative filepath pairs."
|
|||
(save-buffer)
|
||||
(error "Aborting")))
|
||||
(package-build-reinitialize)
|
||||
(package-build-archive (intern (file-name-nondirectory (buffer-file-name))))
|
||||
(save-current-buffer
|
||||
(find-file-other-window
|
||||
(expand-file-name "archive-contents" package-build-archive-dir))
|
||||
(revert-buffer t t)))
|
||||
(let ((pkg-name (intern (file-name-nondirectory (buffer-file-name)))))
|
||||
(package-build-archive pkg-name)
|
||||
(save-current-buffer
|
||||
(find-file-other-window
|
||||
(expand-file-name "archive-contents" package-build-archive-dir))
|
||||
(revert-buffer t t))
|
||||
(when (yes-or-no-p "Install new package? ")
|
||||
(package-install-file (pb/find-package-file pkg-name)))))
|
||||
|
||||
(defun package-build-archive-ignore-errors (pkg)
|
||||
"Build archive for package PKG, ignoring any errors."
|
||||
|
|
Loading…
Reference in a new issue