]> git.eshelyaron.com Git - emacs.git/commit
Fix undo of changes in cloned indirect buffers
authorEli Zaretskii <eliz@gnu.org>
Thu, 7 Jul 2022 08:56:31 +0000 (11:56 +0300)
committerEli Zaretskii <eliz@gnu.org>
Thu, 7 Jul 2022 08:56:31 +0000 (11:56 +0300)
commit74f43f82e6b4702027d99edb6ca125f3243ce4ba
tree7d8fbfec626fe32b87ea7518219a5365d47bfd3e
parentb075a59a1a4ddfd0668da4fb2312a6ec747dd53b
Fix undo of changes in cloned indirect buffers

* lisp/simple.el (primitive-undo): If the visited-modtime of the
indirect buffer's file is bogus, use the modtime of the file
visited by its base buffer.

* src/undo.c (record_first_change): Call
'buffer_visited_file_modtime' with the correct buffer, instead of
always calling 'Fvisited_file_modtime', which returns possibly
bogus values for indirect buffers.
* src/fileio.c (Fset_visited_file_modtime): Signal a meaningful
error for indirect buffers.
(buffer_visited_file_modtime): New function, with implementation
taken from 'Fvisited_file_modtime'.
(Fvisited_file_modtime): Call 'buffer_visited_file_modtime'.
* src/lisp.h: Add prototype for 'buffer_visited_file_modtime'.
(Bug#56397)
lisp/simple.el
src/fileio.c
src/lisp.h
src/undo.c