|Subject:||bug#16129: 24.3.50; Emacs slow with follow-mode when buffer ends before last window|
|Date:||Thu, 2 Jan 2014 14:55:59 +0100|
Hi!I agree that we would need to find out why the patch makes Emacs slow. (In fact, I only supplied the information about the internals of follow-mode to help you track down the problems with the slowdown.)However, I don't agree with Eli -- it is possible to place window-start at point-max! However, there is code in the display engine that explicitly recenters such windows, after a while, or when something happens. For example:emacs -QC-x 3C-x oM-: (set-window-start (selected-window) (point-max)) RETC-x oM-<blablabla (type some text)As you type text in the left window at the beginning of the scratch buffer, the right window is recentered. Follow-mode needs its windows to stay put (even the empty ones), as this is essential in creating the illusion that a number of windows make up a very tall virtual window.When I originally wrote follow-mode (some 18 years ago), I suggested to the Emacs maintainers to add a feature to make the recentering of empty windows conditional, so that follow-mode could control this. However, at the time they were not interested so I continued with the current system, which has worked flawlessly since then.If you are interested in making the change in the display engine, follow-mode should of course be rewritten to use it. Otherwise, I suggest that we keep it as it is today -- solutions using overlays etc. don't appeal to me at all.-- AndersOn Fri, Dec 13, 2013 at 5:38 PM, Stefan Monnier <address@hidden> wrote:
> I am the original author of follow-mode, so I can share one interesting> always tries ensure that windows are not empty so it repositions it... So,
> implementation detail. When the viewed buffer ends before the last window,
> follow-mode tries to display this window without any content (by setting
> the window start to point-max). Unfortunately, the Emacs display engine
> follow-mode hammers in its view of the world every chance it gets,
> currrently in post-command hook and window-scroll-functions.
Hmm.. so we have 2 things to do:
1- figure out why my patch slowed things down so much.
2- change follow-mode to use a different approach. Maybe a good way is
to do the following: put window-point at point-max, and add an overlay
on window-start...point-max that makes the text invisible (with
a `window' property, so it's only invisible in that window).
Of course, maybe that won't work either. But hooking everywhere
doesn't sound like a good idea.
|[Prev in Thread]||Current Thread||[Next in Thread]|