Fix missing undo-boundary on revert-buffer.
* lisp/simple.el (undo-auto--undoable-change-no-timer): New function.
* src/fileio.c (insert-buffer-contents): Call
undo-auto--undoably-changed-buffers before changes.
Addresses Bug#23785.
Do not merge to master as c98bc98
also addresses the same bug.
This commit is contained in:
parent
6f285d963d
commit
8f9c1eda93
2 changed files with 14 additions and 1 deletions
|
@ -2940,9 +2940,17 @@ behavior."
|
||||||
(cdr buffer-undo-list))))))
|
(cdr buffer-undo-list))))))
|
||||||
(setq undo-auto--last-boundary-cause 0)))))
|
(setq undo-auto--last-boundary-cause 0)))))
|
||||||
|
|
||||||
|
;; This function is called also from one place in fileio.c. We call
|
||||||
|
;; this function, rather than undoable-change because it reduces the
|
||||||
|
;; number of lisp functions we have to use fboundp for to avoid
|
||||||
|
;; bootstrap issues.
|
||||||
|
(defun undo-auto--undoable-change-no-timer ()
|
||||||
|
"Record `current-buffer' as changed."
|
||||||
|
(add-to-list 'undo-auto--undoably-changed-buffers (current-buffer)))
|
||||||
|
|
||||||
(defun undo-auto--undoable-change ()
|
(defun undo-auto--undoable-change ()
|
||||||
"Called after every undoable buffer change."
|
"Called after every undoable buffer change."
|
||||||
(add-to-list 'undo-auto--undoably-changed-buffers (current-buffer))
|
(undo-auto--undoable-change-no-timer)
|
||||||
(undo-auto--boundary-ensure-timer))
|
(undo-auto--boundary-ensure-timer))
|
||||||
;; End auto-boundary section
|
;; End auto-boundary section
|
||||||
|
|
||||||
|
|
|
@ -3436,6 +3436,9 @@ by calling `format-decode', which see. */)
|
||||||
if (!NILP (BVAR (current_buffer, read_only)))
|
if (!NILP (BVAR (current_buffer, read_only)))
|
||||||
Fbarf_if_buffer_read_only (Qnil);
|
Fbarf_if_buffer_read_only (Qnil);
|
||||||
|
|
||||||
|
if (!NILP (Ffboundp (Qundo_auto__undoable_change_no_timer)))
|
||||||
|
call0 (Qundo_auto__undoable_change_no_timer);
|
||||||
|
|
||||||
val = Qnil;
|
val = Qnil;
|
||||||
p = Qnil;
|
p = Qnil;
|
||||||
orig_filename = Qnil;
|
orig_filename = Qnil;
|
||||||
|
@ -5797,6 +5800,8 @@ syms_of_fileio (void)
|
||||||
which gives a list of operations it handles. */
|
which gives a list of operations it handles. */
|
||||||
DEFSYM (Qoperations, "operations");
|
DEFSYM (Qoperations, "operations");
|
||||||
|
|
||||||
|
DEFSYM (Qundo_auto__undoable_change_no_timer, "undo-auto--undoable-change-no-timer");
|
||||||
|
|
||||||
DEFSYM (Qexpand_file_name, "expand-file-name");
|
DEFSYM (Qexpand_file_name, "expand-file-name");
|
||||||
DEFSYM (Qsubstitute_in_file_name, "substitute-in-file-name");
|
DEFSYM (Qsubstitute_in_file_name, "substitute-in-file-name");
|
||||||
DEFSYM (Qdirectory_file_name, "directory-file-name");
|
DEFSYM (Qdirectory_file_name, "directory-file-name");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue