[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] scratch/install-package-from-directory 47d902c 4/5: (packa
From: |
Artur Malabarba |
Subject: |
[Emacs-diffs] scratch/install-package-from-directory 47d902c 4/5: (package-install-file): Install packages from directory. |
Date: |
Tue, 13 Jan 2015 17:57:53 +0000 |
branch: scratch/install-package-from-directory
commit 47d902cc6c4f7b0fa8993251a25479c374a28cce
Author: Artur Malabarba <address@hidden>
Commit: Artur Malabarba <address@hidden>
(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 4bc4082..13081c3 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-11 Michael Albinus <address@hidden>
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index 1ae6217..1f93733 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -1333,8 +1333,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)