Skip to content

Instantly share code, notes, and snippets.

@syohex
Created December 2, 2011 14:43
Show Gist options
  • Save syohex/1423467 to your computer and use it in GitHub Desktop.
Save syohex/1423467 to your computer and use it in GitHub Desktop.
同時実行の際, add-to-listとして書きだすパス名が上書きされる問題の修正
--- orig-bundle.el 2011-12-02 23:39:27.852200611 +0900
+++ bundle.el 2011-12-02 23:33:37.088195348 +0900
@@ -18,23 +18,29 @@
(defvar bundle-install-last-url nil
"The last url used in `bundle-install-from-url'.")
-(defun bundle-install-git (&optional url)
+(defun bundle-install-git (url)
"Install elisp files from a given url using git."
- (interactive)
- (or url (setq url (read-string (format "URL (%s):" (or bundle-install-last-url "")) nil nil bundle-install-last-url)))
+ (interactive
+ (list (read-string (format "URL%s:"
+ (or (and bundle-install-last-url
+ (format "(%s)" bundle-install-last-url))
+ "")) nil nil bundle-install-last-url)))
(setq bundle-install-last-url url)
+ (lexical-let* ((dirname (file-name-sans-extension (file-name-nondirectory url)))
+ (install-path (concat bundle-install-directory "/" dirname))
+ (copyed-url url))
+ (deferred:$
+ (deferred:process "git" "clone" url install-path)
+ (deferred:nextc it
+ (lambda ()
+ (message (format "cloning...: %s"
+ (concat "git clone " copyed-url " " install-path)))
+ (add-to-list 'load-path install-path)
+ (append-to-file
+ (concat "(add-to-list 'load-path \"" install-path "\")\n")
+ nil bundle-init-filepath)
+ (load (concat bundle-install-directory "/" "init-bundle.el"))))
- (setq bundle-install-path (format (concat bundle-install-directory "/" (file-name-sans-extension (file-name-nondirectory bundle-install-last-url)))))
-
- (deferred:$
- (deferred:process "git" "clone" bundle-install-last-url bundle-install-path)
- (deferred:nextc it
- (lambda ()
- (message (format "cloning...: %s" (concat "git clone " bundle-install-last-url " " bundle-install-path)))
- (add-to-list 'load-path bundle-install-path)
- (append-to-file (concat "(add-to-list 'load-path \"" bundle-install-path "\")\n") nil bundle-init-filepath)
- (load (concat bundle-install-directory "/" "init-bundle.el"))))
-
- (deferred:error it ;
- (lambda (err)
- (insert "Can not get a clone! : " err)))))
+ (deferred:error it
+ (lambda (err)
+ (insert "Can not get a clone! : " err))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment