首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在Emacs 24.3中安装用于管理包的el-get

在Emacs 24.3中安装用于管理包的el-get
EN

Stack Overflow用户
提问于 2013-03-27 00:35:27
回答 1查看 2.7K关注 0票数 0

安装el-get的说明如下:

代码语言:javascript
复制
;; Copy/paste this code into your *scratch* buffer,
;; hit C-j, and you have a working el-get.
(url-retrieve
 "https://raw.github.com/dimitri/el-get/master/el-get-install.el"
 (lambda (s)
   (goto-char (point-max))
   (eval-print-last-sexp)))

当我这样做时,在debugger-mode中打开一个名为*Backtrace*的缓冲区,其中包含以下内容:

代码语言:javascript
复制
Debugger entered--Lisp error: (void-variable closed)
  eval(closed nil)
  eval-last-sexp-1(t)
  eval-last-sexp(t)
  eval-print-last-sexp()
  (lambda (s) (goto-char (point-max)) (eval-print-last-sexp))(nil)
  apply((lambda (s) (goto-char (point-max)) (eval-print-last-sexp)) nil)
  url-http-activate-callback()
  url-http-content-length-after-change-function(589 3952 3363)
  url-http-generic-filter(#<process raw.github.com> ";;; el-get-install.el --- installer for the lazy
;;
;; Copyright (C) 2010 Dimitri Fontaine
;;
;; Author: Dimitri Fontaine <dim@tapoueh.org>
;; URL: http://www.emacswiki.org/emacs/el-get.el
;; Created: 2010-06-17
;; Keywords: emacs package elisp install elpa git git-svn bzr cvs apt-get fink http http-tar
;; Licence: WTFPL, grab your copy here: http://sam.zoy.org/wtfpl/
;;
;; This file is NOT part of GNU Emacs.
;;
;; bootstrap your el-get installation, the goal is then to use el-get to
;; update el-get.
;;
;; So the idea is that you copy/paste this code into your *scratch* buffer,
;; hit C-j, and you have a working el-get.

(let ((el-get-root
       (file-name-as-directory
    (or (bound-and-true-p el-get-dir)
        (concat (file-name-as-directory user-emacs-directory) \"el-get\")))))

  (when (file-directory-p el-get-root)
    (add-to-list 'load-path el-get-root))

  ;; try to require el-get, failure means we have to install it
  (unless (require 'el-get nil t)
    (unless (file-directory-p el-get-root)
      (make-directory el-get-root t))

    (let* ((package   \"el-get\")
       (buf       (switch-to-buffer \"*el-get bootstrap*\"))
       (pdir      (file-name-as-directory (concat el-get-root package)))
       (git       (or (executable-find \"git\")
              (error \"Unable to find `git'\")))
       (url       (or (bound-and-true-p el-get-git-install-url)
              \"http://github.com/dimitri/el-get.git\"))
       (default-directory el-get-root)
       (process-connection-type nil)   ; pipe, no pty (--no-progress)

       ;; First clone el-get
       (status
        (call-process
         git nil `(,buf t) t \"--no-pager\" \"clone\" \"-v\" url package)))

      (unless (zerop status)
    (error \"Couldn't clone el-get from the Git repository: %s\" url))

      ;; switch branch if we have to
      (let* ((branch (cond
                      ;; Check if a specific branch is requested
                      ((bound-and-true-p el-get-install-branch))
                      ;; Check if master branch is requested
                      ((boundp 'el-get-master-branch) \"master\")
                      ;; Read the default branch from the el-get recipe
                      ((plist-get (with-temp-buffer
                                    (insert-file-contents-literally
                                     (expand-file-name \"recipes/el-get.rcp\" pdir))
                                    (read (current-buffer)))
                                  :branch))
                      ;; As a last resort, use the master branch
                      (\"master\")))
             (remote-branch (format \"origin/%s\" branch))
             (default-directory pdir)
             (bstatus
               (if (string-equal branch \"master\")
                 0
                 (call-process git nil (list buf t) t \"checkout\" \"-t\" remote-branch))))
        (unless (zerop bstatus)
          (error \"Couldn't `git checkout -t %s`\" branch)))

      (add-to-list 'load-path pdir)
      (load package)
      (let ((el-get-default-process-sync t) ; force sync operations for installer
            (el-get-verbose t))         ; let's see it all
        (el-get-post-install \"el-get\"))
      (unless (boundp 'el-get-install-skip-emacswiki-recipes)
        (el-get-emacswiki-build-local-recipes))
      (with-current-buffer buf
    (goto-char (point-max))
    (insert \"\
Congrats, el-get is installed and ready to serve!\")))))
closed
")

我是否认为文件https://raw.github.com/dimitri/el-get/master/el-get-install.el中存在错误?或者,为了让这样的脚本正常工作,我还需要进行其他设置吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-03-27 01:44:22

不知何故,下载的文件被附加了一个closed行,这在原始文件中并不存在--不知道为什么,这在我身上不会发生。它在回溯的最后是可见的。

您可以复制整个el-get-install.el文件,粘贴到*scratch*中,然后使用C-j对其求值。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/15642496

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档