瀏覽代碼

fix fetch-library

pull/1/head
10sr 12 年之前
父節點
當前提交
20c67eb22c
共有 1 個檔案被更改,包括 17 行新增20 行删除
  1. +17
    -20
      emacs.el

+ 17
- 20
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."


Loading…
取消
儲存