GNU bug report logs - #10971
Problem with `split-window-keep-point' set to `nil'

Previous Next

Package: emacs;

Reported by: Dani Moncayo <dmoncayo <at> gmail.com>

Date: Thu, 8 Mar 2012 21:15:02 UTC

Severity: normal

Done: martin rudalics <rudalics <at> gmx.at>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: martin rudalics <rudalics <at> gmx.at>
To: Dani Moncayo <dmoncayo <at> gmail.com>
Cc: 10971 <at> debbugs.gnu.org
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

      (save-excursion
	(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
conjunct

	   (<= 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?

martin




This bug report was last modified 13 years and 135 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.