all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Michael Heerdegen <michael_heerdegen@web.de>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Lars Ingebrigtsen <larsi@gnus.org>, 33341@debbugs.gnu.org
Subject: bug#33341: 27.0.50; Undo log merging and change groups
Date: Fri, 27 Nov 2020 02:11:23 +0100	[thread overview]
Message-ID: <87im9r38p0.fsf@web.de> (raw)
In-Reply-To: <jwvsg8v96u1.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Thu, 26 Nov 2020 15:55:42 -0500")

Stefan Monnier <monnier@iro.umontreal.ca> writes:

> Could you check why it breaks in the absence of an undo-boundary?

I have edebugged `org-entry-get'.  Short version: it is as it seems.
Here is the example again:

#+begin_src emacs-lisp
(defun my-test-change-groups ()
  (interactive)
  (insert "0\n")
  ;; (undo-boundary)
  (let ((g (prepare-change-group)))
    (activate-change-group g)
    (insert "b\n")
    (insert "c\n")
    (cancel-change-group g)))
#+end_src

Without the boundary, all changes are combined into one (1 . 10) undo
entry.  And then these code lines

#+begin_src emacs-lisp
;; Temporarily truncate the undo log at ELT.
(when (consp elt)
  (setcar elt nil) (setcdr elt nil))
#+end_src

cause that were the undo should happen:

#+begin_src emacs-lisp
;; Undo it all.
(save-excursion
  (while (listp pending-undo-list) (undo-more 1)))
#+end_src

nothing is undone.

With the boundary, we have two undo entries, and the truncated log still
contains the entry for the first `insert' call.

Regards,

Michael.





  reply	other threads:[~2020-11-27  1:11 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-11  7:50 bug#33341: 27.0.50; Undo log merging and change groups Michael Heerdegen
2020-11-26 12:34 ` Lars Ingebrigtsen
2020-11-26 14:16   ` Michael Heerdegen
2020-11-26 14:49     ` Michael Heerdegen
2020-11-26 20:26       ` Michael Heerdegen
2020-11-26 20:55         ` Stefan Monnier
2020-11-27  1:11           ` Michael Heerdegen [this message]
2020-11-27 14:44             ` Stefan Monnier
2020-11-27 17:43               ` Michael Heerdegen

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=87im9r38p0.fsf@web.de \
    --to=michael_heerdegen@web.de \
    --cc=33341@debbugs.gnu.org \
    --cc=larsi@gnus.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.