使用org-babel初始化emacs:输入调试器 - Lisp错误:(void-function cl-member)

Jea*_*hel 3 emacs org-mode org-babel

我已将init.el迁移到组织模式文件,以使用与babel结合的org-mode的灵活性.

但是,我无法让它发挥作用.我怀疑有一些依赖性错误,已经尝试了很多东西来解决它,但我没有技能去理解出错的地方:

  1. 这里我的init.el ---除了调用包含所有init代码的org文件外什么都不做

    ;; from http://orgmode.org/worg/org-contrib/babel/intro.html#literate-programming
    ;;; init.el --- Where all the magic begins
    ;;
    ;; This file loads Org-mode and then loads the rest of our Emacs initialization from Emacs lisp
    ;; embedded in literate Org-mode files.
    
    ;; Load up Org Mode and (now included) Org Babel for elisp embedded in Org Mode files
    (package-initialize)
    (setq dotfiles-dir (file-name-directory (or (buffer-file-name) load-file-name)))
    (require 'org-install)
    (require 'ob-tangle)
    (org-babel-load-file (expand-file-name "emacs-and-org-init.org" dotfiles-dir))
    
    Run Code Online (Sandbox Code Playgroud)
  2. 这是组织文件---即使是最小的它也会抛出错误

    #+TITLE: Emacs and Org init
    #+OPTIONS: toc:2 num:nil ^:nil
    
    #+begin_quote
      Emacs outshines all other editing software in approximately the same
      way that the noonday sun does the stars. It is not just bigger and
      brighter; it simply makes everything else vanish.
    
      -- Neal Stephenson, "In the Beginning was the Command Line"
    #+end_quote
    
    * Implementation
    This section contains all the init code.
    ** basics
    this is commented on purpose --- even commented, the use of this file throw the error "Debugger entered--Lisp error: (void-function cl-member)"
      #+begin_src emacs-lisp
    ;;    (add-to-list 'load-path "~/.emacs.d/elpa/") ;;;; this is commented on purpose --- even commented, the use of this file throw the error "Debugger entered--Lisp error: (void-function cl-member)"
      #+end_src
    
    ** the rest of the code
    - this sections is almost empty for the moment, so that this file is the minimal file that throw an error
    
    #+BEGIN_SRC emacs-lisp
    ;; this should appear in the emacs-and-org.el, but does not
    (message "test")
    #+END_SRC
    
    Run Code Online (Sandbox Code Playgroud)
  3. 这里产生的emacs-and-org.el ---第一个"org babel code section"就在这里,但是第二个缺失了

    ;;    (add-to-list 'load-path "~/.emacs.d/elpa/") ;;;; this is commented on purpose -- even commented, the use of this file throw the error "Debugger entered--Lisp error: (void-function cl-member)"
    
    Run Code Online (Sandbox Code Playgroud)
  4. 抛出的错误:

    Debugger entered--Lisp error: (void-function cl-member)
    
    Run Code Online (Sandbox Code Playgroud)

谁可以帮忙?

M-x version
GNU Emacs 24.3.50.1 (x86_64-pc-linux-gnu, GTK+ Version 3.4.2) of 2013-09-29 on gkar, modified by Debian

M-x org-version
Org-mode version 8.2.1 (8.2.1-3-g35e5e5-elpa @ /home/me/.emacs.d/elpa/org-20131007/)
Run Code Online (Sandbox Code Playgroud)

abo*_*abo 6

这是最小的设置:

~/emacs-and-org-init.org:

#+begin_src emacs-lisp
(message "test")
#+end_src
Run Code Online (Sandbox Code Playgroud)

~/.emacs:

(package-initialize)
(require 'ob-tangle)
(org-babel-load-file "~/emacs-and-org-init.org")
Run Code Online (Sandbox Code Playgroud)

从这个设置开始,逐步添加东西,直到东西中断(希望它不会:)).

顺便说一句,你可以得到cl-member(require 'cl),如果出现.

  • 而已.我在你提供的.emacs中添加了(require'cl)(package-initialize),并且它有效; 即使我的整个.org配置文件.Tks很多! (2认同)