emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: master 6a2ee981c3: Add new functions for splitting the root window


From: Augusto Stoffel
Subject: Re: master 6a2ee981c3: Add new functions for splitting the root window
Date: Fri, 16 Sep 2022 17:03:11 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

On Fri, 16 Sep 2022 at 14:30, Gregory Heytings wrote:

>>
>> Since you mention various custom repeatable commands, I think we're
>> missing a less drastic version of delete-other-windows which deletes
>> all siblings in the window configuration tree of the selected
>> window.
>>
>> In other words, the non-root-window version on C-x 1.
>>
>
> Is this what you have in mind?
>
> (defun delete-other-windows-soft (&optional arg)
>   (interactive "P")
>   (if arg
>       (delete-other-windows)
>     (let* ((w (window-child (window-parent))) (wl (list w)))
>       (while (setq w (window-next-sibling w)) (push w wl))
>       (dolist (w wl)
>       (when (and (not (eq w (selected-window)))
>                  (not (window-parameter w 'no-delete-other-windows)))
>         (ignore-errors (delete-window w)))))))

Yes.  I can't comment on the completeness with respect to various window
parameters like 'no-delete-other-windows, but this works for me.

(I guess I'd call it `delete-window-siblings` or something in that
direction.)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]