Emacs组织模式&读写哈斯克尔 [英] Emacs Org-Mode & Literate Haskell

查看:119
本文介绍了Emacs组织模式&读写哈斯克尔的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在组织模式中,以冒号开头的行格式为源代码。 ( http://orgmode.org/manual/Literal-examples.html

In org-mode, a line starting with a colon is formatted as source code. ( http://orgmode.org/manual/Literal-examples.html )

在识字Haskell中,源代码行以一个更大的符号开始。

In literate Haskell, source code lines start with a greater then sign.

我想用文字写Haskell -mode markdown,我当前的首选格式。

I want to write literate Haskell with org-mode markdown, my current preferred format.

由于我假设我无法更改Haskell编译器,我的问题是:

As I assume that I cannot change the Haskell compiler, my question is:

我可以在组织模式下使代码行标记大于符号吗? (我试图找到它,但是org.el是一个865k的文件,22k loc,我还是丢了。)

Can I somehow make the greater than sign a code-line marker in org mode? (I tried to find it myself, but as org.el is a 865k file, 22k loc, I'm still lost.)

推荐答案

所以,oboiousely这不是使用org的方法。

So, obviousely this is not the intended ways to use org.

这样做的主要问题是,组织模式和散文模式都是主要的模式。所以我不能并行使用它们。

然而,这是它的工作原理,这是一个黑客,我不知道副作用..:

Nevertheless this is how it works, it is a hack, and I am not sure about side effects ..:

在emacs中查看文件时,(a?)代码触发器似乎在org-activate-code(org.el)中,但这不用于出口。对于HTML导出,我也必须触摸org-html.el。

When viewing a file in emacs, the (a?) code trigger seems to be in org-activate-code (org.el), but this is not used for export. For HTML export I had to touch org-html.el too.

我更改了:

在组织中。 el line 5378,函数org-activate-code from

In org.el line 5378, function org-activate-code from

"^[ \t]*\\(:\\(?: .*\\|$\\)\n?\\)"

to

"^[ \t]*\\([:>]\\(?: .*\\|$\\)\n?\\)"

而在org-html.el行1508和1516中,函数org-export-as-html从

And in org-html.el line 1508 and 1516, function org-export-as-html from

(string-match "^[ \t]*:\\(\\([ \t]\\|$\\)\\(.*\\)\\)" line)

(string-match "^[ \t]*[:>]\\(\\([ \t]\\|$\\)\\(.*\\)\\)" line)

和(第1516行)

(string-match "^[ \t]*[:>]\\(\\([ \t]\\|$\\)\\(.*\\)\\)"

看着它,我认为这必须被改编对于每一个打算使用的出口渠道。

Looking at it I assume that this has to be adapted for every export channel one intends to use.

这篇关于Emacs组织模式&读写哈斯克尔的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆