help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A strange issue with buffer-undo-list


From: Michael Heerdegen
Subject: Re: A strange issue with buffer-undo-list
Date: Wed, 24 Feb 2021 04:33:15 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

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.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]