* Re: master 297d3d2: * lisp/subr.el (dlet): New macro
[not found] ` <20200310160058.8122E20B7E@vcs0.savannah.gnu.org>
@ 2020-03-11 0:10 ` Štěpán Němec
2020-03-11 2:02 ` Stefan Monnier
0 siblings, 1 reply; 2+ messages in thread
From: Štěpán Němec @ 2020-03-11 0:10 UTC (permalink / raw)
To: Stefan Monnier; +Cc: emacs-devel
> branch: master
> commit 297d3d2e0e17185387c47ad5a0ce4dd448ef7a29
> Author: Stefan Monnier <monnier@iro.umontreal.ca>
> Commit: Stefan Monnier <monnier@iro.umontreal.ca>
>
> * lisp/subr.el (dlet): New macro
>
> * lisp/calendar/calendar.el (calendar-dlet*): Use it.
> ---
[...]
> diff --git a/lisp/subr.el b/lisp/subr.el
> index 13515ca..359f51c 100644
> --- a/lisp/subr.el
> +++ b/lisp/subr.el
> @@ -2972,13 +2987,14 @@ This finishes the change group by reverting all of its changes."
> ;; the body of `atomic-change-group' all changes can be undone.
> (widen)
> (let ((old-car (car-safe elt))
> - (old-cdr (cdr-safe elt)))
> + (old-cdr (cdr-safe elt))
> + (start-pul pending-undo-list))
> (unwind-protect
> (progn
> ;; Temporarily truncate the undo log at ELT.
> (when (consp elt)
> (setcar elt nil) (setcdr elt nil))
> - (unless (eq last-command 'undo) (undo-start))
> + (setq pending-undo-list buffer-undo-list)
> ;; Make sure there's no confusion.
> (when (and (consp elt) (not (eq elt (last pending-undo-list))))
> (error "Undoing to some unrelated state"))
> @@ -2991,7 +3007,13 @@ This finishes the change group by reverting all of its changes."
> ;; Reset the modified cons cell ELT to its original content.
> (when (consp elt)
> (setcar elt old-car)
> - (setcdr elt old-cdr))))))))
> + (setcdr elt old-cdr)))
> + ;; Let's not break a sequence of undos just because we
> + ;; tried to make a change and then undid it: preserve
> + ;; the original `pending-undo-list' if it's still valid.
> + (if (eq (undo--last-change-was-undo-p buffer-undo-list)
> + start-pul)
> + (setq pending-undo-list start-pul)))))))
Was including these bug#39680 (27.0.60; electric-pair-mode broken by
undo)-related changes in this commit intentional?
--
Štěpán
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: master 297d3d2: * lisp/subr.el (dlet): New macro
2020-03-11 0:10 ` master 297d3d2: * lisp/subr.el (dlet): New macro Štěpán Němec
@ 2020-03-11 2:02 ` Stefan Monnier
0 siblings, 0 replies; 2+ messages in thread
From: Stefan Monnier @ 2020-03-11 2:02 UTC (permalink / raw)
To: Štěpán Němec; +Cc: emacs-devel
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/x-markdown; coding=UTF-8, Size: 289 bytes --]
> Was including these bug#39680 (27.0.60; electric-pair-mode broken by
> undo)-related changes in this commit intentional?
[ Damn! Not again! ]
Thanks for the heads up, no indeed it wasn't the intention.
Not sure how I managed not to see it in the *vc-diff* buffer.
Stefan
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-03-11 2:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20200310160056.17081.81443@vcs0.savannah.gnu.org>
[not found] ` <20200310160058.8122E20B7E@vcs0.savannah.gnu.org>
2020-03-11 0:10 ` master 297d3d2: * lisp/subr.el (dlet): New macro Štěpán Němec
2020-03-11 2:02 ` Stefan Monnier
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).