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: Sun, 02 Dec 2018 00:30:06 +0200 Organization: LINKOV.NET Message-ID: <87efb0g9sh.fsf@mail.linkov.net> References: <87k1l6f9li@posteo.net> <87muq23vsk.fsf@gmx.net> <87h8g9fpl3@posteo.net> <5BF7AF19.4070809@gmx.at> <87bm6fyf78@posteo.net> <5BF84EE6.9020004@gmx.at> <87wop0and5.fsf@mail.linkov.net> <5BFBBDC5.10706@gmx.at> <87efb7fjm1.fsf@mail.linkov.net> <5BFCFB87.6060005@gmx.at> <87zhtudq0i.fsf@mail.linkov.net> <5BFE5334.3080502@gmx.at> <87sgzkn4vj.fsf@mail.linkov.net> <5BFFA3D4.6020809@gmx.at> <87in0fa4dh.fsf@mail.linkov.net> <5C00F30F.2040309@gmx.at> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1543705270 28947 195.159.176.226 (1 Dec 2018 23:01:10 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 1 Dec 2018 23:01:10 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) Cc: Stephen Berman , 33458@debbugs.gnu.org, v88m@posteo.net To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Dec 02 00:01:06 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 1gTEFz-0007NF-Sd for geb-bug-gnu-emacs@m.gmane.org; Sun, 02 Dec 2018 00:01:04 +0100 Original-Received: from localhost ([::1]:42798 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gTEI5-0002Px-Gq for geb-bug-gnu-emacs@m.gmane.org; Sat, 01 Dec 2018 18:03:13 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38452) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gTEHx-0002Gu-Nh for bug-gnu-emacs@gnu.org; Sat, 01 Dec 2018 18:03:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gTEHu-0007gw-ID for bug-gnu-emacs@gnu.org; Sat, 01 Dec 2018 18:03:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:53092) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gTEHu-0007f8-BW for bug-gnu-emacs@gnu.org; Sat, 01 Dec 2018 18:03:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gTEHu-00026f-0B for bug-gnu-emacs@gnu.org; Sat, 01 Dec 2018 18:03: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: Sat, 01 Dec 2018 23:03: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.15437053258014 (code B ref 33458); Sat, 01 Dec 2018 23:03:01 +0000 Original-Received: (at 33458) by debbugs.gnu.org; 1 Dec 2018 23:02:05 +0000 Original-Received: from localhost ([127.0.0.1]:57350 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gTEGy-00025C-SD for submit@debbugs.gnu.org; Sat, 01 Dec 2018 18:02:05 -0500 Original-Received: from common.maple.relay.mailchannels.net ([23.83.214.38]:3717) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gTEGw-00024j-Ar for 33458@debbugs.gnu.org; Sat, 01 Dec 2018 18:02:03 -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 EE4DC502D58; Sat, 1 Dec 2018 23:02:00 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a3.g.dreamhost.com (unknown [100.96.30.62]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id AB08A502334; Sat, 1 Dec 2018 23:02:00 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a3.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); Sat, 01 Dec 2018 23:02:00 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Cellar-Stop: 5baa313803e3916b_1543705320845_3061358087 X-MC-Loop-Signature: 1543705320845:2492927704 X-MC-Ingress-Time: 1543705320845 Original-Received: from pdx1-sub0-mail-a3.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a3.g.dreamhost.com (Postfix) with ESMTP id 6E2EC80150; Sat, 1 Dec 2018 15:02:00 -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=sMSIVHgvFDg+sHuSreG0C4Nky9M=; b= g2Jb1MjKvD5s2w9M2qYsU1P09a+kn3msb7SrwIqTgw4QU4jhYqjJG7TGEEw/7EI1 3XeCVPeJo0us2Oov7ecjTqLh5+vxGr/IZVSQHbJsrFvawz7M6QsFAl4W3Oq3HId4 n5520Piuyep0IpznoIEosCPkSJjoj/pOyT2gVi5PHj8= Original-Received: from mail.jurta.org (m91-129-107-242.cust.tele2.ee [91.129.107.242]) (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-a3.g.dreamhost.com (Postfix) with ESMTPSA id 3BE918004F; Sat, 1 Dec 2018 15:01:56 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a3 In-Reply-To: <5C00F30F.2040309@gmx.at> (martin rudalics's message of "Fri, 30 Nov 2018 09:21:35 +0100") X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtkedruddvjedgudejudcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucggtfgfnhhsuhgsshgtrhhisggvpdfftffgtefojffquffvnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffuohhfffgjkfgfgggtsehttdertddtredtnecuhfhrohhmpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqnecukfhppeeluddruddvledruddtjedrvdegvdenucfrrghrrghmpehmohguvgepshhmthhppdhhvghlohepmhgrihhlrdhjuhhrthgrrdhorhhgpdhinhgvthepledurdduvdelrddutdejrddvgedvpdhrvghtuhhrnhdqphgrthhhpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhhrtghpthhtoheprhhuuggrlhhitghssehgmhigrdgrthenucevlhhushhtvghrufhiiigvpedt 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:152973 Archived-At: >>> The buffer's point is OK. So we could introduce a variable, say >>> 'set-window-point-from-point', and set this to t when reverting a >>> buffer reveals that 'get-buffer-window' is nil. Redisplaying the >>> buffer would then always go to the buffer's point instead of some >>> position stored in the window's list of previous buffers. >>> >>> I'm not sure when to reset this mechanism though. The first time we >>> display the buffer again? Then switching to that buffer in another >>> window later would suffer from the initial problem. Keep it for every >>> other window until it has seen the buffer again? How would we do >>> that? >> >> Maybe until point is moved to another position either by the user or >> by any other code that doesn't set 'set-window-point-from-point' again. > > I'm not sure how to avoid defeating the idea behind 'window-point' - > showing the same buffer at different positions simultaneously. Code that sets 'window-point-from-point' could decide how 'window-point-from-point' should be used, e.g. if it sets a value 'all-windows' it affects all windows, if 'once' then reset after first use, etc. >>> Finally note that this does not fix the dired problem. There we want >>> the cursor go to the line showing the file where point previously was >>> in that window. >> >> Maybe for dired store meta-information such as dired-filename >> in window parameters. Then when a dired buffer is restored in a window, >> and dired-revert moved point-marker to the beginning of the dired buffer, >> move point to the file from the window parameter. > > Interesting idea. The parameter could also include the name of the > file at 'window-start' and try to restore that position as well. > Still we'd have to access each window's list of previous and next > buffers and store the parameter only if the buffer appears in any of > these lists (not to talk about window configurations stored somewhere > else). And we would have to remove the parameter whenever the buffer > gets killed. Then better idea: add a buffer-local variable with an alist mapping windows to dired-filenames or any other metadata: '((# . (dired-filename . "file1")) (# . (dired-filename . "file2")))