[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: master 297d3d2: * lisp/subr.el (dlet): New macro
From: |
Štěpán Němec |
Subject: |
Re: master 297d3d2: * lisp/subr.el (dlet): New macro |
Date: |
Wed, 11 Mar 2020 01:10:27 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
> branch: master
> commit 297d3d2e0e17185387c47ad5a0ce4dd448ef7a29
> Author: Stefan Monnier <address@hidden>
> Commit: Stefan Monnier <address@hidden>
>
> * 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
- Re: master 297d3d2: * lisp/subr.el (dlet): New macro,
Štěpán Němec <=