7

matlab-shell当我将大量打印到标准输出时,我在缓冲区中收到此警告:

Warning (undo): Buffer `*MATLAB*' undo info was 12268000 bytes long.
The undo info was discarded because it exceeded `undo-outer-limit'.

This is normal if you executed a command that made a huge change
to the buffer.  In that case, to prevent similar problems in the
future, set `undo-outer-limit' to a value that is large enough to
cover the maximum size of normal changes you expect a single
command to make, but not so large that it might exceed the
maximum memory allotted to Emacs.

我的emacs看起来像这样: 在此处输入图像描述

我真的不需要matlab-shell在正确的缓冲区中进行任何撤消。有没有办法禁用这个警告?请注意,左侧缓冲区是一个MATLAB脚本,这意味着主要模式是 MATLAB,当然不应该在此处禁用撤消。

4

2 回答 2

13

正如该警告消息所说(或曾经说过?):

您可以通过将条目添加到库中定义(undo discard-info)的用户选项来禁用此缓冲区的弹出 。warning-suppress-typeswarnings

那是:

(add-to-list 'warning-suppress-types '(undo discard-info))

(这当然只会禁用警告,而不是撤消数据收集本身。)

于 2013-05-24T12:07:53.767 回答
7

您的问题有点模棱两可,但假设您说您不需要撤消此缓冲区中的内容,那么您可以在每个缓冲区的基础上禁用撤消系统:

buffer-disable-undo is an interactive compiled Lisp function in `simple.el'.

(buffer-disable-undo &optional BUFFER)

Make BUFFER stop keeping undo information.
No argument or nil as argument means do this for the current buffer.

所以你可以M-x buffer-disable-undo RET交互调用,或者如果你确定它,你可以将它添加到相关模式的钩子函数中。

编辑:

因此,根据问题评论中的额外信息,我建议:

(add-hook 'matlab-shell-mode-hook 'buffer-disable-undo)
于 2013-05-24T10:41:15.360 回答