From 64fd1a5a59cfce55b0f91bdd68e13807fd52d03a Mon Sep 17 00:00:00 2001 From: Artur Malabarba Date: Tue, 13 Jan 2015 00:03:59 -0200 Subject: [PATCH] (package-install-file): Install packages from directory. --- lisp/ChangeLog | 1 + lisp/emacs-lisp/package.el | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 13a87225bad..b69df34e673 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -6,6 +6,7 @@ (package-dir-info): New function. Find package information for a directory. The return result is a `package-desc'. (package-install-from-buffer): Install packages from dired buffer. + (package-install-file): Install packages from directory. 2015-01-16 Jorgen Schaefer diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 78138e9ebcd..f585c0be47a 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -1368,8 +1368,12 @@ Downloads and installs required packages as needed." The file can either be a tar file or an Emacs Lisp file." (interactive "fPackage file name: ") (with-temp-buffer - (insert-file-contents-literally file) - (when (string-match "\\.tar\\'" file) (tar-mode)) + (if (file-directory-p file) + (progn + (setq default-directory file) + (dired-mode)) + (insert-file-contents-literally file) + (when (string-match "\\.tar\\'" file) (tar-mode))) (package-install-from-buffer))) (defun package-delete (pkg-desc) -- 2.39.5