0

One of the emacs's nice features is Backup.
But is there any way to prevent backup for files larger than 3MB? Thanks!

2

1 Answer 1

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)))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.