Subject: bug#67452: closed (Re: bug#67452: 30.0.50; [PATCH] Make split-root-window functions handle argument)

From: [email-masked] (GNU bug Tracking System)
Date: Wed, 29 Nov 2023 14:17:01 +0000

Your bug report

#67452: 30.0.50; [PATCH] Make split-root-window functions handle argument

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
67452: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=67452
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#67452: 30.0.50; [PATCH] Make split-root-window functions handle argument
From: Eli Zaretskii <[email-masked]>
To: martin rudalics <[email-masked]>
Cc: [email-masked], [email-masked], [email-masked]
Date: Wed, 29 Nov 2023 16:16:19 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

> Date: Mon, 27 Nov 2023 10:20:36 +0100
> Cc: [email-masked], [email-masked]
> From: martin rudalics <[email-masked]>
> 
>  > I guess we should do this for consistency with other split-window-*
>  > commands?  Martin, any reasons the split-root-window-* commands didn't
>  > follow the example of the corresponding split-window-* commands?
> 
> No idea.  Maybe Hugo Heagren can tell.
> 
>  > In any case, to make the split-root-window-* commands support C-u we
>  > just need to change the interactive spec from "P" to "p", there's no
>  > need for anything more complex.
> 
> I think so.  Here 'split-window-below' and 'split-window-right' use
> 
>    (let* ((size (and size (prefix-numeric-value size)))
> 
> maybe to "just work" when being passed an invalid SIZE argument but I
> don't remember the details.

Thanks, I've now installed the change on the emacs-29 branch, using
the "p" interactive spec, and I'm closing this bug.

Subject: 30.0.50; [PATCH] Make split-root-window functions handle argument
From: Cy <[email-masked]>
To: [email-masked]
Date: Sun, 26 Nov 2023 00:42:54 -0800
List-Id: <debbugs-submit.debbugs.gnu.org>

Hello,

I noticed the split-root-window-below and split-root-window-right 
commands fail when passing an argument using C-u:

split-root-window-right: Wrong type argument: number-or-marker-p, (4)

I have edited these functions to remedy this error, and attached a 
patch. I hope that the changes are satisfactory.

Best,

Cy
From e8f3751a085962c85e5f360469ce00229f4ea60f Mon Sep 17 00:00:00 2001
From: Cy <[email-masked]>
Date: Sun, 26 Nov 2023 00:34:25 -0800
Subject: [PATCH] Make split-root-window functions handle argument

* lisp/window.el (split-root-window-below, split-root-window-right): Handle prefix argument passed by C-u
---
 lisp/window.el | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lisp/window.el b/lisp/window.el
index 0c5ccf167dc..22ed8cc2bdf 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -5735,7 +5735,8 @@ amount of redisplay; this is convenient on slow terminals."
 The current window configuration is retained in the top window,
 the lower window takes up the whole width of the frame.  SIZE is
 handled as in `split-window-below'."
-  (interactive "P")
+  (interactive (when current-prefix-arg
+                 (prefix-numeric-value current-prefix-arg)))
   (split-window-below size (frame-root-window)))
 
 (defun split-window-right (&optional size window-to-split)
@@ -5775,7 +5776,8 @@ The current window configuration is retained within the left
 window, and a new window is created on the right, taking up the
 whole height of the frame.  SIZE is treated as by
 `split-window-right'."
-  (interactive "P")
+  (interactive (when current-prefix-arg
+                 (prefix-numeric-value current-prefix-arg)))
   (split-window-right size (frame-root-window)))
 
 ;;; Balancing windows.
-- 
2.43.0