Emacs缓冲区撤消限制

row*_*man 6 emacs matlab

matlab-shell当我打印到stdout时,我在缓冲区中收到此警告:

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.
Run Code Online (Sandbox Code Playgroud)

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

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

leg*_*cia 12

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

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

那是:

(add-to-list 'warning-suppress-types '(undo discard-info))
Run Code Online (Sandbox Code Playgroud)

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


phi*_*ils 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.
Run Code Online (Sandbox Code Playgroud)

因此,您可以M-x buffer-disable-undo RET交互式调用,或者如果您确定,可以将其添加到相关模式的钩子函数中.

编辑:

所以根据问题评论中的额外信息,我会建议:

(add-hook 'matlab-shell-mode-hook 'buffer-disable-undo)
Run Code Online (Sandbox Code Playgroud)