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 23:29:30 +0200 Organization: LINKOV.NET Message-ID: <87k1jqaekl.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> <87muonyl4b.fsf@mail.linkov.net> <5C28957A.9050609@gmx.at> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1546205407 8791 195.159.176.226 (30 Dec 2018 21:30:07 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 30 Dec 2018 21:30:07 +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 22:30:03 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 1gdieo-0002A7-Kn for geb-bug-gnu-emacs@m.gmane.org; Sun, 30 Dec 2018 22:30:03 +0100 Original-Received: from localhost ([127.0.0.1]:46728 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gdigv-0002eZ-9H for geb-bug-gnu-emacs@m.gmane.org; Sun, 30 Dec 2018 16:32:13 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:37658) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gdigp-0002eR-CK for bug-gnu-emacs@gnu.org; Sun, 30 Dec 2018 16:32:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gdigk-0007vb-E8 for bug-gnu-emacs@gnu.org; Sun, 30 Dec 2018 16:32:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:54432) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gdigk-0007v9-7N for bug-gnu-emacs@gnu.org; Sun, 30 Dec 2018 16:32:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gdigk-0006Ny-0N for bug-gnu-emacs@gnu.org; Sun, 30 Dec 2018 16:32: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: Sun, 30 Dec 2018 21:32:01 +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.154620548124491 (code B ref 33871); Sun, 30 Dec 2018 21:32:01 +0000 Original-Received: (at 33871) by debbugs.gnu.org; 30 Dec 2018 21:31:21 +0000 Original-Received: from localhost ([127.0.0.1]:42659 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gdig5-0006Mw-2c for submit@debbugs.gnu.org; Sun, 30 Dec 2018 16:31:21 -0500 Original-Received: from common.maple.relay.mailchannels.net ([23.83.214.38]:21505) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gdig3-0006Mk-Eh for 33871@debbugs.gnu.org; Sun, 30 Dec 2018 16:31:20 -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 40E2A682C5C; Sun, 30 Dec 2018 21:31:18 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a69.g.dreamhost.com (unknown [100.96.20.98]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id EB04F68284A; Sun, 30 Dec 2018 21:31:17 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a69.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); Sun, 30 Dec 2018 21:31:18 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Cellar-Tart: 5312d45b52ae3b59_1546205478105_2844402522 X-MC-Loop-Signature: 1546205478105:2055563711 X-MC-Ingress-Time: 1546205478104 Original-Received: from pdx1-sub0-mail-a69.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a69.g.dreamhost.com (Postfix) with ESMTP id 8D02F803DA; Sun, 30 Dec 2018 13:31:17 -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=IOjFu1RcTFLblHXFwsLQw8b8wcA=; b= YkL+21Tzis369cuhHTUsXey+a1JZyVDKElIQtyhuOUK3K0fZQUs/wMCxHXwl+NRl v6DXdZfIfm0kK2BocYr+BfskkKtp/CKwv7M6smq0fpn5zbBx/G81oCN/X/jegoRg FtrOF5PXNEiAXU8toOzb+XRtnR7SqGG3m1ccdo/Gb/g= 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-a69.g.dreamhost.com (Postfix) with ESMTPSA id 02D51803D8; Sun, 30 Dec 2018 13:31:15 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a69 In-Reply-To: <5C28957A.9050609@gmx.at> (martin rudalics's message of "Sun, 30 Dec 2018 10:52:58 +0100") X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtledruddtgdduheduucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufhofhffjgfkfgggtgesthdtredttdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucfkphepledurdduvdelrddutdekrdduleefnecurfgrrhgrmhepmhhouggvpehsmhhtphdphhgvlhhopehmrghilhdrjhhurhhtrgdrohhrghdpihhnvghtpeeluddruddvledruddtkedrudelfedprhgvthhurhhnqdhprghthheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqedpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnrhgtphhtthhopehruhgurghlihgtshesghhmgidrrghtnecuvehluhhsthgvrhfuihiivgeptd 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:154040 Archived-At: >> image-revert is another special, as indicated by bug#33631 > > But there the position of point or that of its window has no impact, I > presume. Yes, but there image-revert needs to know window dimensions when the buffer is not displayed in a window - a situation similar to dired-revert when buffer's windows are in a window configuration. >> 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. > > I nowlooked into it. It's a bug caused by > > XMARKER (p->pointm)->insertion_type > = !NILP (buffer_local_value /* Don't signal error if void. */ > (Qwindow_point_insertion_type, w->contents)); > > and the value of > > buffer_local_value (Qwindow_point_insertion_type, w->contents) > > is unbound and not nil. I have to fix that. > I tried to fix that on master now. Please have a look. Thanks, I confirm it's fixed. >>> 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, > > As number or as marker? As marker. But I guess due to marker invalidation after reverting better to use numbers, or even better to get metadata depending on major mode, e.g. in case of Dired - dired-filename. >> 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. > > But a configuration saves the point of each window, for the selected > one it stores the point of that window's buffer. Is it just because > you want to be able to retrieve those values? Or what am I missing? It seems a configuration saves the point as marker, not as number, so it invalidates on reverting. It would be better if such stored metadata also includes dired-filenames, or even a lambda that could move point to saved filenames in Dired buffers. ((window-configuration-1 ((dired-window-1 . `(lambda () (dired-goto-file ,(dired-get-filename)))))) (window-configuration-2 ...) ...)