org-mode - 如何 org-babel-tangle 只有一个代码块?

标签 org-mode org-babel

我在一个 .org 文件中生成多个文件,其中包含多个源代码块。例如:

#+begin_src rst :tangle file1.rst :noweb yes
<<file1>>
#+end_src

#+begin_src rst :tangle file2.rst :noweb yes
<<file2>>
#+end_src
有没有办法只纠结一个特定的代码块而不改变标题选项?
我正在为 Sphinx 生成这些文件并减少编译时间,我只想处理我当前正在处理的文件。
要是有org-babel-tangle-current-block这样的命令就好了- 有没有办法做到这一点?
(这是与 Orgmode: how to filter the blocks to be tangle? 相关的问题)

最佳答案

这可以通过调用 org-babel-tangle带有前缀参数。

所以C-u C-c C-v t应该做你想做的。

从文档字符串:

With one universal prefix argument, only tangle the block at point. When two universal prefix arguments, only tangle blocks for the tangle file of the block at point.

关于org-mode - 如何 org-babel-tangle 只有一个代码块?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28727190/

相关文章:

org-mode babel 输出图形中的 Python 与 R

emacs - 使用 org-babel : Debugger entered--Lisp error: (void-function cl-member) 初始化 emacs

perl - 有没有办法在perl中执行一个文件和一行程序?

emacs - 如何在 org-mode 中更改 "DEADLINE"和 "SCHEDULED"的默认文本?

emacs - 如何在 emacs 表中计算 sleep 持续时间?

html - 如何在 orgmode 中对 html 导出标记代码块评估?

c - 从 org babel 运行 C 完成的程序

emacs - 为什么这个 org-mode header-arg 没有被应用?

emacs - 我可以在 org-mode 中重新定位省略号 (...)

emacs - 组织模式: Chaning "DONE" to "TODO" automatically for repeating tasks