尝试使用捕获时组织模式设置问题

发布于 2024-09-16 18:48:18 字数 652 浏览 10 评论 0原文

我试图按照 org-manual p 74 中的说明使用捕获。 这是 org 模式的 .emacs 文件。

(require 'org-install)
(add-to-list 'auto-mode-alist '("\\.org$" . org-mode))
(define-key global-map "\C-cl" 'org-store-link)
(define-key global-map "\C-ca" 'org-agenda)
(setq org-log-done t)

(setq org-default-notes-file (concat org-directory "~/notes.org")) <-- error
(define-key global-map "\C-cc" 'org-capture)

但我收到这个错误。可能出了什么问题?

Symbol's value as variable is void: org-directory

添加

戴夫回答后,我修改了代码,它似乎工作正常。但我发现的另一个问题是抄送 c 给了我这个错误。

Symbol's function definition is void : org-capture

I was trying to use the capture as is explained in org-manual p 74.
This is the .emacs file for org mode.

(require 'org-install)
(add-to-list 'auto-mode-alist '("\\.org$" . org-mode))
(define-key global-map "\C-cl" 'org-store-link)
(define-key global-map "\C-ca" 'org-agenda)
(setq org-log-done t)

(setq org-default-notes-file (concat org-directory "~/notes.org")) <-- error
(define-key global-map "\C-cc" 'org-capture)

But I get this error. What might be wrong?

Symbol's value as variable is void: org-directory

ADDED

After Dave's answer, I modified the code, and it seems to work fine. But the other problem that I found was C-c c gives me this error.

Symbol's function definition is void : org-capture

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

傾旎 2024-09-23 18:48:18

首先,确保您使用的是 org-mode 6.36 或更高版本。 (早期版本使用 Remember.el,它有不同的设置。)

您使用的是未定义的符号,org-directory
尝试使用:

(setq org-default-notes-file (expand-file-name "~/notes.org"))

跟进
要加载最近的 org-mode 包:

(add-to-list 'load-path "/my/home/emacs.d/org-7.01h/lisp")
(require 'org-install)
(require 'org) ;; maybe this line is redundant

请注意,打包时,org-mode lisp 文件位于 lisp 子目录中。

First of all, make sure you're using org-mode 6.36 or later. (Earlier versions use remember.el which has a different setup.)

You're using a symbol that's not defined, org-directory.
Try using:

(setq org-default-notes-file (expand-file-name "~/notes.org"))

Followup:
To load a recent org-mode package:

(add-to-list 'load-path "/my/home/emacs.d/org-7.01h/lisp")
(require 'org-install)
(require 'org) ;; maybe this line is redundant

Note that as packaged, the org-mode lisp files are in the lisp sub-directory.

过期情话 2024-09-23 18:48:18

我知道这个问题已经得到解答,但我想为那些还没有成功的人留下更彻底的答案。我只是走过场,我将在下面列出每个步骤。

  1. http://orgmode.org/ 并下载 tar.gz (下载时为稳定版本 7.9.2 ( 2012 年 9 月)
  2. 解压(tar -zxvf nameofile.tar.gz 或双击该文件)
  3. 编辑 local.mk 文件以将文件放置在您想要的位置。基于脚本语言,我决定将我的 emacs 内容也保留在那里。 Scripts/emacs”。我只需确保其他目录以“$(prefix)/emacs”开头——提示:检查 infodir。

    <块引用>

    # emacs 二进制文件的名称
    EMACS = emacs
    

    # 本地软件在哪里找到
    前缀 = /用户/用户名/脚本

    # 本地 Lisp 文件的去向。
    lispdir= $(前缀)/emacs/lisp/org

    # 本地数据文件所在的位置。
    datadir = $(前缀)/emacs/etc/org

    # 信息文件的去向。
    infodir = $(前缀)/emacs/info

  4. 编辑您的 .emacs 文件并粘贴两个新路径(如果还没有)。第一个是用于存放您可能拥有的任何 .el 文件的 lisp 文件夹,第二个是因为我将 org 文件包含在 org 文件夹中,该文件夹是 lisp 的子文件夹。不幸的是,“加载路径”不够智能,无法检测子文件夹,因此您必须显式设置每个文件夹。

    • (setq 加载路径 (cons "~/Scripts/emacs/lisp" 加载路径))
    • (setq 加载路径 (cons "~/Scripts/emacs/lisp/org" 加载路径))
  5. 检查 Aquamacs 或 Emacs 中的版本使用 Mx org-version (元键 + x 并输入“org-version”)

提示:

  • nano ~/.emacs
  • open -a Textedit ~/.emacs

I know this question has been answered, but I would like to leave a more thorough answer for those people who haven't been successful. I just went through the motions and I am going to make a list of each step below.

  1. http://orgmode.org/ and download tar.gz (at time of download it was Stable version 7.9.2 (sept. 2012)
  2. untar (tar -zxvf nameoffile.tar.gz OR just double click the file)
  3. edit the local.mk file to put files where you want them. I have a folder in my user directory called Scripts where I keep things orderly based on scripting language. I decided to keep my emacs stuff there too. Inside the scripts folder is a folder called "emacs". As a prefix, I used "Scripts", but I could have made the Prefix "/Users/Username/Scripts/emacs". I just had to make sure that the other directories started with "$(prefix)/emacs"—HINT: check the infodir.
    # Name of your emacs binary
    EMACS = emacs
    

    # Where local software is found
    prefix = /Users/Username/Scripts

    # Where local lisp files go.
    lispdir= $(prefix)/emacs/lisp/org

    # Where local data files go.
    datadir = $(prefix)/emacs/etc/org

    # Where info files go.
    infodir = $(prefix)/emacs/info

  4. Edit your .emacs file and paste in there two new paths (if not already there). The first one is for the lisp folder for any .el files you may have and the second one is there because I contained the org files in an org folder, which is a subfolder of lisp. Unfortunately, the "load-path" is not smart enough to detect subfolders, therefore you must set each folder explicitly.

    • (setq load-path (cons "~/Scripts/emacs/lisp" load-path))
    • (setq load-path (cons "~/Scripts/emacs/lisp/org" load-path))
  5. Check version in Aquamacs or Emacs with M-x org-version (meta key + x and type "org-version")

HINT:

  • nano ~/.emacs
  • open -a Textedit ~/.emacs
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文