emacs-devel
[Top][All Lists]
Advanced

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

Re: split-window as a command


From: Stephen Berman
Subject: Re: split-window as a command
Date: Sat, 13 Apr 2013 01:31:19 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

On Fri, 12 Apr 2013 19:44:31 +0000 (UTC) Rand <address@hidden> wrote:

> Stephen Berman <stephen.berman <at> gmx.net> writes:
>
>> The doc string of split-window says "Interactively, SIZE is the prefix
>> argument."  But in fact, invoking split-window with a prefix argument
>> has no effect, because its interactive spec is "i".  Maybe this is just
>> a doc bug, since, when split-window was still a C function, its doc
>> string said "Interactively, all arguments are nil."  But I don't see why
>> it is a command at all any more: invoked interactively, it has exactly
>> the same effect as invoking split-window-below without a prefix
>> argument, and since the latter does not ignore a prefix argument passed
>> to it, it does more than interactively called split-window.  So it
>> appears to be superfluous for split-window to be a command.  Or am I
>> overlooking something?
>
> It may be superfluous but it has always been a command and
> removing the interactive form would break existing keybindings
> and usage.

Maybe in the early days there was no split-window-vertically and
split-window was the only window-splitting command (I don't know).  But
at least since 18.59 (probably earlier) split-window has been redundant
as a command (and not documented in the Emacs manual), and has not had a
default key binding.  So any breakage would be in user settings or
third-party packages.  And the fix would simply be to add "-below" to
such occurrences of "split-window", which doesn't seem like much of a
hardship.  As for usage, since split-window never acted on a prefix
argument, replacing it with split-window-below interactively instead can
only be a win.

> I think that:
>
> * Fixing the doc-string would be better than removing the
> interactive form.

That would perpetuate its mistaken current status as a command.

> * Changing the interactive form to use the prefix argument would
> be better than fixing the doc-string.

That would mean adding code from split-window-below to process the
prefix argument, though split-window-below itself calls split-window.
That doesn't seem very clean.

It would be nice if there were a make-obsolete-command function, so
invoking split-window would warn: "This function is obsolete as a
command since 24.4; use `split-window-below' instead.

Steve Berman



reply via email to

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