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: Sun, 30 Dec 2018 01:21:05 +0200 Organization: LINKOV.NET Message-ID: <87muonyl4b.fsf@mail.linkov.net> References: <87bm59mglk.fsf@mail.linkov.net> <5C234D27.40309@gmx.at> <87y38bhm6i.fsf@mail.linkov.net> <5C249D48.1020608@gmx.at> <87efa21wof.fsf@mail.linkov.net> <5C25E016.3050808@gmx.at> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1546126576 24059 195.159.176.226 (29 Dec 2018 23:36:16 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 29 Dec 2018 23:36:16 +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 Sun Dec 30 00:36:12 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 1gdO9M-0006Ad-1I for geb-bug-gnu-emacs@m.gmane.org; Sun, 30 Dec 2018 00:36:12 +0100 Original-Received: from localhost ([127.0.0.1]:42090 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gdOBS-0007fc-Nk for geb-bug-gnu-emacs@m.gmane.org; Sat, 29 Dec 2018 18:38:22 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:42515) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gdOBC-0007WH-HM for bug-gnu-emacs@gnu.org; Sat, 29 Dec 2018 18:38:12 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gdNyZ-0006uP-9Z for bug-gnu-emacs@gnu.org; Sat, 29 Dec 2018 18:25:09 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:43743) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gdNyZ-0006uL-68 for bug-gnu-emacs@gnu.org; Sat, 29 Dec 2018 18:25:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gdNyZ-0008La-0W for bug-gnu-emacs@gnu.org; Sat, 29 Dec 2018 18:25:03 -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, 29 Dec 2018 23:25: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.154612587532039 (code B ref 33871); Sat, 29 Dec 2018 23:25:02 +0000 Original-Received: (at 33871) by debbugs.gnu.org; 29 Dec 2018 23:24:35 +0000 Original-Received: from localhost ([127.0.0.1]:41710 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gdNy7-0008Kh-BC for submit@debbugs.gnu.org; Sat, 29 Dec 2018 18:24:35 -0500 Original-Received: from goldenrod.birch.relay.mailchannels.net ([23.83.209.74]:4760) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gdNy2-0008KM-SN for 33871@debbugs.gnu.org; Sat, 29 Dec 2018 18:24:31 -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 9A259123BE0; Sat, 29 Dec 2018 23:24:29 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a25.g.dreamhost.com (unknown [100.96.11.179]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 3EED2123B8A; Sat, 29 Dec 2018 23:24:29 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a25.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, 29 Dec 2018 23:24:29 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Tank-Thoughtful: 0a25a1c53239b44c_1546125869451_3205600617 X-MC-Loop-Signature: 1546125869451:1130413363 X-MC-Ingress-Time: 1546125869451 Original-Received: from pdx1-sub0-mail-a25.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a25.g.dreamhost.com (Postfix) with ESMTP id D09BF819C6; Sat, 29 Dec 2018 15:24:28 -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=s8PHV+tcHqYxZRrWFRkcp4ghzIo=; b= QQloEPCpPpSa5TzfMulLIG27G/2axQjxrcDgzp/5LiE1yhbRXWNPJr7bzQ8c7ggC Z8kDKqYuTKqXDe7KNmuJwtHnM/U6HGAVBto+y+YNIU6bmxE6M/6qLbKMPL1avsfx 8n++Ld3z6rML9X/Lud0VC8L2sXy5zTVaEs1mucFQmJk= 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-a25.g.dreamhost.com (Postfix) with ESMTPSA id B742E819C7; Sat, 29 Dec 2018 15:24:27 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a25 In-Reply-To: <5C25E016.3050808@gmx.at> (martin rudalics's message of "Fri, 28 Dec 2018 09:34:30 +0100") X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtledrtdelgddutdcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucggtfgfnhhsuhgsshgtrhhisggvpdfftffgtefojffquffvnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffuohhfffgjkfgfgggtsehttdertddtredtnecuhfhrohhmpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqnecukfhppeeluddruddvledruddtkedrudelfeenucfrrghrrghmpehmohguvgepshhmthhppdhhvghlohepmhgrihhlrdhjuhhrthgrrdhorhhgpdhinhgvthepledurdduvdelrddutdekrdduleefpdhrvghtuhhrnhdqphgrthhhpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhhrtghpthhtoheprhhuuggrlhhitghssehgmhigrdgrthenucevlhhushhtvghrufhiiigvpedv 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:154003 Archived-At: >> So the revert function doesn't use markers? Maybe then >> set-window-configuration should not use markers too? > > 'dired-revert' is special. There's nothing we can conclude from it. image-revert is another special, as indicated by bug#33631 >>>> 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))) >>> >>> In every non-selected window. Try with as many windows as you want. >>> Only the selected window is handled separately. >> >> A bug? Do you know why it currently moves point to the end of the buffer in non-selected windows. I don't understand what causes this behavior. > As I suggested earlier we can use the position of the buffer's point > in every window regardless of whether it currently shows the buffer or > we later switch to the buffer in it. But this is not what we usually > want when using multiple windows: We usually want them to show > different portions of the same buffer. Yes, better to keep every window's own point. Since usually I save the selected window's point along with the window configuration, in e.g. ((window-configuration-1 selected-window-point) (window-configuration-2 selected-window-point) ...) this could be extended to save a mapping of all windows points, e.g. ((window-configuration-1 ((window-a point-a) (window-b point-b) ...)) (window-configuration-2 ...) ...) But it's not a general solution. A general solution would be to save such metadata in the window configuration itself.