From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Richard Copley Newsgroups: gmane.emacs.devel Subject: Re: delete-other-frames Date: Tue, 23 Aug 2016 18:56:52 +0100 Message-ID: References: <57BC072F.9070704@gmx.at> <83k2f7fugv.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1471975158 2818 195.159.176.226 (23 Aug 2016 17:59:18 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 23 Aug 2016 17:59:18 +0000 (UTC) Cc: martin rudalics , Emacs Development To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Aug 23 19:59:14 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bcFyg-00007C-A7 for ged-emacs-devel@m.gmane.org; Tue, 23 Aug 2016 19:59:10 +0200 Original-Received: from localhost ([::1]:47678 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bcFyd-0005aT-FO for ged-emacs-devel@m.gmane.org; Tue, 23 Aug 2016 13:59:07 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60090) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bcFy2-0005ZV-Ub for emacs-devel@gnu.org; Tue, 23 Aug 2016 13:58:32 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bcFy0-00060T-PN for emacs-devel@gnu.org; Tue, 23 Aug 2016 13:58:29 -0400 Original-Received: from mail-ua0-f179.google.com ([209.85.217.179]:34349) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bcFxw-0005xY-0f; Tue, 23 Aug 2016 13:58:24 -0400 Original-Received: by mail-ua0-f179.google.com with SMTP id k90so258172168uak.1; Tue, 23 Aug 2016 10:58:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=sZufWtzcFDoxc5ztQCOjZgWEB+KuDCVOqIBSkiUsEbA=; b=LsRtLKK/S5tXLatr+/3I/YLxtMBH+1Pk9/o0PyW+1ooaddKo29/3kBlx+Box7oJ9o7 TnwbRBbCI/pHWliNvihrJk4xtwy6syjVYEDsro7GX2vMSRn5df5pIamF2EMWlHa2m+xh 7XsI8H0E+44F+Oq5xaMVH9a7jc3C9uhNHSm5nqP41+OMomX3l4qp+XLQ/d5rJiETrVgX JiT7PCvUPZ5kAPjdQJcGEoS8moLR8a3sGR5k5D+9NF0y2rDfMaHL9tLGktkJjZakxXlA kI5cuNbhQ07wuBlPo5kbDt3eeBJ2b9QUxyevdgYVGnyG38I/M54GMDZP9GrQPYw37ltC cn2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=sZufWtzcFDoxc5ztQCOjZgWEB+KuDCVOqIBSkiUsEbA=; b=L+/CO2P6KWQ8TMVXh12VVvRWVpkPfFdufVjwncMeawduYcXSkQwSL/+lj6CEvrCPa9 DvRGkYDaEX0p4UOR21wSCBkXhikjerBsPix8Jyo2As+VgyyhMJlvyoeR+R4Xj8l1Xr8l 2729pzti6feklS4TS06RyWtKycwFOtkvggCNSYDJqAWBUuKCMRXJuj2wgGWPsuzlrWjf c9nBpTRV6ogeSXARDqk7RsM5Q/lX7MP/gcjPit1WJPBvNjJYht9M0RhyQ8Hf5PM+UBYH q5r3LyHDw00q/YrenkgecCjjAs7MaSwrpmadc74YiB1rpXx38v6UaAmhwogTA8GWdv5x ojUA== X-Gm-Message-State: AEkoousfQtjgrSG1hjeS8hOZ5EnjTta9WJmppZpA+FNnUNXEiGpNWXFwvrREKkQ2vXGTnt6e32GG+GbZv1tvrQ== X-Received: by 10.31.214.66 with SMTP id n63mr14668858vkg.95.1471975042907; Tue, 23 Aug 2016 10:57:22 -0700 (PDT) Original-Received: by 10.176.1.111 with HTTP; Tue, 23 Aug 2016 10:56:52 -0700 (PDT) In-Reply-To: <83k2f7fugv.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.217.179 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:206769 Archived-At: On 23 August 2016 at 15:09, Eli Zaretskii wrote: >> Date: Tue, 23 Aug 2016 10:19:59 +0200 >> From: martin rudalics >> >> The problematic code in =E2=80=98delete-other-frames=E2=80=99 is this: >> >> ;; Delete mon-minibuffer-only frames first, because `delete-frame' >> ;; signals an error when trying to delete a mini-frame that's >> ;; still in use by another frame. >> (dolist (frame frames) >> (unless (eq (frame-parameter frame 'minibuffer) 'only) >> (delete-frame frame))) >> >> Here we try to delete all frames whose `minibuffer' parameter is not >> `only'. However, the minibuffer window of a minibuffer-less frame might >> be on a _normal_ frame as in our example: The minibuffer window of the >> frame =E2=80=98less=E2=80=99 is owned by the initial frame and =E2=80=98= delete-other-frames=E2=80=99 >> tries to delete that frame before =E2=80=98less=E2=80=99, resulting in t= he error cited >> above. >> >> Should we document the current behavior in the doc-string or should we >> amend the code? > > IMO, amend the code. > >> (2) The doc-string says "Delete all frames on the current terminal, >> except FRAME." IIUC this doesn't make much sense when FRAME is not on >> the current terminal. In that case, =E2=80=98delete-other-frames=E2=80= =99 will delete >> all frames on the current terminal and leave the frames on FRAME's >> terminal alone. In order to delete all other frames on FRAME's terminal >> one has to make that terminal current first. If that is the desired >> behavior, we should mention it in the doc-string. Otherwise, we should >> delete all other frames on FRAME's terminal. > > The latter, I think. Possibly related: from emacs -Q, C-x b * RET ;; create and switch to buffer "*" M-x ediff-buffers RET RET RET ;; ediff buffers "*" and "*scratch*" ;; Now attempt to close the main Emacs frame using the window manager This gives: Debugger entered--Lisp error: (error "Attempt to delete a surrogate minibuffer frame") delete-frame(# t) handle-delete-frame((delete-frame (#))) funcall-interactively(handle-delete-frame (delete-frame (#))) call-interactively(handle-delete-frame nil [(delete-frame (#))]) command-execute(handle-delete-frame nil [(delete-frame (#))] t) read-event(nil t 2) sit-for(2) execute-extended-command(nil "toggle-debug-on-error" "t-d-o-e") funcall-interactively(execute-extended-command nil "toggle-debug-on-error" "t-d-o-e") call-interactively(execute-extended-command nil nil) command-execute(execute-extended-command) I've never been sure whether this deserves a bug report, or what should be the expected behaviour. FWIW when this happens my intention is usually to kill Emacs. In any case the error message isn't very user friendly.