在noweb模式下禁用自动填充模式 [英] Disable auto fill mode in noweb-mode

查看:216
本文介绍了在noweb模式下禁用自动填充模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请为上帝的爱我如何使Emac停止自动填充?我使用 visual-line-mode ,我不想自动填充。我可以用 M-x自动填充模式RET 关闭它,但是在Noweb模式下,当我进入代码块并重新退出时,它会被重新启动。请,我只想全球转动自动填充模式,这让我疯狂。

Please for the love of god how can I make Emacs stop auto-filling? I use visual-line-mode, I do not want auto fill. I can turn it off with M-x auto-fill-mode RET but in Noweb mode it gets turned back on when I move into a code chunk and back out again. Please, I just want to globally turn of auto fill mode, it's driving me crazy.

我试过

(auto-fill-mode 0)

和一堆疯狂的东西,如

(add-hook 'Rnw-mode-hook '(lambda () (auto-fill-mode 0)))
(add-hook 'latex-mode-hook '(lambda () (auto-fill-mode 0)))

但似乎没有任何效果。请帮助我。

But nothing seems to work. Please help me.

推荐答案

不要在系统中添加更多的钩子,您应该检查是否可以删除一些禁用自动填写

Instead of adding further hooks to your system, you should check if you could remove some to disable auto-fill.

如果您看到 noweb-mode的源代码,在第211行你找到这个块:

If you see noweb-mode's source code, around line 211 you find this chunk:

(add-hook 'noweb-select-doc-mode-hook 'noweb-auto-fill-doc-mode)
(add-hook 'noweb-select-code-mode-hook 'noweb-auto-fill-code-mode)

要禁用自动填充,请在您的dotemacs中放入以下一行或两行(取决于是否要在代码和文档中禁用自动填充)。

To disable auto filling, put the following one or two lines in your dotemacs (depending on whether you want to disable auto-fill in both code and documentation).

(remove-hook 'noweb-select-doc-mode-hook 'noweb-auto-fill-doc-mode)
(remove-hook 'noweb-select-code-mode-hook 'noweb-auto-fill-code-mode)

这篇关于在noweb模式下禁用自动填充模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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