From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thien-Thi Nguyen Newsgroups: gmane.emacs.devel Subject: split-window-keep-point Date: Fri, 03 Dec 2010 11:39:35 +0100 Message-ID: <87aaknrvh4.fsf@ambire.localdomain> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1291373089 25189 80.91.229.12 (3 Dec 2010 10:44:49 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 3 Dec 2010 10:44:49 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Dec 03 11:44:44 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1POT87-0002hB-T0 for ged-emacs-devel@m.gmane.org; Fri, 03 Dec 2010 11:44:44 +0100 Original-Received: from localhost ([127.0.0.1]:42050 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1POT87-0003yF-7q for ged-emacs-devel@m.gmane.org; Fri, 03 Dec 2010 05:44:43 -0500 Original-Received: from [140.186.70.92] (port=42008 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1POT7q-0003wx-Tv for emacs-devel@gnu.org; Fri, 03 Dec 2010 05:44:28 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1POT7p-0002w3-NM for emacs-devel@gnu.org; Fri, 03 Dec 2010 05:44:26 -0500 Original-Received: from smtp208.alice.it ([82.57.200.104]:43338) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1POT7p-0002ue-CX for emacs-devel@gnu.org; Fri, 03 Dec 2010 05:44:25 -0500 Original-Received: from ambire.localdomain (95.245.66.249) by smtp208.alice.it (8.5.124.08) id 4C1A27160BB7F6FA for emacs-devel@gnu.org; Fri, 3 Dec 2010 11:44:21 +0100 Original-Received: from ttn by ambire.localdomain with local (Exim 4.69) (envelope-from ) id 1POT39-0001CK-69 for emacs-devel@gnu.org; Fri, 03 Dec 2010 11:39:35 +0100 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:133341 Archived-At: For the longest time (due to slow ttys just like the docstring mentions), i set =E2=80=98split-window-keep-point=E2=80=99 to nil and was h= appy. =E2=80=98C-x 2=E2=80=99 and other internal usage of =E2=80=98split-window-v= ertically=E2=80=99 behaved more or less as expected. Recently (1-2 years), i began to be annoyed at the behavior for non-=E2=80=98C-x 2=E2=80=99 usage of =E2=80=98split-window-vertically=E2=80= =99. That is, Gnus or =E2=80=98M-x describe-variable=E2=80=99 or whatever would split the window,= leaving point in the upper window in a strange place (as warned by the docstring). I could only guess that more functions are calling =E2=80=98split-window-vertically=E2=80=99 than before. So, i wrote this in ~/.emacs and ask others for feedback on it: (defun split-window-vertically-interactive (&optional size) "Call `split-window-vertically' with SIZE, keeping point motionless. This is achieved by let-binding `split-window-keep-point' to nil." (interactive "P") (let ((split-window-keep-point nil)) (split-window-vertically size))) (setq split-window-keep-point t) (global-set-key "\C-x2" 'split-window-vertically-interactive) I suppose the inverse-polarity solution is to provide some kind of =E2=80=98split-window-vertically-keep-point=E2=80=99 for non-=E2=80=98C-x 2= =E2=80=99 calls, or otherwise ensure that =E2=80=98split-window-keep-point=E2=80=99 is let-boun= d t for such callers, everywhere.