在C代码编辑模式下,星号前面会自动加上逗号,是 org 的 bug 嘛

Snip20190217_1

类似问题

显然是有意为之,用来 Escape,Org Mode 格式也没有标准化,实现成怎样就怎样,不了解背后的逻辑。

1 个赞

不得已为之。

Orgmode 章节符号就是 *,大概还没想好如何处理代码块中的 * 号,所以就转义了。

这么一来,就不能直接把代码拷贝拿去用了,显然很不合理。

建议把代码块内的第一层缩进也禁掉,否则编写诸如 Makefile 等严格依赖 TAB 的代码时,也会出现问题:TAB 被替换成了空格。

1 个赞

这里贴下如何禁用第一层缩进的方式

(setq org-src-preserve-indentation t)

参考: indentation - How to indent without the two extra spaces at the beginning of code blocks in org mode? - Emacs Stack Exchange

1 个赞