[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: master e8488bcc9c: Avoid having font locking triggering unnecessary
From: |
Stefan Monnier |
Subject: |
Re: master e8488bcc9c: Avoid having font locking triggering unnecessary auto-saving |
Date: |
Sat, 07 May 2022 12:06:10 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) |
> - (let ((modified (make-symbol "modified")))
> + (let ((modified (make-symbol "modified"))
> + (tick (make-symbol "tick")))
> `(let* ((,modified (buffer-modified-p))
> + (,tick (buffer-modified-tick))
> (buffer-undo-list t)
> (inhibit-read-only t)
> (inhibit-modification-hooks t))
> (unwind-protect
> (progn
> ,@body)
> + ;; We restore the buffer tick count, too, because otherwise
> + ;; we'll trigger a new auto-save.
> + (internal--set-buffer-modified-tick ,tick)
> (unless ,modified
> (restore-buffer-modified-p nil))))))
BTW, I wonder if the auto-save mechanism should use the CHARS_MODIFF
ticks instead?
Stefan
- Re: master e8488bcc9c: Avoid having font locking triggering unnecessary auto-saving,
Stefan Monnier <=