all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Michael Heerdegen <michael_heerdegen@web.de>,
	"help-gnu-emacs@gnu.org" <help-gnu-emacs@gnu.org>
Subject: RE: [External] : view-remove-frame-by-deleting ignored?
Date: Sun, 9 Oct 2022 02:16:31 +0000	[thread overview]
Message-ID: <SJ0PR10MB548812A82FF15875373C2320F3219@SJ0PR10MB5488.namprd10.prod.outlook.com> (raw)
In-Reply-To: <87sfjx6frd.fsf@web.de>

> > Try customizing option `frame-auto-hide-function'
> > to `delete-frame' instead of the default value
> > of `iconify-frame'.
> > ...
> > It's `quit-restore-window' that uses the option,
> > and so ends up deleting the frame.  And that's
> > called by `quit-window', which is called by
> > `View-quit'.
> 
> Where?
> 
> I don't seem to be able to find any place where this
> variable is referenced in the Emacs sources.  Toggling
> the option also doesn't seem to have any effect.
> Or am I too tired (could be)?

Hadn't try to find exactly where it's done (but
see below).  I see this, e.g., in Emacs 28.1 (and
earlier):

emacs -Q

M-x debug-on-entry quit-restore-window
M-x view-file-other-frame foo.el

Step through and you'll see something like this:

Debugger entered--entering a function:
* iconify-frame(#<frame *Backtrace* 000001e4b300f470>)
* window--delete(#<window 70 on foo.el> nil nil)
* #<subr quit-restore-window>(nil bury)
* apply(#<subr quit-restore-window> (nil bury))
* quit-restore-window(nil bury)
  quit-window()
  view-mode-exit(nil kill-buffer-if-not-modified)
  View-quit()
  funcall-interactively(View-quit)
  command-execute(View-quit)

Get rid of the frame and buffer for foo.el, to start
over.

Use `M-x customize-option frame-auto-hide-function'
to set the option to `delete-frame' (instead of the
default, `iconify-frame').

M-x view-file-other-frame foo.el

Step through and you'll see something like this:

Debugger entered--entering a function:
* delete-frame(#<frame *Backtrace* 000001e4b3017840>)
* window--delete(#<window 7 on foo.el> nil nil)
* #<subr quit-restore-window>(nil bury)
* apply(#<subr quit-restore-window> (nil bury))
* quit-restore-window(nil bury)
  quit-window()
  view-mode-exit(nil kill-buffer-if-not-modified)
  View-quit()
  funcall-interactively(View-quit)
  command-execute(View-quit)

In more detail, it comes from this return value
from `window-deletable':

Debugger entered--returning value: frame
  window-deletable-p(#<window 124 on foo.el>)
* #<subr window--delete>(#<window 124 on foo.el> nil nil)
* apply(#<subr window--delete> (#<window 124 on foo.el> nil nil))
* window--delete(#<window 124 on foo.el> nil nil)
  quit-restore-window(nil bury)
  quit-window()
  view-mode-exit(nil kill-buffer-if-not-modified)
  View-quit()
  funcall-interactively(View-quit)
  command-execute(View-quit)

And that's from this code in `window-deletable-p':

(cond
 ((frame-root-window-p window)
  ;; WINDOW's frame can be deleted only if there are other frames
  ;; on the same terminal, and it does not contain the active
  ;; minibuffer.
  (unless (or (eq frame (next-frame frame 0))
          ;; We can delete our frame only if no other frame
          ;; currently uses our minibuffer window.
          (catch 'other
            (dolist (other (frame-list))
              (when (and (not (eq other frame))
                         (eq (window-frame
                               (minibuffer-window other))
                         frame))
                (throw 'other t))))
          (let ((minibuf (active-minibuffer-window)))
            (and minibuf (eq frame (window-frame minibuf))
                 (not (eq (default-toplevel-value
                            'minibuffer-follows-selected-frame)
                          t)))))
    'frame))



  reply	other threads:[~2022-10-09  2:16 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-08 20:32 view-remove-frame-by-deleting ignored? Thorsten Bonow
2022-10-08 21:15 ` [External] : " Drew Adams
2022-10-08 21:29   ` Drew Adams
2022-10-08 23:45     ` Michael Heerdegen
2022-10-09  2:16       ` Drew Adams [this message]
2022-10-09 19:14         ` Thorsten Bonow
2022-10-09 19:24           ` Drew Adams
2022-10-09 19:31             ` Emanuel Berg
2022-10-11 15:17               ` Drew Adams
2022-10-12  0:57                 ` Po Lu
2022-10-12  1:39                   ` Drew Adams
2022-10-12  5:36                   ` Eli Zaretskii
2022-10-12 15:33                     ` Drew Adams
2022-10-12 16:04                       ` Eli Zaretskii
2022-10-12 17:13                         ` Drew Adams
2022-10-12 19:16                           ` Michael Heerdegen
2022-10-12 19:59                   ` Emanuel Berg
2022-10-09 19:48             ` Thorsten Bonow
2022-10-09 20:42               ` Drew Adams
2022-10-09 21:08           ` Michael Heerdegen
2022-10-10 15:15             ` Thorsten Bonow
2022-10-10 23:46               ` Michael Heerdegen

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=SJ0PR10MB548812A82FF15875373C2320F3219@SJ0PR10MB5488.namprd10.prod.outlook.com \
    --to=drew.adams@oracle.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=michael_heerdegen@web.de \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.