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

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

问题描述

拜托大神,我怎样才能让 Emacs 停止自动填充?我使用 visual-line-mode,我不想自动填充.我可以使用 M-x auto-fill-mode 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)

还有一堆疯狂的东西,比如

and a bunch of crazy things like

(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-mode 中禁用自动填充模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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