unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 60886@debbugs.gnu.org, juri@linkov.net
Subject: bug#60886: 29.0.60; split-root-window-below broken for split-window-keep-point
Date: Fri, 20 Jan 2023 10:17:39 +0100	[thread overview]
Message-ID: <3a9c38d8-ebf5-67d4-63de-a2d2acb127e6@gmx.at> (raw)
In-Reply-To: <83a62epxo6.fsf@gnu.org>

 >> M-: (pop-to-buffer "*Messages*")
 >> C-x w 3
 >
 > This shows *Messages* in the new window, so I think something like
 >
 >    ...the same buffer as the window which was selected when the
 >    function was invoked"
 >
 > should be good.

This would miss the case where WINDOW-TO-SPLIT is live and not selected.
And also the case where the root window of a non-selected frame should
be split.

 >> The Elisp manual said about them
 >>
 >>      For interactive use, Emacs provides two commands which always split
 >>      the selected window.
 >>
 >> which apparently is no longer true.
 >
 > That doesn't say "only for interactive use", and it would make no
 > sense to say that for such a basic function, IMO.

I meant the "always split the selected window" part.  Just think of how
much easier it would have been, had these new functions been coded as

(defun split-root-window-below (&optional size)
   "Split root window of selected frame in two.
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'.  The buffer of the new window is
taken from the selected window."
   (interactive "P")
   (when (and size (< size 0) (< (- size) window-min-height))
     ;; `split-window' would not signal an error here.
     (error "Size of new window too small"))
   (split-window (frame-root-window) size 'below))

(defun split-root-window-right (&optional size)
   "Split root window of selected frame into two side-by-side windows.
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'.  The buffer of the new window is taken from
the selected window."
   (interactive "P")
   (when (and size (< size 0) (< (- size) window-min-width))
     ;; `split-window' would not signal an error here.
     (error "Size of new window too small"))
   (split-window (frame-root-window) size 'right))

martin





  reply	other threads:[~2023-01-20  9:17 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

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=3a9c38d8-ebf5-67d4-63de-a2d2acb127e6@gmx.at \
    --to=rudalics@gmx.at \
    --cc=60886@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=juri@linkov.net \
    /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).