From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#60886: 29.0.60; split-root-window-below broken for split-window-keep-point Date: Tue, 17 Jan 2023 19:10:48 +0200 Organization: LINKOV.NET Message-ID: <86k01la7gn.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3359"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) To: 60886@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jan 17 18:36:01 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pHpsO-0000k5-RS for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 17 Jan 2023 18:36:00 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pHprV-0005kr-3U; Tue, 17 Jan 2023 12:35:05 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pHprT-0005gO-1G for bug-gnu-emacs@gnu.org; Tue, 17 Jan 2023 12:35:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pHprS-0008Gb-Oi for bug-gnu-emacs@gnu.org; Tue, 17 Jan 2023 12:35:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pHprS-0002Yl-Bb for bug-gnu-emacs@gnu.org; Tue, 17 Jan 2023 12:35:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 17 Jan 2023 17:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 60886 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.16739768659756 (code B ref -1); Tue, 17 Jan 2023 17:35:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 17 Jan 2023 17:34:25 +0000 Original-Received: from localhost ([127.0.0.1]:38147 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pHpqq-0002XC-Ir for submit@debbugs.gnu.org; Tue, 17 Jan 2023 12:34:24 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:40446) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pHpqo-0002X3-J5 for submit@debbugs.gnu.org; Tue, 17 Jan 2023 12:34:23 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pHpqo-0005YV-7G for bug-gnu-emacs@gnu.org; Tue, 17 Jan 2023 12:34:22 -0500 Original-Received: from relay8-d.mail.gandi.net ([2001:4b98:dc4:8::228]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pHpqm-0008BF-45 for bug-gnu-emacs@gnu.org; Tue, 17 Jan 2023 12:34:21 -0500 Original-Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 34EF91BF206 for ; Tue, 17 Jan 2023 17:34:14 +0000 (UTC) Received-SPF: pass client-ip=2001:4b98:dc4:8::228; envelope-from=juri@linkov.net; helo=relay8-d.mail.gandi.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:253571 Archived-At: --=-=-= Content-Type: text/plain 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 #) split-root-window-below(nil) funcall-interactively(split-root-window-below nil) command-execute(split-root-window-below) --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=split-window-keep-point.patch 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 --=-=-=--