aboutsummaryrefslogtreecommitdiff
path: root/pkgs/build-support/emacs
diff options
context:
space:
mode:
authorThomas Tuegel <ttuegel@gmail.com>2016-01-16 18:38:06 -0600
committerThomas Tuegel <ttuegel@gmail.com>2016-01-18 15:29:19 -0600
commit9dfd9fe0bffeadb1b1f0e6f56ec3245fe5a26097 (patch)
treeef65fd5997ad79f31e7824557270ab81f6c63586 /pkgs/build-support/emacs
parentdecb5802c91915814fc6551442cd3f586a78de30 (diff)
elpa2nix: fix packages with DOS line endings
Diffstat (limited to 'pkgs/build-support/emacs')
-rw-r--r--pkgs/build-support/emacs/elpa2nix.el11
1 files changed, 7 insertions, 4 deletions
diff --git a/pkgs/build-support/emacs/elpa2nix.el b/pkgs/build-support/emacs/elpa2nix.el
index 3a2d65d640f4..7eef81b9e7ab 100644
--- a/pkgs/build-support/emacs/elpa2nix.el
+++ b/pkgs/build-support/emacs/elpa2nix.el
@@ -21,7 +21,10 @@
(defun elpa2nix-install-file (file)
"Install a package from a file.
The file can either be a tar file or an Emacs Lisp file."
- (with-temp-buffer
- (insert-file-contents-literally file)
- (when (string-match "\\.tar\\'" file) (tar-mode))
- (elpa2nix-install-from-buffer)))
+ (let ((is-tar (string-match "\\.tar\\'" file)))
+ (with-temp-buffer
+ (if is-tar
+ (insert-file-contents-literally file)
+ (insert-file-contents file))
+ (when is-tar (tar-mode))
+ (elpa2nix-install-from-buffer))))