Emacs缓冲区撤消限制

时间:2013-05-24 10:26:24

标签: matlab emacs

当我打印到stdout时,我在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看起来像这样: enter image description here

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

2 个答案:

答案 0 :(得分:12)

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

  

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

那是:

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

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

答案 1 :(得分:7)

你的问题有点含糊不清,但假设你说你不需要撤消这个缓冲区中的东西,那么你可以在每个缓冲区的基础上禁用撤销系统:< / p>

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.

所以你可以交互地调用 Mx buffer-disable-undo RET ,或者如果你确定的话,可以将它添加到模式的钩子函数中问题。

修改

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

(add-hook 'matlab-shell-mode-hook 'buffer-disable-undo)