From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#33871: 27.0.50; Revert Dired window saved in window configuration Date: Wed, 23 Feb 2022 19:53:14 +0200 Organization: LINKOV.NET Message-ID: <86tucp7dbp.fsf@mail.linkov.net> References: <87bm59mglk.fsf@mail.linkov.net> <87fsoo323s.fsf@gnus.org> <86h792x3wv.fsf@mail.linkov.net> <119a9c2c-e27f-6c3a-07ad-66bc76fc58cf@gmx.at> <861r05co9l.fsf@mail.linkov.net> <86zgmsne32.fsf@mail.linkov.net> <86sfsi29yc.fsf@mail.linkov.net> <1830e7af-27a8-ac7f-ba6f-fa2006139208@gmx.at> <86fsohmqn9.fsf@mail.linkov.net> <9df28298-fedc-0cfe-7243-c04868115e90@gmx.at> <86fsoezsw3.fsf@mail.linkov.net> <86sfsewvxr.fsf@mail.linkov.net> <9d741b43-e3bb-669b-b345-6b877c902b33@gmx.at> <86fsoaq4lo.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34023"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) Cc: 33871@debbugs.gnu.org, Lars Ingebrigtsen To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Feb 23 19:07:49 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nMw3J-0008fl-Ow for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 23 Feb 2022 19:07:49 +0100 Original-Received: from localhost ([::1]:36496 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nMw3I-0002e7-Mz for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 23 Feb 2022 13:07:48 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:34020) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nMw2Y-0002Zl-6F for bug-gnu-emacs@gnu.org; Wed, 23 Feb 2022 13:07:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52544) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nMw2X-00024L-Tc for bug-gnu-emacs@gnu.org; Wed, 23 Feb 2022 13:07:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nMw2X-0005m8-NX for bug-gnu-emacs@gnu.org; Wed, 23 Feb 2022 13:07: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, 23 Feb 2022 18:07:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33871 X-GNU-PR-Package: emacs Original-Received: via spool by 33871-submit@debbugs.gnu.org id=B33871.164563959222151 (code B ref 33871); Wed, 23 Feb 2022 18:07:01 +0000 Original-Received: (at 33871) by debbugs.gnu.org; 23 Feb 2022 18:06:32 +0000 Original-Received: from localhost ([127.0.0.1]:46438 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nMw24-0005lC-BI for submit@debbugs.gnu.org; Wed, 23 Feb 2022 13:06:32 -0500 Original-Received: from relay8-d.mail.gandi.net ([217.70.183.201]:32991) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nMw21-0005kj-RW for 33871@debbugs.gnu.org; Wed, 23 Feb 2022 13:06:30 -0500 Original-Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 8DE411BF208; Wed, 23 Feb 2022 18:06:22 +0000 (UTC) In-Reply-To: (martin rudalics's message of "Wed, 23 Feb 2022 10:31:41 +0100") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:227526 Archived-At: >> But still 'dired-revert' fails to update the Dired buffer in >> window configurations saved in tabs, or in winner.el, or >> in 'C-x r w' (window-configuration-to-register), etc. > > As a first step we could try to do that for window states. But window states don't contain pointers to windows. So it's impossible to find e.g. '(selected-window)' in a window state returned by '(window-state-get)'. > (Note in this context: We traditionally say in the Elisp manual that "As > a special exception, the window configuration does not record the value > of point in the selected window for the current buffer." which is not > precise IIUC. It does record the value but 'set-window-configuration' > does not or not necessarily restore it.) Then we could save additional context information the same way as currently this special exceptional value of point is saved, e.g. in 'tab-bar--tab': (wc . ,(current-window-configuration)) (wc-point . ,(point-marker)) where 'point-marker' is saved separately from 'current-window-configuration'. And then it's restored in 'tab-bar-select-tab': ;; set-window-configuration does not restore the value of ;; point in the current buffer, so restore it separately. (when (and (markerp wc-point) (marker-buffer wc-point) ;; FIXME: After dired-revert, marker relocates to 1. ;; window-configuration restores point to global point ;; in this dired buffer, not to its window point, ;; but this is slightly better than 1. ;; Maybe better to save dired-filename in each window? (not (eq 1 (marker-position wc-point)))) (goto-char wc-point)) Please note that this bug report is related to FIXME above. So a possible solution is also to save more context information like dired-filename, and then restore it using dired-goto-file.