window stops updating after switching windows #17

Closed
spontarelliam opened this Issue Jul 10, 2013 · 5 comments

Projects

None yet

2 participants

Say you have 3 windows. Window 1 is an eshell, 2 is an text file, and 3 is an output file. If I perform a task that causes window 1 to continuously scroll, such as code compilation, and I switch focus to window 3 during that time (C-x o 3), window 1 will stop scrolling.

This is problematic because the only way to determine if compilation has finished is to switch back to window 1 and jump to the bottom of the buffer.

Owner
dimitri commented Sep 8, 2013

I think that's because the point in the scrolling window is left somewhere else that (point-max), do you want to try proposing a fix?

I'll give it a try.
-Adam

On Sun, Sep 8, 2013 at 8:00 AM, Dimitri Fontaine
notifications@github.comwrote:

I think that's because the point in the scrolling window is left somewhere
else that (point-max), do you want to try proposing a fix?


Reply to this email directly or view it on GitHubhttps://github.com/dimitri/switch-window/issues/17#issuecomment-24019726
.

Owner
dimitri commented Sep 8, 2013

Cool, thanks!

Attached is a fix I put together that seems to work reasonably well. I'm
new to Elisp, so if I've done anything seemingly dumb, please feel free to
change it.

The basic idea is to create a hash table containing the buffer names (keys)
and flags (values) indicating whether the point was on the last line as
soon as C-x o is pressed. Then once a new window is selected, the hash
table is passed into reset-point, and if the flag=1, the point is moved to
point-max.

You can test this by opening 3 windows, and running a simple bash loop
printing out a counter ever second. As long as the point is on the last
line when C-x o is pressed, it should be moved to the last line upon
choosing a window.

The problem I'm still having is if the timeout occurs or the user presses
C-g. I added a call to reset-point for those cases, but it doesn't seem to
work. Maybe you'll know why.

Thanks,
Adam

On Sun, Sep 8, 2013 at 4:22 PM, Dimitri Fontaine
notifications@github.comwrote:

Cool, thanks!


Reply to this email directly or view it on GitHubhttps://github.com/dimitri/switch-window/issues/17#issuecomment-24028603
.

Owner
dimitri commented Sep 13, 2013

I think you need to make a git branch and a proper pull request, because I'm not seeing your attachment from the github website...

@dimitri dimitri closed this in 453fbc7 Sep 14, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment