Skip to content

Instantly share code, notes, and snippets.

@shoover
Created October 1, 2010 19:47
Show Gist options
  • Save shoover/12a4fd50023e84e6f353 to your computer and use it in GitHub Desktop.
Save shoover/12a4fd50023e84e6f353 to your computer and use it in GitHub Desktop.
; Patch package.el to correctly download certain packages on Windows.
+ (defun package-write-file-no-coding (file-name excl)
+ (setq buffer-file-coding-system 'no-conversion)
+ (write-region (point-min) (point-max) file-name nil nil nil excl))
(defun package-unpack-single (file-name version desc requires)
"Install the contents of the current buffer as a package."
(let* ((dir (file-name-as-directory package-user-dir)))
;; Special case "package".
(if (string= file-name "package")
- (write-region (point-min) (point-max) (concat dir file-name ".el")
- nil nil nil nil)
+ (package-write-file-no-coding (concat dir file-name ".el") nil)
(let ((pkg-dir (file-name-as-directory
(concat dir file-name "-" version))))
(make-directory pkg-dir t)
- (write-region (point-min) (point-max)
- (concat pkg-dir file-name ".el")
- nil nil nil 'excl)
+ (package-write-file-no-coding (concat pkg-dir file-name ".el") 'excl)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment