From 20c67eb22cd0cf53857941b771fc5fbde0221f6a Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Thu, 29 Nov 2012 10:09:11 +0900 Subject: [PATCH] fix fetch-library --- emacs.el | 37 +++++++++++++++++-------------------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/emacs.el b/emacs.el index 3788dd2..28da04c 100644 --- a/emacs.el +++ b/emacs.el @@ -48,26 +48,23 @@ otherwise the path where the library installed." (lpath (concat dir lib ".el")) (locate-p (locate-library lib))) (if (or force-download-p (not locate-p)) - (progn (condition-case nil - (progn (message "Downloading %s..." url) - (or (download-file url - lpath - t) - (error "Download failed")) - (message "Downloading %s...done") - (when (and byte-compile-p - (require 'bytecomp nil t)) - (and (file-exists-p (byte-compile-dest-file lpath)) - (delete-file (byte-compile-dest-file lpath))) - (byte-compile-file lpath)) - ) - (error (and (file-writable-p lpath) - (delete-file lpath)) - (message "Downloading %s...failed" - url) - nil)) - (locate-library lib)) - locate-p))) + (if (progn (message "Downloading %s..." + url) + (download-file url + lpath + t)) + (progn (message "Downloading %s...done" + url) + (when (and byte-compile-p + (require 'bytecomp nil t)) + (and (file-exists-p (byte-compile-dest-file lpath)) + (delete-file (byte-compile-dest-file lpath))) + (byte-compile-file lpath))) + (progn (and (file-writable-p lpath) + (delete-file lpath)) + (message "Downloading %s...failed" + url)))) + (locate-library lib))) (defun download-file (url path &optional ok-if-already-exists) "Download file from URL and output to PATH."