One of the emacs's nice features is Backup.
But is there any way to prevent backup for files larger than 3MB?
Thanks!
Asked
Active
Viewed 33 times
1 Answers
1
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)))

Basil
- 12,383
- 43
- 69
backup-enable-predicate
, or setting it to a custom function which checks the size of its argument? – Basil Mar 27 '21 at 15:40