emacs-devel
[Top][All Lists]
Advanced

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

Re: Understanding atomic window groups


From: martin rudalics
Subject: Re: Understanding atomic window groups
Date: Sat, 25 May 2019 09:59:03 +0200

> `quit-window' just behaved unpredictably.

The idea behind `quit-window' is that it should _never_ bark at the
user but silently use the next-best solution when the predefined one
fails.  For example, typing C-h m usually displays a new *Help*
window.  Typing 'q' in that window conceptually deletes that window
because it did not exist before showing *Help*.  But if you do C-x 1
in the *Help* window first and then type 'q', that window can't be
deleted and thus will have to show some other buffer instead.

> This is really helpful, and I see that the docstring of `delete-window'
> actually mentions the case of atomic windows. I agree with Eli that
> maybe more documentation is in order. I feel like all the pieces are
> present (here and there), but there's no one place to get a full
> overview.

The "one place" should be section 28.18 of the Elisp manual.  If
something is missing there, please complain right away.  I'll now try
to amend the manual entries for 'split-window', 'delete-window' and
'delete-other-windows' appropriately as Eli suggested.  There I'll
then have to talk about side windows as well so this may take some
time.

And if you want a function like the below please tell me.

Thanks, martin


(defun window-dissolve-atom (&optional window)
  "Dissolve atomic window WINDOW is part of.
WINDOW must be a valid window and defaults to the selected one."
  (setq window (window-normalize-window window))
  (when (window-parameter window 'window-atom)
    (let ((root (window-atom-root window)))
      (walk-window-subtree
       (lambda (window)
         (when (window-parameter window 'window-atom)
           (set-window-parameter window 'window-atom nil)))
       root t))))



reply via email to

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