One of the emacs's nice features is Backup.
But is there any way to prevent backup for files larger than 3MB?
Thanks!
1 Answer
I haven't tested this, but here's an example of how you could advise backup-enable-predicate
so that your size check happens only after the default backup-enable-predicate
has determined that your file should be backed up:
(add-function :after-while backup-enable-predicate
(lambda (file)
;; Back up FILE only if it is smaller than 3 MiB.
(< (file-attribute-size (file-attributes file)) 3145728)))
backup-enable-predicate
, or setting it to a custom function which checks the size of its argument?