From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#33871: 27.0.50; Revert Dired window saved in window configuration Date: Thu, 27 Dec 2018 02:01:57 +0200 Organization: LINKOV.NET Message-ID: <87y38bhm6i.fsf@mail.linkov.net> References: <87bm59mglk.fsf@mail.linkov.net> <5C234D27.40309@gmx.at> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1545869655 14165 195.159.176.226 (27 Dec 2018 00:14:15 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 27 Dec 2018 00:14:15 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) Cc: 33871@debbugs.gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Dec 27 01:14:11 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1gcJJR-0003Vh-Fm for geb-bug-gnu-emacs@m.gmane.org; Thu, 27 Dec 2018 01:14:09 +0100 Original-Received: from localhost ([127.0.0.1]:48816 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gcJLX-0001Pm-T0 for geb-bug-gnu-emacs@m.gmane.org; Wed, 26 Dec 2018 19:16:19 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:47335) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gcJLK-0001PO-Ua for bug-gnu-emacs@gnu.org; Wed, 26 Dec 2018 19:16:10 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gcJLG-0005ZW-VC for bug-gnu-emacs@gnu.org; Wed, 26 Dec 2018 19:16:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:35008) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gcJLG-0005ZB-PS for bug-gnu-emacs@gnu.org; Wed, 26 Dec 2018 19:16:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gcJLG-00079O-IU for bug-gnu-emacs@gnu.org; Wed, 26 Dec 2018 19:16:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 27 Dec 2018 00:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33871 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 33871-submit@debbugs.gnu.org id=B33871.154586972227416 (code B ref 33871); Thu, 27 Dec 2018 00:16:02 +0000 Original-Received: (at 33871) by debbugs.gnu.org; 27 Dec 2018 00:15:22 +0000 Original-Received: from localhost ([127.0.0.1]:38059 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gcJKY-000785-Gi for submit@debbugs.gnu.org; Wed, 26 Dec 2018 19:15:22 -0500 Original-Received: from ostrich.birch.relay.mailchannels.net ([23.83.209.138]:25393) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gcJKT-00077s-94 for 33871@debbugs.gnu.org; Wed, 26 Dec 2018 19:15:17 -0500 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 24B742839B4; Thu, 27 Dec 2018 00:15:12 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a49.g.dreamhost.com (unknown [100.96.26.166]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id CB61A2837AE; Thu, 27 Dec 2018 00:15:11 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a49.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.16.2); Thu, 27 Dec 2018 00:15:12 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Continue-Stupid: 37b8359c6c994c4b_1545869711959_1994422357 X-MC-Loop-Signature: 1545869711959:518475683 X-MC-Ingress-Time: 1545869711959 Original-Received: from pdx1-sub0-mail-a49.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a49.g.dreamhost.com (Postfix) with ESMTP id 6B5F67FC82; Wed, 26 Dec 2018 16:15:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=HZJr8qwSdxHUJl7gk6ak+ZvkkS4=; b= sY3yGDX8QAhmTzG/08Ut2b7erh1IBpfx9LxxXc6/A9mxF5kKnj9YYAS+FtjwzgWg kToAjSkiLus4zO3+gXE9fgjNg1ooczlUK7aRiF1sOcOee+igQxAt8Mvrc76X4goH wEScm/Zx8Fm3rL70O4I/IecjTIhEw6zxukekOXXfoho= Original-Received: from mail.jurta.org (m91-129-108-193.cust.tele2.ee [91.129.108.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a49.g.dreamhost.com (Postfix) with ESMTPSA id D5AA67FC7B; Wed, 26 Dec 2018 16:15:09 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a49 In-Reply-To: <5C234D27.40309@gmx.at> (martin rudalics's message of "Wed, 26 Dec 2018 10:43:03 +0100") X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtledrtddugddulecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucggtfgfnhhsuhgsshgtrhhisggvpdfftffgtefojffquffvnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffuohhfffgjkfgfgggtsehttdertddtredtnecuhfhrohhmpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqnecukfhppeeluddruddvledruddtkedrudelfeenucfrrghrrghmpehmohguvgepshhmthhppdhhvghlohepmhgrihhlrdhjuhhrthgrrdhorhhgpdhinhgvthepledurdduvdelrddutdekrdduleefpdhrvghtuhhrnhdqphgrthhhpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhhrtghpthhtoheprhhuuggrlhhitghssehgmhigrdgrthenucevlhhushhtvghrufhiiigvpedt X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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" Xref: news.gmane.org gmane.emacs.bugs:153883 Archived-At: >> Try to eval in emacs -Q in *scratch*: >> >> (progn (dired "/tmp") (dired-next-line 1) >> (split-window) (other-window 1) >> (dired "/tmp") (dired-next-line 2) >> (let ((w-c (current-window-configuration)) >> (p-m (point-marker))) >> (view-emacs-todo) (delete-other-windows) >> (with-current-buffer (get-buffer "tmp") >> (revert-buffer)) >> (set-window-configuration w-c) >> (goto-char p-m))) >> >> Result: >> - point in the selected Dired window moves to point-min >> - point in the non-selected Dired window moves to point-max > > You're obfuscating the underlying behavior with the 'dired-next-line' > and 'goto-char' calls but the final points are different without that. > > Without your explicit moves, `dired' moves to the first file name in > the lower directory here. So 'dired-move-to-filename' was called when > reverting the buffer and the 'set-window-configuration' "restores" the > lower window's point from the buffer's point because that window is > the selected one. I see that without `goto-char' it moves to the first file name in the selected window. I don't understand how 'set-window-configuration' restores the selected window's point. > To confirm, try with the upper window selected instead. Here is when the upper window is selected, but still it moves to (point-max) in non-selected window: (progn (dired "/tmp") (dired-other-window "/tmp") (other-window 1) (let ((w-c (current-window-configuration)) (p-m (point-marker))) (view-emacs-todo) (delete-other-windows) (with-current-buffer (get-buffer "tmp") (revert-buffer)) (set-window-configuration w-c)))