소스 검색

update dllib function

pull/1/head
10sr 12 년 전
부모
커밋
3878163f94
1개의 변경된 파일7개의 추가작업 그리고 5개의 파일을 삭제
  1. +7
    -5
      emacs.el

+ 7
- 5
emacs.el 파일 보기

@@ -40,11 +40,11 @@ Each function is called with two args, the filename before changing and after ch
(require 'url)

(defun dllib-if-unfound (url &optional bite-compile-p force-download-p)
"if LIB does not exist, download it from URL and locate it to \"~/emacs.d/lisp/LIB.el\".
return nil if LIB unfound and downloading failed, otherwise the path of LIB."
"If library does not exist, download it from URL and locate it in \"~/emacs.d/lisp/\".
Return nil if library unfound and downloading failed, otherwise the path where the library installed."
(let* ((dir (expand-file-name (concat user-emacs-directory "lisp/")))
(lib (file-name-nondirectory url))
(lpath (concat dir lib))
(lib (file-name-sans-extension (file-name-nondirectory url)))
(lpath (concat dir lib ".el"))
(locate-p (locate-library lib)))
(if (or force-download-p (not locate-p))
(progn (condition-case nil
@@ -53,8 +53,10 @@ return nil if LIB unfound and downloading failed, otherwise the path of LIB."
lpath
t)
(when bite-compile-p
(and (file-writable-p (byte-compile-dest-file lpath))
(delete-file (byte-compile-dest-file lpath)))
(byte-compile-file lpath)))
(error (and (file-readable-p lpath)
(error (and (file-writable-p lpath)
(delete-file lpath))
(message "downloading %s...something wrong happened!" url)
nil))


불러오는 중...
취소
저장