* Commit for emacs-25, fixing undo with revert-buffer
@ 2016-06-29 23:15 Phillip Lord
2016-06-30 15:39 ` Eli Zaretskii
0 siblings, 1 reply; 7+ messages in thread
From: Phillip Lord @ 2016-06-29 23:15 UTC (permalink / raw)
To: emacs-devel
I would like to apply this patch for emacs-25 fixing Bug#23785.
From d425b7875b162cabf65661e42b62b5e54344ffe6 Mon Sep 17 00:00:00 2001
From: Phillip Lord <phillip.lord@russet.org.uk>
Date: Tue, 28 Jun 2016 08:02:51 +0100
Subject: [PATCH] Fix missing undo-boundary on revert-buffer.
* src/fileio.c (insert-file-contents): Call undo-auto--undoable-change
Addresses Bug#23785.
Do not merge to master as c98bc98 also addresses the same bug.
---
lisp/simple.el | 10 +++++++++-
src/fileio.c | 5 +++++
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/lisp/simple.el b/lisp/simple.el
index b66827d..43ad43c 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -2940,9 +2940,17 @@ undo-auto-amalgamate
(cdr buffer-undo-list))))))
(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 ()
"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))
;; End auto-boundary section
diff --git a/src/fileio.c b/src/fileio.c
index b11f923..3005ca3 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -3436,6 +3436,9 @@ by calling `format-decode', which see. */)
if (!NILP (BVAR (current_buffer, read_only)))
Fbarf_if_buffer_read_only (Qnil);
+ if (!NILP (Ffboundp (Qundo_auto__undoable_change_no_timer)))
+ call0 (Qundo_auto__undoable_change_no_timer);
+
val = Qnil;
p = Qnil;
orig_filename = Qnil;
@@ -5797,6 +5800,8 @@ syms_of_fileio (void)
which gives a list of operations it handles. */
DEFSYM (Qoperations, "operations");
+ DEFSYM (Qundo_auto__undoable_change_no_timer,
"undo-auto--undoable-change-no-timer");
+
DEFSYM (Qexpand_file_name, "expand-file-name");
DEFSYM (Qsubstitute_in_file_name, "substitute-in-file-name");
DEFSYM (Qdirectory_file_name, "directory-file-name");
--
2.9.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: Commit for emacs-25, fixing undo with revert-buffer
2016-06-29 23:15 Commit for emacs-25, fixing undo with revert-buffer Phillip Lord
@ 2016-06-30 15:39 ` Eli Zaretskii
2016-07-04 15:32 ` Phillip Lord
0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2016-06-30 15:39 UTC (permalink / raw)
To: Phillip Lord; +Cc: emacs-devel
> Date: Thu, 30 Jun 2016 00:15:31 +0100
> From: "Phillip Lord" <phillip.lord@russet.org.uk>
>
> I would like to apply this patch for emacs-25 fixing Bug#23785.
Fine with me. Stefan?
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Commit for emacs-25, fixing undo with revert-buffer
2016-06-30 15:39 ` Eli Zaretskii
@ 2016-07-04 15:32 ` Phillip Lord
2016-07-04 16:19 ` Eli Zaretskii
0 siblings, 1 reply; 7+ messages in thread
From: Phillip Lord @ 2016-07-04 15:32 UTC (permalink / raw)
To: Stefan Monnier, Eli Zaretskii; +Cc: emacs-devel
Eli Zaretskii <eliz@gnu.org> writes:
>> Date: Thu, 30 Jun 2016 00:15:31 +0100
>> From: "Phillip Lord" <phillip.lord@russet.org.uk>
>>
>> I would like to apply this patch for emacs-25 fixing Bug#23785.
>
> Fine with me. Stefan?
Stefan, just pinging. Would like to get this bug cleared anyway (you've
seen this patch already, although I think I have cleaned it up a bit).
Phil
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Commit for emacs-25, fixing undo with revert-buffer
2016-07-04 15:32 ` Phillip Lord
@ 2016-07-04 16:19 ` Eli Zaretskii
2016-07-05 9:45 ` Phillip Lord
0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2016-07-04 16:19 UTC (permalink / raw)
To: Phillip Lord; +Cc: monnier, emacs-devel
> From: phillip.lord@russet.org.uk (Phillip Lord)
> Date: Mon, 04 Jul 2016 16:32:36 +0100
> Cc: emacs-devel@gnu.org
>
>
> Eli Zaretskii <eliz@gnu.org> writes:
>
> >> Date: Thu, 30 Jun 2016 00:15:31 +0100
> >> From: "Phillip Lord" <phillip.lord@russet.org.uk>
> >>
> >> I would like to apply this patch for emacs-25 fixing Bug#23785.
> >
> > Fine with me. Stefan?
>
>
> Stefan, just pinging. Would like to get this bug cleared anyway (you've
> seen this patch already, although I think I have cleaned it up a bit).
I think you have the bug number wrong, and Stefan did respond to your
patch wrt bug#23871:
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=23871#98
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Commit for emacs-25, fixing undo with revert-buffer
2016-07-04 16:19 ` Eli Zaretskii
@ 2016-07-05 9:45 ` Phillip Lord
2016-07-05 21:51 ` Stefan Monnier
0 siblings, 1 reply; 7+ messages in thread
From: Phillip Lord @ 2016-07-05 9:45 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: monnier, emacs-devel
Eli Zaretskii <eliz@gnu.org> writes:
>> Stefan, just pinging. Would like to get this bug cleared anyway (you've
>> seen this patch already, although I think I have cleaned it up a bit).
>
> I think you have the bug number wrong, and Stefan did respond to your
> patch wrt bug#23871:
>
> http://debbugs.gnu.org/cgi/bugreport.cgi?bug=23871#98
Sorry, different one. Bug# 23785 and this patch.
Phil
>From d425b7875b162cabf65661e42b62b5e54344ffe6 Mon Sep 17 00:00:00 2001
From: Phillip Lord <phillip.lord@russet.org.uk>
Date: Tue, 28 Jun 2016 08:02:51 +0100
Subject: [PATCH] Fix missing undo-boundary on revert-buffer.
* src/fileio.c (insert-file-contents): Call undo-auto--undoable-change
Addresses Bug#23785.
Do not merge to master as c98bc98 also addresses the same bug.
---
lisp/simple.el | 10 +++++++++-
src/fileio.c | 5 +++++
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/lisp/simple.el b/lisp/simple.el
index b66827d..43ad43c 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -2940,9 +2940,17 @@ undo-auto-amalgamate
(cdr buffer-undo-list))))))
(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 ()
"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))
;; End auto-boundary section
diff --git a/src/fileio.c b/src/fileio.c
index b11f923..3005ca3 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -3436,6 +3436,9 @@ by calling `format-decode', which see. */)
if (!NILP (BVAR (current_buffer, read_only)))
Fbarf_if_buffer_read_only (Qnil);
+ if (!NILP (Ffboundp (Qundo_auto__undoable_change_no_timer)))
+ call0 (Qundo_auto__undoable_change_no_timer);
+
val = Qnil;
p = Qnil;
orig_filename = Qnil;
@@ -5797,6 +5800,8 @@ syms_of_fileio (void)
which gives a list of operations it handles. */
DEFSYM (Qoperations, "operations");
+ DEFSYM (Qundo_auto__undoable_change_no_timer,
"undo-auto--undoable-change-no-timer");
+
DEFSYM (Qexpand_file_name, "expand-file-name");
DEFSYM (Qsubstitute_in_file_name, "substitute-in-file-name");
DEFSYM (Qdirectory_file_name, "directory-file-name");
--
2.9.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: Commit for emacs-25, fixing undo with revert-buffer
2016-07-05 9:45 ` Phillip Lord
@ 2016-07-05 21:51 ` Stefan Monnier
2016-07-06 18:27 ` John Wiegley
0 siblings, 1 reply; 7+ messages in thread
From: Stefan Monnier @ 2016-07-05 21:51 UTC (permalink / raw)
To: Phillip Lord; +Cc: Eli Zaretskii, emacs-devel
> * src/fileio.c (insert-file-contents): Call undo-auto--undoable-change
The above changelog does not cover all changes introduced by the patch,
but other than that, the patch seems OK, yes.
Stefan
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Commit for emacs-25, fixing undo with revert-buffer
2016-07-05 21:51 ` Stefan Monnier
@ 2016-07-06 18:27 ` John Wiegley
0 siblings, 0 replies; 7+ messages in thread
From: John Wiegley @ 2016-07-06 18:27 UTC (permalink / raw)
To: Stefan Monnier; +Cc: Eli Zaretskii, emacs-devel, Phillip Lord
>>>>> Stefan Monnier <monnier@iro.umontreal.ca> writes:
> The above changelog does not cover all changes introduced by the patch, but
> other than that, the patch seems OK, yes.
And fine with me as well.
--
John Wiegley GPG fingerprint = 4710 CF98 AF9B 327B B80F
http://newartisans.com 60E1 46C4 BD1A 7AC1 4BA2
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2016-07-06 18:27 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-29 23:15 Commit for emacs-25, fixing undo with revert-buffer Phillip Lord
2016-06-30 15:39 ` Eli Zaretskii
2016-07-04 15:32 ` Phillip Lord
2016-07-04 16:19 ` Eli Zaretskii
2016-07-05 9:45 ` Phillip Lord
2016-07-05 21:51 ` Stefan Monnier
2016-07-06 18:27 ` John Wiegley
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.