From: Thien-Thi Nguyen <ttn@gnuvola.org>
To: emacs-devel@gnu.org
Subject: split-window-keep-point
Date: Fri, 03 Dec 2010 11:39:35 +0100 [thread overview]
Message-ID: <87aaknrvh4.fsf@ambire.localdomain> (raw)
For the longest time (due to slow ttys just like the docstring
mentions), i set ‘split-window-keep-point’ to nil and was happy.
‘C-x 2’ and other internal usage of ‘split-window-vertically’
behaved more or less as expected.
Recently (1-2 years), i began to be annoyed at the behavior for
non-‘C-x 2’ usage of ‘split-window-vertically’. That is, Gnus or
‘M-x describe-variable’ 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
‘split-window-vertically’ 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
‘split-window-vertically-keep-point’ for non-‘C-x 2’ calls, or
otherwise ensure that ‘split-window-keep-point’ is let-bound t for
such callers, everywhere.
reply other threads:[~2010-12-03 10:39 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=87aaknrvh4.fsf@ambire.localdomain \
--to=ttn@gnuvola.org \
--cc=emacs-devel@gnu.org \
/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).