all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#32874: Unwanted scrolling in edebug `f' command when follow-mode is active
@ 2018-09-29 14:09 Alan Mackenzie
  2018-09-29 14:35 ` Eli Zaretskii
  0 siblings, 1 reply; 12+ messages in thread
From: Alan Mackenzie @ 2018-09-29 14:09 UTC (permalink / raw)
  To: 32874

Hello, Emacs.

Start an edebug session in some Emacs Lisp source code, where the
follow-mode is enabled for the .el buffer, and that buffer is displayed
in at least two windows.

Scroll the .el buffer until some sexp is split across two windows.  When
the execution point reaches this sexp, press f `edebug-forward-sexp'.

What one sees is the left hand window wrongly scrolls upwards to display
the end of the sexp, where point is left.  This is wrong.  Point ought to
move the end of the sexp in the right hand window, without any scrolling.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

The immediate cause of this is at edebug--recursive-edit L+86, where
there is a call to (sit-for 0).  If this call is commented out, and the
bug scenario repeated, there is no spurious scrolling.  That call is
there for a reason, however, so this isn't a fix for the bug.

This (sit-for 0) calls redisplay, and this redisplay call bypasses the
follow-mode manipulation, which is in a post-command-hook.

The use of post-command-hook for follow mode is clearly suboptimal.
Follow mode is essentially a part of redisplay, so it ought to get called
from a redisplay hook.  The trouble is, `redisplay-hook' doesn't exist.

The best available hooks which might serve seem to be
pre-redisplay-function or pre-redisplay-functions.  Unfortunately, these
are called too late, after redisplay has already determined which windows
to operate on.

The obvious solution would be to implement `redisplay-hook'.  Since this
is so obvious, yet wasn't done several decades ago, there are probably
reasons for not doing it.

Has anybody got any ideas for fixing this?

-- 
Alan Mackenzie (Nuremberg, Germany).





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

end of thread, other threads:[~2018-10-03 10:54 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-29 14:09 bug#32874: Unwanted scrolling in edebug `f' command when follow-mode is active Alan Mackenzie
2018-09-29 14:35 ` Eli Zaretskii
2018-09-29 15:37   ` Alan Mackenzie
2018-09-29 16:09     ` Eli Zaretskii
2018-09-29 20:41       ` Alan Mackenzie
2018-09-30  7:35         ` Eli Zaretskii
2018-09-30 15:36           ` Alan Mackenzie
2018-09-30 17:17             ` Eli Zaretskii
2018-10-01 12:59               ` Alan Mackenzie
2018-10-01 13:52                 ` Eli Zaretskii
2018-09-30 14:45   ` Alan Mackenzie
2018-10-03 10:54     ` Alan Mackenzie

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.