我有一个充满组织模式文件的目录。每个文件都被构造成多个树,如下所示。
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/