emacs-devel
[Top][All Lists]
Advanced

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

Re: Edebug corrupting point in buffers.


From: Alan Mackenzie
Subject: Re: Edebug corrupting point in buffers.
Date: Thu, 3 Nov 2022 19:57:46 +0000

Hello, Stefan.

On Thu, Nov 03, 2022 at 15:29:38 -0400, Stefan Monnier wrote:
> Eli Zaretskii [2022-11-02 16:00:52] wrote:

> >> Date: Wed, 2 Nov 2022 11:34:37 +0000
> >> Cc: emacs-devel@gnu.org
> >> From: Alan Mackenzie <acm@muc.de>

> >> (i) Emacs -Q.
> >> (ii) On a single frame, arrange buffers *scratch*, test-edebug.el, and
> >>   some other substantial buffer, that I call emacs.README.
> >> (iii) Put point in emacs.README somewhere other than point-max.
> >> (iv) Instrument test-edebug for edebug with C-u C-M-x.
> >> (iv)a Put point into window *scratch*.
> >> (v) M-: (test-edebug).
> >> (vi) Step through test-edebug using the space key.
> >> (vii) Note that the second text insertion happens where point was in the
> >>   window, not at point-max.  This is the bug.

> > Yes, I see the problem, but setting edebug-save-windows to nil
> > eliminates it.  So I think we already have a solution for the rare
> > situations where this is an issue.

> I wish Someoneā„¢ could dig into the problem further and find the source
> of the problem and an actual fix, but indeed, this seems like a fair
> workaround in the mean time.

I think I said something about this earlier on in the thread.  The cause
seems to be that random bits of software wrongly consider it their
business to overwrite the buffer point with a window point.

Amongst these bits of software are select-window,
set-window-configuration, and our very own edebug-set-buffer-points
(triggered by the option edebug-save-displayed-buffer-points).  I think
there are many more.

The solution, were it practicable, would be to have only the command
loop or maybe redisplay copying WP to BP, and only just before the
window becomes the current place where the user might edit.

> Maybe a good short term "fix/workaround" is to change the implementation
> of `edebug-save-windows` so that in addition to the windows's info it
> also saves&restores the buffer-point of those buffers displayed in the
> saved windows.

My first patch did something like this.  It saved the buffer points of
all buffers, then restored it in buffers selected by the user.  This
patch was rejected (and I think rightly so) for being too clumsy to use.

>         Stefan

-- 
Alan Mackenzie (Nuremberg, Germany).



reply via email to

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