From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Thorsten Bonow Newsgroups: gmane.emacs.help Subject: Re: [External] : view-remove-frame-by-deleting ignored? Date: Sun, 09 Oct 2022 21:14:50 +0200 Message-ID: <87zge4vmfp.fsf@post.rwth-aachen.de> References: <874jwevyx8.fsf@post.rwth-aachen.de> <87sfjx6frd.fsf@web.de> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="449"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) To: help-gnu-emacs@gnu.org Cancel-Lock: sha1:YSsM5Ba1xlxaAEXLEc5V9svDBJ4= Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sun Oct 09 21:19:59 2022 Return-path: Envelope-to: geh-help-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 1ohbqB-000ATu-8U for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 09 Oct 2022 21:19:59 +0200 Original-Received: from localhost ([::1]:35916 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ohbq9-0005ib-Cy for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 09 Oct 2022 15:19:57 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40418) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ohblR-0005iH-51 for help-gnu-emacs@gnu.org; Sun, 09 Oct 2022 15:15:05 -0400 Original-Received: from ciao.gmane.io ([116.202.254.214]:41742) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ohblO-0000TB-1R for help-gnu-emacs@gnu.org; Sun, 09 Oct 2022 15:15:04 -0400 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1ohblK-000408-Cv for help-gnu-emacs@gnu.org; Sun, 09 Oct 2022 21:14:58 +0200 X-Injected-Via-Gmane: http://gmane.org/ Received-SPF: pass client-ip=116.202.254.214; envelope-from=geh-help-gnu-emacs@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -15 X-Spam_score: -1.6 X-Spam_bar: - X-Spam_report: (-1.6 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.25, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:139776 Archived-At: >>>>> Drew Adams writes: >> > 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(# 000001e4b300f470>) * window--delete(# nil nil) * # quit-restore-window>(nil bury) * apply(# (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(# 000001e4b3017840>) * window--delete(# nil nil) * # quit-restore-window>(nil bury) * apply(# (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(# foo.el>) * #(# nil nil) * > apply(# (# nil nil)) * > window--delete(# 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)) Thx, modifying `frame-auto-hide-function' works for me. I think `view-remove-frame-by-deleting' was forgotten to remove in commit 357f93d245344725f9d7c5b96eadc400107923b6 when `view-mode-exit' was simplified among other things. Toto -- Sent from my GNU Emacs running on GNU/Linux