diff options
| author | Phillip Lord | 2016-06-28 08:02:51 +0100 |
|---|---|---|
| committer | Phillip Lord | 2016-07-06 10:16:10 +0100 |
| commit | 8f9c1eda934fd842f53be2d4e72c41728f9b5bd1 (patch) | |
| tree | 9a19da35fe38d4db2486e9dacb8f02a69ec63d2f | |
| parent | 6f285d963d274aaf70d3909598091065505daff1 (diff) | |
| download | emacs-8f9c1eda934fd842f53be2d4e72c41728f9b5bd1.tar.gz emacs-8f9c1eda934fd842f53be2d4e72c41728f9b5bd1.zip | |
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.
| -rw-r--r-- | lisp/simple.el | 10 | ||||
| -rw-r--r-- | src/fileio.c | 5 |
2 files changed, 14 insertions, 1 deletions
diff --git a/lisp/simple.el b/lisp/simple.el index b66827dfa63..43ad43cf927 100644 --- a/lisp/simple.el +++ b/lisp/simple.el | |||
| @@ -2940,9 +2940,17 @@ behavior." | |||
| 2940 | (cdr buffer-undo-list)))))) | 2940 | (cdr buffer-undo-list)))))) |
| 2941 | (setq undo-auto--last-boundary-cause 0))))) | 2941 | (setq undo-auto--last-boundary-cause 0))))) |
| 2942 | 2942 | ||
| 2943 | ;; This function is called also from one place in fileio.c. We call | ||
| 2944 | ;; this function, rather than undoable-change because it reduces the | ||
| 2945 | ;; number of lisp functions we have to use fboundp for to avoid | ||
| 2946 | ;; bootstrap issues. | ||
| 2947 | (defun undo-auto--undoable-change-no-timer () | ||
| 2948 | "Record `current-buffer' as changed." | ||
| 2949 | (add-to-list 'undo-auto--undoably-changed-buffers (current-buffer))) | ||
| 2950 | |||
| 2943 | (defun undo-auto--undoable-change () | 2951 | (defun undo-auto--undoable-change () |
| 2944 | "Called after every undoable buffer change." | 2952 | "Called after every undoable buffer change." |
| 2945 | (add-to-list 'undo-auto--undoably-changed-buffers (current-buffer)) | 2953 | (undo-auto--undoable-change-no-timer) |
| 2946 | (undo-auto--boundary-ensure-timer)) | 2954 | (undo-auto--boundary-ensure-timer)) |
| 2947 | ;; End auto-boundary section | 2955 | ;; End auto-boundary section |
| 2948 | 2956 | ||
diff --git a/src/fileio.c b/src/fileio.c index b11f9233ab4..3005ca320e7 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -3436,6 +3436,9 @@ by calling `format-decode', which see. */) | |||
| 3436 | if (!NILP (BVAR (current_buffer, read_only))) | 3436 | if (!NILP (BVAR (current_buffer, read_only))) |
| 3437 | Fbarf_if_buffer_read_only (Qnil); | 3437 | Fbarf_if_buffer_read_only (Qnil); |
| 3438 | 3438 | ||
| 3439 | if (!NILP (Ffboundp (Qundo_auto__undoable_change_no_timer))) | ||
| 3440 | call0 (Qundo_auto__undoable_change_no_timer); | ||
| 3441 | |||
| 3439 | val = Qnil; | 3442 | val = Qnil; |
| 3440 | p = Qnil; | 3443 | p = Qnil; |
| 3441 | orig_filename = Qnil; | 3444 | orig_filename = Qnil; |
| @@ -5797,6 +5800,8 @@ syms_of_fileio (void) | |||
| 5797 | which gives a list of operations it handles. */ | 5800 | which gives a list of operations it handles. */ |
| 5798 | DEFSYM (Qoperations, "operations"); | 5801 | DEFSYM (Qoperations, "operations"); |
| 5799 | 5802 | ||
| 5803 | DEFSYM (Qundo_auto__undoable_change_no_timer, "undo-auto--undoable-change-no-timer"); | ||
| 5804 | |||
| 5800 | DEFSYM (Qexpand_file_name, "expand-file-name"); | 5805 | DEFSYM (Qexpand_file_name, "expand-file-name"); |
| 5801 | DEFSYM (Qsubstitute_in_file_name, "substitute-in-file-name"); | 5806 | DEFSYM (Qsubstitute_in_file_name, "substitute-in-file-name"); |
| 5802 | DEFSYM (Qdirectory_file_name, "directory-file-name"); | 5807 | DEFSYM (Qdirectory_file_name, "directory-file-name"); |