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: Thu, 13 Dec 2018 01:29:30 +0200 Organization: LINKOV.NET Message-ID: <8736r2fhnp.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> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1544657428 22215 195.159.176.226 (12 Dec 2018 23:30:28 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 12 Dec 2018 23:30:28 +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 Thu Dec 13 00:30:23 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 1gXDxP-0005eP-Dy for geb-bug-gnu-emacs@m.gmane.org; Thu, 13 Dec 2018 00:30:23 +0100 Original-Received: from localhost ([::1]:49439 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXDzW-0006YJ-5B for geb-bug-gnu-emacs@m.gmane.org; Wed, 12 Dec 2018 18:32:34 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52089) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXDzD-0006YE-Rz for bug-gnu-emacs@gnu.org; Wed, 12 Dec 2018 18:32:18 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gXDz0-0000Fs-Rk for bug-gnu-emacs@gnu.org; Wed, 12 Dec 2018 18:32:10 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:41372) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gXDz0-0000FF-C5 for bug-gnu-emacs@gnu.org; Wed, 12 Dec 2018 18:32:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gXDyz-0000WD-VK for bug-gnu-emacs@gnu.org; Wed, 12 Dec 2018 18:32: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: Wed, 12 Dec 2018 23:32: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.15446574671861 (code B ref 33458); Wed, 12 Dec 2018 23:32:01 +0000 Original-Received: (at 33458) by debbugs.gnu.org; 12 Dec 2018 23:31:07 +0000 Original-Received: from localhost ([127.0.0.1]:45630 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gXDy7-0000Tw-28 for submit@debbugs.gnu.org; Wed, 12 Dec 2018 18:31:07 -0500 Original-Received: from golden.birch.relay.mailchannels.net ([23.83.209.73]:36043) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gXDy4-0000Tk-H7 for 33458@debbugs.gnu.org; Wed, 12 Dec 2018 18:31:05 -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 631265C4F6A; Wed, 12 Dec 2018 23:31:03 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a76.g.dreamhost.com (unknown [100.96.11.179]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 14A855C4F69; Wed, 12 Dec 2018 23:31:03 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a76.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); Wed, 12 Dec 2018 23:31:03 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Occur-Coil: 503bcd935047d3df_1544657463180_1152496775 X-MC-Loop-Signature: 1544657463179:749667430 X-MC-Ingress-Time: 1544657463179 Original-Received: from pdx1-sub0-mail-a76.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a76.g.dreamhost.com (Postfix) with ESMTP id ADFF78094C; Wed, 12 Dec 2018 15:31:02 -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=K+6EBBxPIgM2M6GSil4Vnhu13Zs=; b= 11Ve/iKPnujqCxJGd4k75U7dFixXnXlczh0tPIbtOdvR+qH+7nP+apS7dXoUX5NL RBK/HRDZdiHBoZGMpLyV/P72faHuokDKu4fjmY5utrPmQnHH8lo7OCZ8XosUiqBD UBtsRNgIfbXUaHBxXNjB/EDuslzPbPP2iP1yd41O8rk= 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-a76.g.dreamhost.com (Postfix) with ESMTPSA id DCBB28094B; Wed, 12 Dec 2018 15:31:00 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a76 In-Reply-To: <5C10C786.3030504@gmx.at> (martin rudalics's message of "Wed, 12 Dec 2018 09:32:06 +0100") X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtkedrudehuddgudduucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufhofhffjgfkfgggtgesthdtredttdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucfkphepledurdduvdelrdeliedrudejjeenucfrrghrrghmpehmohguvgepshhmthhppdhhvghlohepmhgrihhlrdhjuhhrthgrrdhorhhgpdhinhgvthepledurdduvdelrdeliedrudejjedprhgvthhurhhnqdhprghthheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqedpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnrhgtphhtthhopehruhgurghlihgtshesghhmgidrrghtnecuvehluhhsthgvrhfuihiivgeptd 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:153392 Archived-At: >> I think we should run a hook when a buffer appears in the window, >> either by e.g. 'C-x ' (previous-buffer) or by 'window-state-put', >> then a buffer-local hook in Dired will move its point to the right file. > > The problem with 'dired' is that we have to make any amendments at the > time the buffer is reverted. It's already too late when switching to > the buffer afterwards. > > The only thing we can do at the time of switching to a buffer is to go > to the buffer's point (which should work when the buffer was displayed > only in one window before). For example, saveplace.el uses dired-initial-position-hook to set Dired buffer's point initially to a remembered dired-filename. A switch-to-buffer hook could do the same to move point to a dired-filename previously displayed in that window, by getting the filename from e.g. a buffer-local mapping from windows to filenames.