From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.bugs Subject: bug#33871: 27.0.50; Revert Dired window saved in window configuration Date: Thu, 24 Feb 2022 10:19:17 +0100 Message-ID: <37e2129c-464f-7f0a-0870-f7360ca21dc3@gmx.at> 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> <86tucp7dbp.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26968"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 33871@debbugs.gnu.org, Lars Ingebrigtsen To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Feb 24 10:20:56 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 1nNAIy-0006t6-3J for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 24 Feb 2022 10:20:56 +0100 Original-Received: from localhost ([::1]:34280 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nNAIw-0007kG-U3 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 24 Feb 2022 04:20:54 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:51484) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nNAIM-0007f6-Pu for bug-gnu-emacs@gnu.org; Thu, 24 Feb 2022 04:20:27 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53629) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nNAI7-000514-L9 for bug-gnu-emacs@gnu.org; Thu, 24 Feb 2022 04:20:16 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nNAI7-0001BX-HW for bug-gnu-emacs@gnu.org; Thu, 24 Feb 2022 04:20:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 24 Feb 2022 09:20:03 +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.16456943674443 (code B ref 33871); Thu, 24 Feb 2022 09:20:03 +0000 Original-Received: (at 33871) by debbugs.gnu.org; 24 Feb 2022 09:19:27 +0000 Original-Received: from localhost ([127.0.0.1]:47516 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNAHW-00019b-QZ for submit@debbugs.gnu.org; Thu, 24 Feb 2022 04:19:27 -0500 Original-Received: from mout.gmx.net ([212.227.17.21]:53785) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNAHU-00019O-CH for 33871@debbugs.gnu.org; Thu, 24 Feb 2022 04:19:24 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1645694358; bh=b+fDyR3oN7Tok1YzkxWKo/ybCiK+DDPHA7IuzmrPZVM=; h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:In-Reply-To; b=QAGLiAw93JSxaUmx/NFa2R1IuIpLVD4am3BPOA50hrL1xbWWNwSYeQc1p2+zk+1Xz UShVJ5jU6yG67hdkyze10E+WpokxV2Di4wtXAhp59FnXQCRDPkmarchVVcE+WuOgNY xNOqFD2LHVA5LXBOkCdMYy4M8yfFKnrGlOkDcTo0= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from [192.168.1.101] ([212.95.5.227]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1McYCb-1nxJJT1Sbl-00cv70; Thu, 24 Feb 2022 10:19:18 +0100 Content-Language: en-US In-Reply-To: <86tucp7dbp.fsf@mail.linkov.net> X-Provags-ID: V03:K1:6lL88eAND5ROCJis46m43nh4c7If/z/MjFGo1eHiFLzoR5paqdX PQjgcnQjOpBQL/wJKtY4fXqlxBkWEnh6v+KtOOaoKYE4QDHRk47irPPXujLElpIJij8Dypa wRqFFcNYrprSRb+LxwPdDm9zJmuF3bA+Xbnes2p8GFlApW25JVkcAiyBdlCw66upZEJlXTq Squ1DcM1N1ROYBdq1VC3w== X-UI-Out-Filterresults: notjunk:1;V03:K0:eE93tlBqIus=:N6sfhtPELBviOWtlMrWiGs iin4vGIWhB3yquXJcP736QvPEajYMYkEpitRbNRgLbPff+9Q9Fd4nTBovzbzXG4ydgrFcjfaF c7Xn0fIZRNKiXXZemyiNQbGgxNfDbOLeq6boWPQFWTicm/ZQtNUjqKYPUzss9UM/WU4Wtwe4C aCJotzCawnFZzVviDK6mZpQZW644QSPnZhnOAFZO0LGmR8cXT4wwBYCsOkY8EPz5wROfs97xt 4mqjS6zK21MmaEydNfsAs9UySU+PjiI8mt6Tt7WwbTiaBAse/oqdEEaCQD/JOsFnuiDyBa5Qn PX3FLIoTYyIiI6NOcgh6XYu21f0GE/pvROI/aIu9Mmd7QGxEp/wxzOfqBwSm4RoO2qEgPI6qN 9ZAQnOXqiy2TjcKOujNAZBk4rAUKIyAMPgkcW16MVEVgKZG1NlFJoHdPAxWVURo8sAxvVAhmV o3ZMP+i2G7rBMKdRTuUpMAXg+iU7PZ2kgWfijAqxXSXutpgiYp3vNeHMeu09yt1fmr0iIfKIS LtMfxO2bf+kSK99c8jMYYbw915yLYJ+kNI+dzSZYAXieHQyOwuwEGj5p3kZURDH01H/Xo/L3D YX1f9iYmFvS990HaKZO2CW04137oGdkf+WWoVaNWOumZP2kurOmXroEniQZvFJcd483MGZr1h ntz5fhVTllEM0oMADFooklElN1HkafBpJZpMdMJpAC559CcEZ2ylHLosGMQAdYUlwqnfg0Nqb iACMKjYdQRdTOvp9ikOeqPYYcoScSq3c2lsgHdgNe/9pYkn2SQeHj6anPgnEDDNdXjwKMFxt 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:227568 Archived-At: > 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)'. But you can easily write a function to inspect a window state. > 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. We obviously then should strive for a solution that stores any kind of information via a hook in an alist of entries, one for each window in a buffer local way, and one global entry for the frame itself. martin