all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 60467@debbugs.gnu.org, Gregory Heytings <gregory@heytings.org>,
	Ihor Radchenko <yantar92@posteo.net>
Subject: bug#60467: 30.0.50; primitive-undo: Changes to be undone by function different from announced
Date: Sun, 8 Jan 2023 15:43:36 +0000	[thread overview]
Message-ID: <Y7rkqBW2caZiNeYM@ACM> (raw)
In-Reply-To: <jwvpmbvk5vn.fsf-monnier+emacs@gnu.org>

Hello, Stefan.

On Tue, Jan 03, 2023 at 10:16:54 -0500, Stefan Monnier wrote:
> > <undo element 1> <timestamp> <undo element 2> <timestamp> nil <undo element 3>

> > ofter body has been evaluated, the buffer-undo-list after
> > combine-change-call is

> > (apply ... #'undo--wrap-and-run-primitive-undo ... (<undo element 1>))
> > <timestamp>  <undo element 2> <timestamp> nil <undo element 3>

> > which is clearly wrong

> Indeed.  Which begs the question: why does the current code stop when it
> sees a timestamp?

> Alan?  Do you remember why you did that?

I'm afraid not.  On 2018-04-01, I noted down that timestamps get "caught
up inside the undo--wrap-and-run-primitive-undo entry.".  But I neglected
to be more specific, and can no longer remember exactly why.

> What would go wrong if we applied a patch like the one below?

I don't know.  Possibly nothing.  Maybe the problem that that code was
meant to solve was also solved by some other code.

>         Stefan


> diff --git a/lisp/subr.el b/lisp/subr.el
> index 5fb150994ec..6f51ac90ce5 100644
> --- a/lisp/subr.el
> +++ b/lisp/subr.el
> @@ -4972,10 +4972,11 @@ combine-change-calls-1
>  			      ;; In case garbage collection has removed OLD-BUL.
>  			      (cdr ptr)
>  			      ;; Don't include a timestamp entry.
> -			      (not (and (consp (cdr ptr))
> -					(consp (cadr ptr))
> -					(eq (caadr ptr) t)
> -					(setq old-bul (cdr ptr)))))
> +			      ;; (not (and (consp (cdr ptr))
> +			      ;;   	(consp (cadr ptr))
> +			      ;;   	(eq (caadr ptr) t)
> +			      ;;   	(setq old-bul (cdr ptr))))
> +			      )
>  		    (setq ptr (cdr ptr)))
>  		  (unless (cdr ptr)
>  		    (message "combine-change-calls: buffer-undo-list broken"))

-- 
Alan Mackenzie (Nuremberg, Germany).





  parent reply	other threads:[~2023-01-08 15:43 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-01 13:40 bug#60467: 30.0.50; primitive-undo: Changes to be undone by function different from announced Ihor Radchenko
2023-01-01 14:38 ` Eli Zaretskii
2023-01-02  0:46 ` Gregory Heytings
2023-01-02  1:50   ` Gregory Heytings
2023-01-02  9:31     ` Ihor Radchenko
2023-01-03  9:41       ` Gregory Heytings
2023-01-03 12:46         ` Eli Zaretskii
2023-01-03 13:44           ` Gregory Heytings
2023-01-03 14:48             ` Eli Zaretskii
2023-01-03 15:05               ` Gregory Heytings
2023-01-03 16:10                 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-01-03 16:33                   ` Gregory Heytings
2023-01-03 16:51                     ` Gregory Heytings
2023-01-04  0:16                     ` Gregory Heytings
2023-01-04  2:49                       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-01-04  9:24                         ` Gregory Heytings
2023-01-04 10:50                           ` Gregory Heytings
2023-01-04 14:39                             ` Eli Zaretskii
2023-01-04 14:43                               ` Gregory Heytings
2023-01-04 14:36                           ` Eli Zaretskii
2023-01-04 14:39                             ` Gregory Heytings
2023-01-04 18:02                               ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-01-04 18:16                                 ` Gregory Heytings
2023-01-04 18:42                                   ` Eli Zaretskii
2023-01-04 21:04                                     ` Gregory Heytings
2023-01-03 14:56             ` Gregory Heytings
2023-01-03 15:16         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-01-03 15:29           ` Gregory Heytings
2023-01-03 16:32             ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-01-08 15:43           ` Alan Mackenzie [this message]
2023-01-09  6:03             ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-01-09 12:16               ` Eli Zaretskii
2023-01-13 22:45                 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-01-14  7:06                   ` Eli Zaretskii
2023-01-02  9:27   ` Ihor Radchenko
2023-06-22 19:28 ` bug#60467: New problem introduced Frédéric Giquel via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-23 11:01   ` bug#60467: 30.0.50; primitive-undo: Changes to be undone by function different from announced Eli Zaretskii
2023-06-23 13:06     ` Gregory Heytings
2023-06-26 14:51       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-26 14:53       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-26 15:18         ` Gregory Heytings
2023-06-26 15:30           ` Eli Zaretskii
2023-07-01 14:14             ` Gregory Heytings
2023-07-01 14:27               ` Eli Zaretskii
2023-07-15  7:46                 ` Eli Zaretskii
2023-08-03  7:38                   ` Eli Zaretskii
2023-08-10 11:28                     ` Gregory Heytings
2023-08-10 13:41                       ` Eli Zaretskii
2023-08-10 13:55                         ` Gregory Heytings
2023-08-12  7:09                           ` Eli Zaretskii
2023-08-16 16:09                             ` Gregory Heytings
     [not found] <3eea0a7dff2915453876fc3a2b628886c78a4d4b.camel@laposte.net>
2023-07-04  0:03 ` sbaugh

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=Y7rkqBW2caZiNeYM@ACM \
    --to=acm@muc.de \
    --cc=60467@debbugs.gnu.org \
    --cc=gregory@heytings.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=yantar92@posteo.net \
    /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.