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: Mon, 14 Feb 2022 20:10:46 +0200 Organization: LINKOV.NET Message-ID: <861r05co9l.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> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5076"; 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 Mon Feb 14 19:17:20 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 1nJfuZ-00017y-Nj for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 14 Feb 2022 19:17:19 +0100 Original-Received: from localhost ([::1]:42308 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nJfuY-0002W0-Dr for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 14 Feb 2022 13:17:18 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:36852) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nJfuJ-0002HW-0g for bug-gnu-emacs@gnu.org; Mon, 14 Feb 2022 13:17:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:48617) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nJfuI-0000HU-ND for bug-gnu-emacs@gnu.org; Mon, 14 Feb 2022 13:17:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nJfuH-00029F-K0 for bug-gnu-emacs@gnu.org; Mon, 14 Feb 2022 13:17: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: Mon, 14 Feb 2022 18:17: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.16448625778193 (code B ref 33871); Mon, 14 Feb 2022 18:17:01 +0000 Original-Received: (at 33871) by debbugs.gnu.org; 14 Feb 2022 18:16:17 +0000 Original-Received: from localhost ([127.0.0.1]:42514 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJftY-000285-Vu for submit@debbugs.gnu.org; Mon, 14 Feb 2022 13:16:17 -0500 Original-Received: from relay10.mail.gandi.net ([217.70.178.230]:55033) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJftW-00027q-GV for 33871@debbugs.gnu.org; Mon, 14 Feb 2022 13:16:15 -0500 Original-Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 302DF240008; Mon, 14 Feb 2022 18:16:06 +0000 (UTC) In-Reply-To: <119a9c2c-e27f-6c3a-07ad-66bc76fc58cf@gmx.at> (martin rudalics's message of "Mon, 14 Feb 2022 10:13:00 +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:226912 Archived-At: >> It should end up where it was initially, i.e. on file names in Dired. >> But this can achieved only by implementing context-aware markers, >> such as used by the package saveplace.el, e.g.: >> >> ((window-configuration-1 >> ((dired-window-1 . `(lambda () (dired-goto-file ,(dired-get-filename)))))) >> (window-configuration-2 ...) >> ...) > > Reverting a directory in a window could remember the name of the file > shown at the corresponding line and the offset of 'window-point' on that > line and also the entire contents of the old directory until revert > completes. As soon as the new contents of the directory have been > established, dired would search the remembered name and position point > at the remembered offset accordingly. If it does not find that name, it > would have to compare the contents of the old and current contents of > the directory and use some heuristics to position point appropriately. You meant remembering the file name and window-point in a buffer-local variable? Then it should be an alist with all windows of the same Dired buffer, e.g. (setq-local dired-positions '((# dired-file-1 window-point-1) (# dired-file-2 window-point-2) ...))