\f
* Incompatible Lisp Changes in Emacs 29.1
+---
+** 'with-silent-modifications' also restores buffer modification ticks.
+'with-silent-modifications' is a macro meant to be used by the font
+locking machinery to allow applying text properties without changing
+the modification status of the buffer. However, it didn't restore the
+buffer modification ticks, so applying font locking to a modified
+buffer that had already been auto-saved would trigger another
+auto-saving. This is no longer the case.
+
---
** 'prin1' doesn't always escape "." and "?" in symbols any more.
Previously, symbols like 'foo.bar' would be printed by 'prin1' as
someone else, running buffer modification hooks, and other things
of that nature."
(declare (debug t) (indent 0))
- (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))))))
return modiff_to_integer (BUF_MODIFF (decode_buffer (buffer)));
}
+DEFUN ("internal--set-buffer-modified-tick",
+ Finternal__set_buffer_modified_tick, Sinternal__set_buffer_modified_tick,
+ 1, 2, 0,
+ doc: /* Set BUFFER's tick counter to TICK.
+No argument or nil as argument means use current buffer as BUFFER. */)
+ (Lisp_Object tick, Lisp_Object buffer)
+{
+ CHECK_FIXNUM (tick);
+ BUF_MODIFF (decode_buffer (buffer)) = XFIXNUM (tick);
+ return Qnil;
+}
+
DEFUN ("buffer-chars-modified-tick", Fbuffer_chars_modified_tick,
Sbuffer_chars_modified_tick, 0, 1, 0,
doc: /* Return BUFFER's character-change tick counter.
defsubr (&Sforce_mode_line_update);
defsubr (&Sset_buffer_modified_p);
defsubr (&Sbuffer_modified_tick);
+ defsubr (&Sinternal__set_buffer_modified_tick);
defsubr (&Sbuffer_chars_modified_tick);
defsubr (&Srename_buffer);
defsubr (&Sother_buffer);