0

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

Drew
  • 77,472
  • 10
  • 114
  • 243
Samira
  • 1

1 Answers1

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