emacs - 将整个组织模式文件重新归档为树?

标签 emacs org-mode

我有一个充满组织模式文件的目录。每个文件都被构造成多个树,如下所示。

This is the first file

* First item
** Subitem 1
** Subitem 2
* Second item

我想将所有这些文件组合成一个文件,其中每个文件都有自己的树。所以它看起来像这样。

* file1.org
This is the first file
** First item
*** Subitem 1
*** Subitem 2
** Second item
* file2.org
This is the second file.
** First item
** Second item ...

使用 elisp 实现这一目标的最简单方法是什么?

最佳答案

这当然可以改进,但应该效果很好:

rm combined.org tmp.org ;
for i in *.org ; do 
    touch combined.org ; 
    echo "* $i" > tmp.org;
    sed "s/^\*/**/" "$i" | cat combined.org tmp.org - > combined.org.tmp ;
    mv combined.org.tmp combined.org ;
done

关于emacs - 将整个组织模式文件重新归档为树?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14711492/

相关文章:

emacs - 有什么方法可以扩展组织模式标签以包含 "-"之类的字符?

emacs - 导出 .org 文件时如何跳过某些指定部分?

emacs - 带有美元符号列的组织表格式

emacs - 修改缓冲区焦点控制(pop-to-buffer vs display-buffer)

python - 来自初次使用者的最基本的 ipython notebook 问题 :

emacs - 让 emacs 在启动时打开东西

emacs - 使用 emacs tramp 与 rsync 进行远程开发

emacs - OCaml Emacs Tuareg : Evaluate phrase keyboard shortcut, 以及如何显示实际的希腊符号?

emacs - 字节码 : Symbol's value as variable is void: org-babel-tangle-lang-exts

emacs - 将 CSV 导入组织模式属性