From e420965f95f6721d76c73653c518b12c92165a83 Mon Sep 17 00:00:00 2001 From: David Bremner Date: Sat, 11 Jul 2015 12:30:30 +0200 Subject: add single file batch installer function --- dh-elpa.el | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'dh-elpa.el') diff --git a/dh-elpa.el b/dh-elpa.el index 7c68ce5..d8c776a 100644 --- a/dh-elpa.el +++ b/dh-elpa.el @@ -24,6 +24,8 @@ ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs. If not, see . +(require 'package) + ;; Originally package-unpack from package.el in Emacs 24.5 (defun dhelpa-unpack (pkg-desc destdir) "Install the contents of the current buffer as a package." @@ -56,4 +58,12 @@ Downloads and installs required packages as needed." (dhelpa-unpack pkg-desc destdir) pkg-desc)) +(defun dhelpa-batch-install-file () + "install first command line argument (an emacs lisp file) +into second command line argument" + (let ((el-file (car command-line-args-left)) + (dest (cadr command-line-args-left))) + (with-temp-buffer + (insert-file-contents-literally el-file) + (dhelpa-install-from-buffer dest)))) ;;; dh-elpa.el ends here -- cgit v1.2.3