all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Štěpán Němec" <stepnem@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: master 297d3d2: * lisp/subr.el (dlet): New macro
Date: Wed, 11 Mar 2020 01:10:27 +0100	[thread overview]
Message-ID: <874kuvkaz0.fsf@gmail.com> (raw)
In-Reply-To: <20200310160058.8122E20B7E@vcs0.savannah.gnu.org> (Stefan Monnier's message of "Tue, 10 Mar 2020 12:00:57 -0400 (EDT)")


> 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



       reply	other threads:[~2020-03-11  0:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20200310160056.17081.81443@vcs0.savannah.gnu.org>
     [not found] ` <20200310160058.8122E20B7E@vcs0.savannah.gnu.org>
2020-03-11  0:10   ` Štěpán Němec [this message]
2020-03-11  2:02     ` master 297d3d2: * lisp/subr.el (dlet): New macro Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874kuvkaz0.fsf@gmail.com \
    --to=stepnem@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.