unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Edebug corrupting point in buffers; we need buffer-point and set-buffer-point, perhaps.
@ 2022-10-31 11:43 Alan Mackenzie
  2022-10-31 13:16 ` Eli Zaretskii
                   ` (2 more replies)
  0 siblings, 3 replies; 62+ messages in thread
From: Alan Mackenzie @ 2022-10-31 11:43 UTC (permalink / raw)
  To: emacs-devel

Hello, Emacs.

A few weeks ago, I was attempting to edebug a program which itself
scanned through a buffer B.  That buffer was also displayed in a window
(or possibly two windows).  Each time the program went into edebug, the
point in B got corrupted.

Setting edebug-save-displayed-buffer-points didn't help.

I now understand what was going wrong.  Without
edebug-save-displayed-buffer-points, B's point got set to a window point
from a random window displaying B, caused by a set-window-configuration
call from edebug.

With edebug-save-displayed-buffer-points set, the function
edebug-get-displayed-buffer points was recording window-points for each
displayed window, but after the recursive edit was writing these
window-points back into the buffer points.  This is surely a bug.  At the
least, there is a race condition if two windows display the same buffer.

In neither of the above scenarios does edebug do anything to restore the
buffer points after the recursive edit.  This seems to be a bad thing.

I propose that edebug should get an option to preserve buffer points,
alongside the existing options which preserve window points.

One downside of this would be the runtime involved in the set-buffer
calls needed to call `point' and `goto-char'.  This could make edebug
quite sluggish.  So, why don't we introduce new functions buffer-point
and set-buffer-point?  These would enable edebug to record and restore
these points economically.  Why don't these functions exist already?

-- 
Alan Mackenzie (Nuremberg, Germany).



^ permalink raw reply	[flat|nested] 62+ messages in thread

end of thread, other threads:[~2022-11-06 14:40 UTC | newest]

Thread overview: 62+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-31 11:43 Edebug corrupting point in buffers; we need buffer-point and set-buffer-point, perhaps Alan Mackenzie
2022-10-31 13:16 ` Eli Zaretskii
2022-10-31 14:32   ` Alan Mackenzie
2022-10-31 14:50     ` Eli Zaretskii
2022-10-31 15:46       ` Alan Mackenzie
2022-10-31 17:33         ` Stefan Monnier
2022-10-31 17:55         ` Eli Zaretskii
2022-10-31 20:46           ` Alan Mackenzie
2022-11-01  6:21             ` Eli Zaretskii
2022-10-31 17:19       ` Stefan Monnier
2022-10-31 18:09         ` Eli Zaretskii
2022-10-31 20:35           ` Stefan Monnier
2022-10-31 17:21 ` Stefan Monnier
2022-10-31 18:10   ` Eli Zaretskii
2022-10-31 23:14     ` Stefan Monnier
2022-11-01  7:06       ` Eli Zaretskii
2022-10-31 21:25 ` Alan Mackenzie
2022-11-01  6:45   ` Eli Zaretskii
2022-11-01 11:41     ` Edebug corrupting point in buffers Alan Mackenzie
2022-11-01 11:53       ` Eli Zaretskii
2022-11-01 13:42         ` Alan Mackenzie
2022-11-01 14:42           ` Eli Zaretskii
2022-11-01 17:06             ` Alan Mackenzie
2022-11-01 17:12               ` Eli Zaretskii
2022-11-01 17:24                 ` Alan Mackenzie
2022-11-01 17:57                   ` Eli Zaretskii
2022-11-01 19:02                     ` Alan Mackenzie
2022-11-01 19:47                       ` Stefan Monnier
2022-11-01 20:53                         ` Alan Mackenzie
2022-11-01 21:51                           ` Stefan Monnier
2022-11-02 10:40                             ` Alan Mackenzie
2022-11-02 13:12                               ` Stefan Monnier
2022-11-02 13:28                                 ` Eli Zaretskii
2022-11-02  3:28                         ` Eli Zaretskii
2022-11-02 12:53                           ` Stefan Monnier
2022-11-02 17:40                       ` Juri Linkov
2022-11-02 18:26                         ` Eli Zaretskii
2022-11-02 18:36                           ` Juri Linkov
2022-11-02 18:52                             ` Eli Zaretskii
2022-11-03 17:25                               ` Juri Linkov
2022-11-03 18:06                                 ` Eli Zaretskii
2022-11-03 18:31                                   ` Juri Linkov
2022-11-02 11:34                     ` Alan Mackenzie
2022-11-02 14:00                       ` Eli Zaretskii
2022-11-02 16:18                         ` Alan Mackenzie
2022-11-02 16:57                           ` Eli Zaretskii
2022-11-03 11:32                             ` Alan Mackenzie
2022-11-03 13:29                               ` Eli Zaretskii
2022-11-03 18:07                                 ` Alan Mackenzie
2022-11-03 18:15                                   ` Eli Zaretskii
2022-11-03 20:25                                     ` Alan Mackenzie
2022-11-05 11:24                                       ` Eli Zaretskii
2022-11-05 16:50                                         ` Alan Mackenzie
2022-11-06  8:10                                           ` Eli Zaretskii
2022-11-06 14:40                                             ` Alan Mackenzie
2022-11-03 19:29                         ` Stefan Monnier
2022-11-03 19:36                           ` Eli Zaretskii
2022-11-03 20:39                             ` Stefan Monnier
2022-11-04  6:34                               ` Eli Zaretskii
2022-11-04  6:37                               ` Eli Zaretskii
2022-11-03 19:57                           ` Alan Mackenzie
2022-11-03 20:35                             ` Stefan Monnier

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).