From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.devel Subject: delete-other-frames Date: Tue, 23 Aug 2016 10:19:59 +0200 Message-ID: <57BC072F.9070704@gmx.at> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1471940457 31014 195.159.176.226 (23 Aug 2016 08:20:57 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 23 Aug 2016 08:20:57 +0000 (UTC) To: emacs-devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Aug 23 10:20:53 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 1bc6x3-0007jl-CC for ged-emacs-devel@m.gmane.org; Tue, 23 Aug 2016 10:20:53 +0200 Original-Received: from localhost ([::1]:45209 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bc6x0-0007LM-H1 for ged-emacs-devel@m.gmane.org; Tue, 23 Aug 2016 04:20:50 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40274) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bc6wN-0007K0-Q1 for emacs-devel@gnu.org; Tue, 23 Aug 2016 04:20:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bc6wK-0000HV-JR for emacs-devel@gnu.org; Tue, 23 Aug 2016 04:20:11 -0400 Original-Received: from mout.gmx.net ([212.227.17.20]:52398) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bc6wK-0000Gz-9e for emacs-devel@gnu.org; Tue, 23 Aug 2016 04:20:08 -0400 Original-Received: from [192.168.1.100] ([212.95.7.42]) by mail.gmx.com (mrgmx101) with ESMTPSA (Nemesis) id 0LhjeH-1aqB3W0W0n-00msU8 for ; Tue, 23 Aug 2016 10:20:07 +0200 X-Provags-ID: V03:K0:QFrv7kfMJLZ4zEplxGx+qn4NIpUV709y5S1Bjz9yt0PcwGiGDkk kovEoAWq74PwAD74ji6G1Au1N/bNM5tbFDYWEF60Ed4lCH9GruZwjob5lXDTNWkis5mHRRW 35Izn5L2bZiGkxlFPzoHSyRVFeDLiwpMHBOz2zTzCJtH6APR1TaQmZHPRWOw8vbVkTHxiGU gcn8ncqPy4i4CafhRduhQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:BELzia8R3JA=:svieGoq7eZV1NWdD/AFEEm APyfILvffBP+fPHYZEl0/DfRSiqhMDp88iE7g2PpEqQCa9p/i3r//XfTOxcURSULPXjnM4Mji Js6pOWw04X/snv2fZm+zN7m0hFUpm7FT3IFhWOWxQvVa6vT4C6SaZLydNGY31QoxXjsWqSq+V V8sKNh+kBi8HL0UoqzGPluE/CAGwAvTL9E3AOzn/vy3ORUUdwajbIv5KYW9OOVnHehiAjeEJu J343x4pG/y1RyK6j3brjV9rigRB31CDpce3kOGvvVClK9e9dgR0DrnNsfe9YUPMO0FOi5Msn4 6Bfyl3YlWbsbpmFSourPddY6mbsQzJOBeerMcA2FYECT1wtmVh4s6yyfQfm1VfoHH5+rfwv1O Z08wJLGvG5gomKc9dh+mtzmiFzC71PRIO4OJ7w1lPf/w5AjLdZQOrK4V7aw2w9QG+o+y24TKe YIuFvLnev7K2lVD8w5I/Q2bcdx9Q3fo1sc3duBG2Y30THCw7k4Iq7rB64U11ksE/Pn3FckFI0 BB2Q2zvyIfDK1Cvzmo+dYDJpJqTxhSwOUTtETQDQ43WdETSzlBb/fs1tYzmWuDkvEiscKXjU2 moD2YQDdO/jBWwR95F4H8n3s0Zb/FKA/CLnhCghZpP+zLlz8I6m3BIfqSuucFbYYHyks7tB4p GzHlSLg3XwTQo8KsPh0jPqe35Jc+C67eEdNCjRYf6+QHpHi1ZkbW4LV83qUYvYSULoPeYi+dv cdA7AfgZfw5ZQsnCaIAJeNxxkXA50k2y8VlLQVcnILjjjLUJe6vY+Tt/cRGNplh+AHnp83ra X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.17.20 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:206761 Archived-At: I'd like to fix two issues with =E2=80=98delete-other-frames=E2=80=99 but= am yet undecided on how to do that. (1) With emacs -Q step by step evaluate the following forms: (setq less (make-frame '((minibuffer . nil)))) (setq normal (make-frame)) (delete-other-frames normal) This gets me: Debugger entered--Lisp error: (error "Attempt to delete a surrogate minib= uffer frame") delete-frame(#) delete-other-frames(#) eval((delete-other-frames normal) nil) elisp--eval-last-sexp(nil) eval-last-sexp(nil) funcall-interactively(eval-last-sexp nil) call-interactively(eval-last-sexp nil nil) command-execute(eval-last-sexp) 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=98d= elete-other-frames=E2=80=99 tries to delete that frame before =E2=80=98less=E2=80=99, resulting in th= e error cited above. Should we document the current behavior in the doc-string or should we 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. Thanks for suggestions, martin