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#33458: 27.0.50; dired loses position when reverted from outside place Date: Tue, 18 Dec 2018 02:25:57 +0200 Organization: LINKOV.NET Message-ID: <87va3riqvm.fsf@mail.linkov.net> References: <87k1l6f9li@posteo.net> <5C063BD6.5020707@gmx.at> <874lbt73s3@posteo.net> <5C079794.6080500@gmx.at> <5C0B91AD.4050909@gmx.at> <87y38yjkqk.fsf@mail.linkov.net> <5C0E1C9D.3040106@gmx.at> <87pnu9j5lh.fsf@mail.linkov.net> <5C0F7695.1070408@gmx.at> <875zvzlgqm.fsf@mail.linkov.net> <5C10C786.3030504@gmx.at> <8736r2fhnp.fsf@mail.linkov.net> <5C12200E.8060609@gmx.at> <5C137900.7010704@gmx.at> <87r2ehro5k.fsf@mail.linkov.net> <5C175917.4010702@gmx.at> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1545095647 30903 195.159.176.226 (18 Dec 2018 01:14:07 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 18 Dec 2018 01:14:07 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) Cc: 33458@debbugs.gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Dec 18 02:14:02 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 1gZ3xR-0007ti-Rf for geb-bug-gnu-emacs@m.gmane.org; Tue, 18 Dec 2018 02:14:02 +0100 Original-Received: from localhost ([::1]:50883 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gZ3zY-0006q5-DE for geb-bug-gnu-emacs@m.gmane.org; Mon, 17 Dec 2018 20:16:12 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38234) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gZ3zR-0006pw-Gt for bug-gnu-emacs@gnu.org; Mon, 17 Dec 2018 20:16:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gZ3zO-0002k0-Au for bug-gnu-emacs@gnu.org; Mon, 17 Dec 2018 20:16:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:48146) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gZ3zO-0002jq-0f for bug-gnu-emacs@gnu.org; Mon, 17 Dec 2018 20:16:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gZ3zN-0004Df-Oa for bug-gnu-emacs@gnu.org; Mon, 17 Dec 2018 20:16:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 18 Dec 2018 01:16:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33458 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 33458-submit@debbugs.gnu.org id=B33458.154509573216172 (code B ref 33458); Tue, 18 Dec 2018 01:16:01 +0000 Original-Received: (at 33458) by debbugs.gnu.org; 18 Dec 2018 01:15:32 +0000 Original-Received: from localhost ([127.0.0.1]:52404 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gZ3yt-0004Cm-MV for submit@debbugs.gnu.org; Mon, 17 Dec 2018 20:15:31 -0500 Original-Received: from common.maple.relay.mailchannels.net ([23.83.214.38]:28524) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gZ3ys-0004Cd-0E for 33458@debbugs.gnu.org; Mon, 17 Dec 2018 20:15:30 -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 A06DD683831; Tue, 18 Dec 2018 01:15:23 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a37.g.dreamhost.com (unknown [100.96.20.98]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 58B5B68373D; Tue, 18 Dec 2018 01:15:10 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a37.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); Tue, 18 Dec 2018 01:15:23 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Blushing-Versed: 76c8a29c3b74023d_1545095710506_3046659233 X-MC-Loop-Signature: 1545095710505:4181947650 X-MC-Ingress-Time: 1545095710505 Original-Received: from pdx1-sub0-mail-a37.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a37.g.dreamhost.com (Postfix) with ESMTP id 3A2FB81B98; Mon, 17 Dec 2018 17:15:08 -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=Juvatxs4o1HXyjQYcgBpzlU4qWk=; b= QBhyILBKNuzJzQi5dmwLA74x8N/UstsFxAQwP2ws53Z6JRy1ByyWNbEiv63vsaOY 58VJoZqTFjbgkKzzkBGGwXifPCOtr28591byOoZ+V0rsopX12XWr8YNNDXhXlVTt TDX6O8RJtAht7eVRpdLOWb8/JK5Sr55YtGI5UttxhAs= Original-Received: from mail.jurta.org (m91-129-96-177.cust.tele2.ee [91.129.96.177]) (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-a37.g.dreamhost.com (Postfix) with ESMTPSA id A1D0281B8E; Mon, 17 Dec 2018 17:15:06 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a37 In-Reply-To: <5C175917.4010702@gmx.at> (martin rudalics's message of "Mon, 17 Dec 2018 09:06:47 +0100") X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtkedrudeigedgfeefucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufhofhffjgfkfgggtgesthdtredttdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucfkphepledurdduvdelrdeliedrudejjeenucfrrghrrghmpehmohguvgepshhmthhppdhhvghlohepmhgrihhlrdhjuhhrthgrrdhorhhgpdhinhgvthepledurdduvdelrdeliedrudejjedprhgvthhurhhnqdhprghthheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqedpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnrhgtphhtthhopehruhgurghlihgtshesghhmgidrrghtnecuvehluhhsthgvrhfuihiivgeptd 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:153543 Archived-At: >>> Imagine a scenario where a user (1) displays a buffer in new window, >>> (2) switches in that window to another buffer and (3) deletes that >>> window for good. When and how would the buffer-local reference >>> created in (2) be removed? >> >> Another question: When should the buffer-local reference be added? >> >> Every time when point is moved to a new file? Too frequent calls especially >> in cases of e.g. pressing and holding the spacebar to move thru the file list. >> >> Or when current-window-configuration is saved to a variable/register >> or window-state-get is called? I don't know what hook is possible >> to use at that moment besides advices. > > I'm not sure whether my scenario above was entirely clear. The > "buffer-local reference" I was talking about would be a buffer-local > list whose cars are all the windows (including dead ones) that showed > the buffer before. When reverting a buffer, we would traverse that > list, and for every window in that list (including dead windows) look > up the buffer reference in that window's previous buffers, calculate > the new window point position from the old position and store back the > new position as marker in situ there. Is it really possible to get a window from the window-configuration that is currently not displayed and change its window-point, e.g. to get window reference from the buffer-local list, select with with-selected-window and call set-window-point? I never tried such thing. > So the answer to your question "When should the buffer-local reference > be added?" is the earlier alluded to "in (2) when we unshow that > buffer in a window". And the problem we have to solve is when to > remove such a reference because the referenced window is really dead > and no more referenced by any saved window configuration. It's clear from you explanation what harm is from zombie windows. But it's interesting to know is it possible to catch the moment when we unshow that buffer in a window?