unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: Dani Moncayo <dmoncayo@gmail.com>
Cc: 10971@debbugs.gnu.org
Subject: bug#10971: Problem with `split-window-keep-point' set to `nil'
Date: Fri, 09 Mar 2012 17:24:24 +0100	[thread overview]
Message-ID: <4F5A2EB8.6020808@gmx.at> (raw)
In-Reply-To: <4F5A1FDE.3020604@gmx.at>

 > 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





  reply	other threads:[~2012-03-09 16:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-08 21:12 bug#10971: Problem with `split-window-keep-point' set to `nil' Dani Moncayo
2012-03-08 22:44 ` Dani Moncayo
2012-03-09 15:21 ` martin rudalics
2012-03-09 16:24   ` martin rudalics [this message]
2012-03-10  8:48     ` Dani Moncayo
2012-03-11 14:06       ` martin rudalics

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F5A2EB8.6020808@gmx.at \
    --to=rudalics@gmx.at \
    --cc=10971@debbugs.gnu.org \
    --cc=dmoncayo@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).