unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stephen Berman <stephen.berman@gmx.net>
To: martin rudalics <rudalics@gmx.at>
Cc: emacs-devel@gnu.org
Subject: Re: split-window as a command
Date: Fri, 12 Apr 2013 13:37:24 +0200	[thread overview]
Message-ID: <87obdkf097.fsf@rosalinde.fritz.box> (raw)
In-Reply-To: 5167D3E8.8000903@gmx.at

On Fri, 12 Apr 2013 11:29:12 +0200 martin rudalics <rudalics@gmx.at> wrote:

>> 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?
>
> Everything you say here is correct.  Can you please fix it?
>
> Thanks, martin

Here's a patch; I can't commit it to the Savannah repository, since I
don't have write access to it.



2013-04-12  Stephen Berman  <stephen.berman@gmx.net>

	* NEWS: Mention fixing `split-window' to be non-interactive.


=== modified file 'etc/NEWS'
*** etc/NEWS	2013-04-09 17:54:50 +0000
--- etc/NEWS	2013-04-12 10:34:13 +0000
***************
*** 76,81 ****
--- 76,86 ----
  \f
  * Editing Changes in Emacs 24.4
  
+ ** `split-window' is no longer a command, just a non-interactive function.
+ As a command it was a special case of `split-window-below', and as such
+ superfluous.  After being reimplemented in Lisp, its interactive form
+ was mistakenly retained.
+ 
  ** New commands `toggle-frame-fullscreen' and `toggle-frame-maximized',
  bound to <f11> and M-<f10>, respectively.
  


2013-04-12  Stephen Berman  <stephen.berman@gmx.net>

	* windows.texi (Splitting Windows): Change category of
	split-window from a command to a function.


=== modified file 'doc/lispref/windows.texi'
*** doc/lispref/windows.texi	2013-01-06 20:34:54 +0000
--- doc/lispref/windows.texi	2013-04-12 10:14:33 +0000
***************
*** 717,723 ****
  This section describes functions for creating a new window by
  @dfn{splitting} an existing one.
  
! @deffn Command split-window &optional window size side
  This function creates a new live window next to the window
  @var{window}.  If @var{window} is omitted or @code{nil}, it defaults
  to the selected window.  That window is ``split'', and reduced in
--- 717,723 ----
  This section describes functions for creating a new window by
  @dfn{splitting} an existing one.
  
! @defun split-window &optional window size side
  This function creates a new live window next to the window
  @var{window}.  If @var{window} is omitted or @code{nil}, it defaults
  to the selected window.  That window is ``split'', and reduced in
***************
*** 767,773 ****
  lieu of the usual action of @code{split-window}.  Otherwise, this
  function obeys the @code{window-atom} or @code{window-side} window
  parameter, if any.  @xref{Window Parameters}.
! @end deffn
  
    As an example, here is a sequence of @code{split-window} calls that
  yields the window configuration discussed in @ref{Windows and Frames}.
--- 767,773 ----
  lieu of the usual action of @code{split-window}.  Otherwise, this
  function obeys the @code{window-atom} or @code{window-side} window
  parameter, if any.  @xref{Window Parameters}.
! @end defun
  
    As an example, here is a sequence of @code{split-window} calls that
  yields the window configuration discussed in @ref{Windows and Frames}.



2013-04-12  Stephen Berman  <stephen.berman@gmx.net>

	* window.el (split-window): Remove interactive form, since as a
	command this function is a special case of split-window-below.


=== modified file 'lisp/window.el'
*** lisp/window.el	2013-01-02 16:13:04 +0000
--- lisp/window.el	2013-04-12 09:43:13 +0000
***************
*** 3686,3692 ****
  absolute value can be less than `window-min-height' or
  `window-min-width'; so this command can make a new window as
  small as one line or two columns.  SIZE defaults to half of
! WINDOW's size.  Interactively, SIZE is the prefix argument.
  
  Optional third argument SIDE nil (or `below') specifies that the
  new window shall be located below WINDOW.  SIDE `above' means the
--- 3686,3692 ----
  absolute value can be less than `window-min-height' or
  `window-min-width'; so this command can make a new window as
  small as one line or two columns.  SIZE defaults to half of
! WINDOW's size.
  
  Optional third argument SIDE nil (or `below') specifies that the
  new window shall be located below WINDOW.  SIDE `above' means the
***************
*** 3718,3724 ****
  window, these properties as well as the buffer displayed in the
  new window are inherited from the window selected on WINDOW's
  frame.  The selected window is not changed by this function."
-   (interactive "i")
    (setq window (window-normalize-window window))
    (let* ((side (cond
  		((not side) 'below)
--- 3718,3723 ----



  reply	other threads:[~2013-04-12 11:37 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-12  7:58 split-window as a command Stephen Berman
2013-04-12  9:29 ` martin rudalics
2013-04-12 11:37   ` Stephen Berman [this message]
2013-04-12 14:13     ` martin rudalics
2013-04-12 19:44       ` Rand
2013-04-12 23:05         ` Xue Fuqiao
2013-04-12 23:31         ` Stephen Berman
2013-04-13  0:52           ` Xue Fuqiao
2013-04-13  1:54             ` Rand User
2013-04-13  2:46               ` Xue Fuqiao
2013-04-13  5:45                 ` Rand User
2013-04-13  6:29                   ` Xue Fuqiao
2013-04-13  1:44           ` Rand User
2013-04-13  8:03             ` martin rudalics
2013-04-13  2:10         ` Stefan Monnier
2013-04-13 14:45           ` Stephen Berman

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=87obdkf097.fsf@rosalinde.fritz.box \
    --to=stephen.berman@gmx.net \
    --cc=emacs-devel@gnu.org \
    --cc=rudalics@gmx.at \
    /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).