本文介绍了Emacs初始化为org文件:如何获得正确版本的组织模式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在尝试描述的如何将大部分emacs init.el文件放入组织文件中。但是,我想使用org-mode 8(主要用于新的导出程序),而且我使用的是gnu emacs 24.3.1(对于windows),它内置了org-mode 7.9,所以我已经安装了org-mode来自,而不是使用内置版本。

I've been experimenting with the org-babel tutorial that describes how to put the bulk of your emacs init.el file into an org file. However, I would like to use org-mode 8 (mainly for the new exporter) and I'm on gnu emacs 24.3.1 (for windows) which comes with org-mode 7.9 built-in, so I have org-mode installed from the elpa package manager instead of using the built-in version.

我的问题是emacs加载了emacs而不是我在elpa中安装的组件模式。有没有办法加载elpa组织模式?

My problem is that emacs loads the org-mode that comes with emacs rather than the one I have installed in elpa. Is there a way to load the elpa org-mode?

这是我的init.el,从org-babel教程修改到(我想到)到我的org -mode分发 - 但我的emacs-lisp知识是最小的,所以我不知道它在做什么。

Here is my init.el, modified from the org-babel tutorial to point (I thought) to my org-mode distribution - but my emacs-lisp knowledge is minimal so I don't really know what it is doing.

;;; 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
(setq dotfiles-dir (file-name-directory (or (buffer-file-name) load-file-name)))
(let* ((org-dir (expand-file-name
             "elpa" (expand-file-name
                     "org-plus-contrib-20130624" )))
  (org-contrib-dir (expand-file-name
                     "lisp" (expand-file-name
                             "contrib" (expand-file-name
                                        ".." org-dir))))
       (load-path (append (list org-dir org-contrib-dir)
                      (or load-path nil))))
  ;; load up Org-mode and Org-babel
  (require 'org-install)
  (require 'ob-tangle))

;; load up all literate org-mode files in this directory
(mapc #'org-babel-load-file (directory-files dotfiles-dir t "\\.org$"))

;;; init.el ends here


推荐答案

(包初始化)在任何调用 org-babel-load-file 或任何其他Org函数之前,您将获得ELPA版本。

Put (package-initialize) before any calls to org-babel-load-file or any other Org function, and you'll get the ELPA version.

这篇关于Emacs初始化为org文件:如何获得正确版本的组织模式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!