unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#60886: 29.0.60; split-root-window-below broken for split-window-keep-point
@ 2023-01-17 17:10 Juri Linkov
  2023-01-18 13:08 ` Eli Zaretskii
  0 siblings, 1 reply; 25+ messages in thread
From: Juri Linkov @ 2023-01-17 17:10 UTC (permalink / raw)
  To: 60886

[-- Attachment #1: Type: text/plain, Size: 510 bytes --]

Tags: patch

etc/NEWS:

  *** New commands 'split-root-window-below' and 'split-root-window-right'.
  These commands split the root window in two, and are bound to 'C-x w 2'
  and 'C-x w 3', respectively.

0. emacs -Q
1. (setq split-window-keep-point nil)
2. C-x w 2
3. C-x w 2

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  split-window-below(nil #<window 14>)
  split-root-window-below(nil)
  funcall-interactively(split-root-window-below nil)
  command-execute(split-root-window-below)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: split-window-keep-point.patch --]
[-- Type: text/x-diff, Size: 1678 bytes --]

diff --git a/lisp/window.el b/lisp/window.el
index 4099b707009..53d34a3bf6e 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -5670,7 +5675,8 @@ split-window-keep-point
 
 (defun split-window-below (&optional size window-to-split)
   "Split WINDOW-TO-SPLIT into two windows, one above the other.
-WINDOW-TO-SPLIT is above.  The newly split-off window is
+WINDOW-TO-SPLIT defaults to the selected window and after
+splitting remains above.  The newly split-off window is
 below and displays the same buffer.  Return the new window.
 
 If optional argument SIZE is omitted or nil, both windows get the
@@ -5691,7 +5697,9 @@ split-window-below
       ;; `split-window' would not signal an error here.
       (error "Size of new window too small"))
     (setq new-window (split-window window-to-split size))
-    (unless split-window-keep-point
+    (unless (or split-window-keep-point
+                ;; `window-buffer' is nil for `frame-root-window'
+                (null (window-buffer window-to-split)))
       (with-current-buffer (window-buffer window-to-split)
 	;; Use `save-excursion' around vertical movements below
 	;; (Bug#10971).  Note: When WINDOW-TO-SPLIT's buffer has a
@@ -5732,7 +5740,8 @@ split-root-window-below
 
 (defun split-window-right (&optional size window-to-split)
   "Split WINDOW-TO-SPLIT into two side-by-side windows.
-WINDOW-TO-SPLIT is on the left.  The newly split-off window is on
+WINDOW-TO-SPLIT defaults to the selected window and after
+splitting remains on the left.  The newly split-off window is on
 the right and displays the same buffer.  Return the new window.
 
 If optional argument SIZE is omitted or nil, both windows get the

^ permalink raw reply related	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2023-01-26 16:40 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-17 17:10 bug#60886: 29.0.60; split-root-window-below broken for split-window-keep-point Juri Linkov
2023-01-18 13:08 ` Eli Zaretskii
2023-01-18 17:13   ` martin rudalics
2023-01-18 17:32     ` martin rudalics
2023-01-18 18:25     ` Juri Linkov
2023-01-18 23:03       ` martin rudalics
2023-01-19  6:34         ` Eli Zaretskii
2023-01-19  8:49           ` martin rudalics
2023-01-19 10:05             ` Eli Zaretskii
2023-01-19 10:43               ` martin rudalics
2023-01-19 11:32                 ` Eli Zaretskii
2023-01-20  9:17                   ` martin rudalics
2023-01-21  8:16                     ` Eli Zaretskii
2023-01-21 10:08                       ` martin rudalics
2023-01-21 11:39                         ` Eli Zaretskii
2023-01-21 15:30                           ` martin rudalics
2023-01-21 15:55                             ` Eli Zaretskii
2023-01-22  9:53                               ` martin rudalics
2023-01-26  8:01                                 ` Eli Zaretskii
2023-01-26 15:44                                   ` martin rudalics
2023-01-26 16:40                                     ` Eli Zaretskii
2023-01-21 17:57                     ` Juri Linkov
2023-01-22  9:53                       ` martin rudalics
2023-01-22 17:09                         ` Juri Linkov
2023-01-24 17:55                         ` Juri Linkov

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).