我正在开发一个 C++ 项目。假设我有以下目录结构:
project/
project/src
并且我有以下文件:
project/ChangeLog
project/todo.org
project/src/foo.cpp
我可以处理 foo.cpp
中的 C++ 源代码,然后只需使用 Cx 4 在 ChangeLog 文件中添加一行a
作为这个页面描述。
如何在文件 todo.org
上使用 org-mode 实现相同类型的功能。我想保留一个与源代码相关的待办事项列表。因此,如果在 foo.cpp
中我需要完成一个函数 void Foo::bla()
我希望将一个条目添加到 todo.org 提到了这个函数及其所在的文件,就像 Cx 4 a
中对 ChangeLog 所做的那样。
我还希望能够拥有从 org 文件到待办任务所在的 foo.cpp 文件的反向链接。
I'm working on a C++ project. Suppose I have the following directory structure:
project/
project/src
And I have the following files:
project/ChangeLog
project/todo.org
project/src/foo.cpp
I can work on the C++ source code in foo.cpp
and then add a line into the ChangeLog file just with C-x 4 a
as this page describes.
How can I achieve that same kind of functionality with org-mode on the file todo.org
. I would like to keep a to do list relative to the source code. So if in foo.cpp
I need to finish a function void Foo::bla()
I would like an entry to be added to todo.org
that mentions this function and the file it resides in much like C-x 4 a
does for ChangeLog.
I would also like to be able to have the backward link from the org file to the foo.cpp
file in which the to-do task is.
发布评论
评论(1)
虽然 org-mode 有广泛的文档记录,但我确实发现在线手册是
非常密集。幸运的是,网上有很多很好的教程,但有时
很难找到特定问题的答案。
我建议阅读有关 Capture 的 org-mode 手册部分。你需要做一个
很少的设置和具体细节取决于您拥有的组织模式版本。 (我
推荐使用 7.x。如果你被困在 6.x 上,我没有任何捕获设置
下面的描述将起作用。)
这是我的 emacs 设置中的一个简单片段:
现在,当我在源文件中时,我点击 Cc c 。组织模式让我选择
模板(上例中的 [t]odo 或 [j]ournal),并填写
包括指向我启动捕获时所在线路的链接。
更新了有关重新整理的信息:如果您有多个项目并希望保留单独的待办事项列表,您还应该了解重新归档。最简单的设置是让 org-refile-targets 包含您的 todo.org 文件列表。在捕获过程中,您可以将任务直接“重新归档”到任何重新归档目标中。
这个关于 org-mode 的页面上有一个关于捕获和重新归档的很好的演练。
While org-mode is documented extensively, I do find the online manual to be
very dense. Luckily, there are many good tutorials online, but it's sometimes
hard to find the answer to a specific problem.
I suggest reading the org-mode manual section on Capture. You'll need to do a
little setup and the specifics depend on what version of org-mode you have. (I
recommend using 7.x. If you're stuck on 6.x, none of the capture setup I
describe below will work.)
Here's a simple snippet from my emacs setup:
Now I hit C-c c when I'm in my source file. Org-mode lets me select
a template ([t]odo or [j]ournal in the example above), and fills it in
including a link to the line I was on when I initiated the capture.
Updated with info about Refiling: If you have multiple projects and want to keep separate todo lists, you should also learn about Refiling. The simplest setup is to have
org-refile-targets
contain a list of your todo.org files. During the capture process, you can "refile" the task directly into any of your refile targets.There's a nice walkthrough of capture and refiling on this page about org-mode.