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

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

bug#23871: 25.1.50; Undo unexpectedly leads to blank buffer


From: Eli Zaretskii
Subject: bug#23871: 25.1.50; Undo unexpectedly leads to blank buffer
Date: Sat, 02 Jul 2016 10:35:31 +0300

> From: phillip.lord@russet.org.uk (Phillip Lord)
> Cc: Eli Zaretskii <eliz@gnu.org>,  23871@debbugs.gnu.org
> Date: Fri, 01 Jul 2016 23:21:01 +0100
> 
> (let ((p (start-process "bc" (current-buffer) "bc")))
>   (process-send-string p "2^10\n")
>   (goto-char (point-max)))
> 
> The strange thing here is that it's not specifically an undo problem.
> Point doesn't move after eval-defun.

The problem, AFAIU, is in point movements _during_ eval-defun: they
seem to not be recorded in buffer-undo-list.  The undo list I get
after C-M-x is this:

  (nil (117 . 122) (t 22391 27551 0 0))

The only information about point there is position 117, which is where
undo leaves point after C-/.  The information about point position at
buffer position 1 was lost.  IOW, this fragment of elisp--eval-defun:

        ;; Read the form from the buffer, and record where it ends.
        (save-excursion
          (end-of-defun)
          (beginning-of-defun)
          (setq beg (point))
          (setq form (read (current-buffer)))
          (setq end (point)))

somehow does not reflected point movements in buffer's undo list.

By contrast, in Emacs 24.5, buffer-undo-list after C-M-x is this:

  (nil (117 . 122) 1 (t 22391 27551 0 0))

Note position 1 in it.





reply via email to

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