[Top][All Lists]

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

bug#10971: Problem with `split-window-keep-point' set to `nil'

From: martin rudalics
Subject: bug#10971: Problem with `split-window-keep-point' set to `nil'
Date: Fri, 09 Mar 2012 17:24:24 +0100

> Does the attached patch give better results?

Just to explain what IMO happened and maybe should happen here: Emacs 23
had a wrapper

        (set-buffer (window-buffer))

which, probably to avoid a warning, Stefan changed on 2009-11-13 to

      (with-current-buffer (window-buffer)

Ever since that `split-window-keep-point' was broken and the fact that
nobody complained till now seems to indicate that we probably should
obsolete this option.

I don't understand the purpose of the (set-buffer (window-buffer)).
Maybe it was due to the fact that the current buffer might not be the
window buffer of the selected window when `split-window-vertically' is
called.  In that case, however, the specification of `old-point' and the

           (<= bottom (point))

some lines below _would_ consult the current buffer (since it's outside
the `save-excursion') and we'd have a problem anyway.

OTOH, not using `save-excursion' is the wrong thing since everything
done in the excursion is to _calculate_ positions and not to modify
them.  My patch is an attempt to fix most old and new issues with one
exception: The let's

        (old-point (point))

should probably become

        (old-point (window-point-1))

but I'm not very sure yet.  Any ideas?


reply via email to

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