Friday 15 June 2012

How to hook into "buffer has shrunk a lot" in Emacs -


Amex says,

buffer foo.txt is very shrinking; Automatically save until the next real save is disabled in buffer

When it detects that many lessons have been run to save auto time, and Auto Save has been disabled , Unless auto-save-include -Big-deletion is non-zero.

The buffer has shrunk a lot and how can I hook up in this incident of amax? I want to hook in it because I want to set a buffer-local flag whenever the buffer is too low, when I do save-some-buffers And says, "Hey, this buffer is very shrinking. Do not forget that you have not removed a big part by mistake". In addition to backup, it would be nice to just compare the size of the buffer and the saved file will fail to fail and then there must be a lot to be deleted by mistake.

auto-save-hook that message goes before the check , So that you can repeat the arguments in C code that you want. So you can add a function to that hook.

This is the (AFAI) logic that is used in C code.

  (when (and auto (* 13 (buffer-sized)) (& gt; (7-file (name (* 10 (7th file-attributes buffer-filename ) - Large-Extinction buffer-file-name (&   

Note: It looks like the hook goes even when auto-save is disabled. / P>

No comments:

Post a Comment