From: Michael Heerdegen <michael_heerdegen@web.de>
To: help-gnu-emacs@gnu.org
Cc: Stefan Monnier <monnier@iro.umontreal.ca>
Subject: Re: A strange issue with buffer-undo-list
Date: Wed, 24 Feb 2021 04:33:15 +0100 [thread overview]
Message-ID: <87h7m2rvgk.fsf@web.de> (raw)
In-Reply-To: 87o8gbqs28.fsf@mbork.pl
Marcin Borkowski <mbork@mbork.pl> writes:
> (defun move-line-down (count)
> "Move the current line down."
> (interactive "p")
> (let ((position-in-line (current-column)))
> (push (point) buffer-undo-list)
> (line-move 1)
> (transpose-lines count)
> (line-move -1)
> (move-to-column position-in-line)))
>
>
> which triggers an error.
[when invoking undo after using it]
Seems the error happens in the code for fixing Bug#33341 by Stefan:
(defun activate-change-group (handle)
"Activate a change group made with `prepare-change-group' (which see)."
(dolist (elt handle)
(with-current-buffer (car elt)
(if (eq buffer-undo-list t)
(setq buffer-undo-list nil)
;; [huge comment here]
(when (numberp (caar buffer-undo-list)) ;; <--- here
(push (cons (caar buffer-undo-list) (caar buffer-undo-list))
buffer-undo-list))))))
I guess that `caar' should be (car-safe (car buffer-undo-list)) or so -
right?
Michael.
next prev parent reply other threads:[~2021-02-24 3:33 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-23 5:19 A strange issue with buffer-undo-list Marcin Borkowski
2021-02-24 0:43 ` Michael Heerdegen
2021-02-25 5:16 ` Marcin Borkowski
2021-02-25 5:28 ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-02-25 14:19 ` Stefan Monnier
2021-02-25 15:58 ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-03-08 21:43 ` Marcin Borkowski
2021-02-26 0:53 ` Michael Heerdegen
2021-03-08 21:42 ` Marcin Borkowski
2021-03-09 0:32 ` Michael Heerdegen
2021-03-09 21:22 ` Marcin Borkowski
2021-02-24 2:11 ` Michael Heerdegen
2021-02-24 3:33 ` Michael Heerdegen [this message]
2021-02-24 4:49 ` 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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87h7m2rvgk.fsf@web.de \
--to=michael_heerdegen@web.de \
--cc=help-gnu-emacs@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.
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).