From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juanma Barranquero Newsgroups: gmane.emacs.bugs Subject: bug#16793: window-state-put needs a live window Date: Tue, 18 Feb 2014 17:20:04 +0100 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1392740469 6624 80.91.229.3 (18 Feb 2014 16:21:09 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 18 Feb 2014 16:21:09 +0000 (UTC) To: 16793@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Feb 18 17:21:15 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WFnPw-00039P-89 for geb-bug-gnu-emacs@m.gmane.org; Tue, 18 Feb 2014 17:21:08 +0100 Original-Received: from localhost ([::1]:50549 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WFnPv-0003ZA-RP for geb-bug-gnu-emacs@m.gmane.org; Tue, 18 Feb 2014 11:21:07 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37189) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WFnPs-0003Yu-Ot for bug-gnu-emacs@gnu.org; Tue, 18 Feb 2014 11:21:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WFnPr-0000ZH-Jt for bug-gnu-emacs@gnu.org; Tue, 18 Feb 2014 11:21:04 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:57425) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WFnPr-0000ZC-Gq for bug-gnu-emacs@gnu.org; Tue, 18 Feb 2014 11:21:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1WFnPq-0004HX-Pq; Tue, 18 Feb 2014 11:21:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juanma Barranquero Original-Sender: "Debbugs-submit" Resent-CC: rudalics@gmx.at, bug-gnu-emacs@gnu.org Resent-Date: Tue, 18 Feb 2014 16:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 16793 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: Bug-Gnu-Emacs X-Debbugs-Original-Xcc: rudalics@gmx.at Original-Received: via spool by submit@debbugs.gnu.org id=B.139274045716437 (code B ref -1); Tue, 18 Feb 2014 16:21:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 18 Feb 2014 16:20:57 +0000 Original-Received: from localhost ([127.0.0.1]:58606 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WFnPk-0004H3-SM for submit@debbugs.gnu.org; Tue, 18 Feb 2014 11:20:57 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:35374) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WFnPj-0004Gl-1K for submit@debbugs.gnu.org; Tue, 18 Feb 2014 11:20:55 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WFnPd-0000WF-2D for submit@debbugs.gnu.org; Tue, 18 Feb 2014 11:20:49 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:41081) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WFnPd-0000WB-07 for submit@debbugs.gnu.org; Tue, 18 Feb 2014 11:20:49 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37091) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WFnPb-0003Fx-Se for bug-gnu-emacs@gnu.org; Tue, 18 Feb 2014 11:20:48 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WFnPa-0000Vb-Mz for bug-gnu-emacs@gnu.org; Tue, 18 Feb 2014 11:20:47 -0500 Original-Received: from mail-yk0-x230.google.com ([2607:f8b0:4002:c07::230]:57818) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WFnPa-0000VQ-C6 for bug-gnu-emacs@gnu.org; Tue, 18 Feb 2014 11:20:46 -0500 Original-Received: by mail-yk0-f176.google.com with SMTP id 19so33999792ykq.7 for ; Tue, 18 Feb 2014 08:20:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=IfWVx2oc7yiGtWr01cv20rMnJD8DtaYh17X+wU/YswA=; b=UUpIkjrSZI+TC4MIVRG3Hm7Himv1s1kdW/DnxGGLWsZ54lWznLIvs5pAMRe2T5jCUe Eoq1itoGUOVwemvH1Eg5r7gJPckIRIKhoYhqWsX7ZE8ZQzbuR3LgMFEbYj4oL1Dhipij mIseHLUW5U17yk9EREQU9VW7lrRYO/n0NoSox+Q8x7ZBRJ0yC3CbI4k+oelF+kQlLAcN Y5kkeCQmFpwxhOMK8TaljGT57aZOIsLoCfzXhuDVl0uWvXRm4l0dSO+1kSwgTRGDSyb7 ep07kzd9GBfbEqpAnAL2wqwUTsaM/2VyVJqT8Uugym37IULPATgs4D9oKxkMwfvM4q+/ WHsA== X-Received: by 10.236.101.18 with SMTP id a18mr12573959yhg.65.1392740445680; Tue, 18 Feb 2014 08:20:45 -0800 (PST) Original-Received: by 10.170.197.1 with HTTP; Tue, 18 Feb 2014 08:20:04 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:85823 Archived-At: Package: emacs Version: 24.3.50 X-Debbugs-Cc: rudalics@gmx.at There's a problem when restoring a frameset where "put"ing a window state into the root window of a frame fails for some windows if the frame is split (which is common enough). It's easy to see the problem with emacs -Q C-x 2 C-x r f a C-x r j a => "Error (frameset): # is not a live window" or emacs -Q ;; eval this in *scratch* (let (ws frw) (split-window) (setq frw (frame-root-window)) (setq ws (window-state-get frw)) (window-state-put ws frw)) => "Lisp error: (error "# is not a live window")" Strictly speaking It's not a bug, because the docstring of `window-state-put' says "Optional argument WINDOW must specify a live window". But as the examples above show, it is less than useful to be able to get the state of a window and not being able to put it again into the same window. In framesets, the problem arises because it's often the case that the preferred frame to restore a window-state is the very same one the window-state was saved from, particularly for saving/restoring in the same session (as it happens with frameset-to-register / jump-to-register). That minimizes flicker and simplifies dealing with non-reused frames. Martin suggests that frameset--restore should check that the root window of the matching frame found is alive, and if not, discard that frame and create a new one. That's doable, but it seems less than optimal, from both a coding and UI perspective.