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#74246: [PATCH] Reuse display windows in image-dired Date: Mon, 02 Dec 2024 09:42:45 +0200 Organization: LINKOV.NET Message-ID: <87ldwyil8q.fsf@mail.linkov.net> References: <868qtsmydz.fsf@gnu.org> <86a5dqm9gl.fsf@gnu.org> <06f264c8-b1a1-4a7f-8fe9-1ca58b2343ff@gmx.at> <87jzcn1af7.fsf@mail.linkov.net> <08f46ed1-e489-4859-8a25-ba7dc4262b95@gmx.at> <87y1108u9k.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="8829"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu) Cc: Morgan Smith , Eli Zaretskii , 74246@debbugs.gnu.org, stefankangas@gmail.com To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Dec 02 08:45:30 2024 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 1tI17a-00027g-ND for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 02 Dec 2024 08:45:30 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tI17D-0002lk-RS; Mon, 02 Dec 2024 02:45:07 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tI179-0002iT-Aw for bug-gnu-emacs@gnu.org; Mon, 02 Dec 2024 02:45:03 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tI178-0004fk-Tr for bug-gnu-emacs@gnu.org; Mon, 02 Dec 2024 02:45:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=1KIXH6zhALEY5dtQHMdyhJ9w/TrXtFpvBHO2SfTc3q0=; b=fayBnchSpeLvRIteKEnx3Jg7dCtavX9Ps6vReOaElawJM8HqhCyzLgwmVr/TaWhPfoXdVwk4dXGYaV8JIZM6NX6hByM00JfGk2ps94wqNbZfVcW2XWGtxYlHE71yTcZRnWDqwfEKGkdSai2HLBl9TxoFgRXXsiCnrn9nUZs1g4lkc2vbeUBySj96j2hMS/FIKVYaXwQdUeFKgH4PQ7916oZQguRoN+IbfIzoOCY/yrM8ByEin22WBXn8Yl17R1FwhGj9GNQAJ28itzZcGeHn5HyL5aruPkUsUuRvp7JJqnalrRSkjGXPW+tm2UkJQHEMj6VP/ytzKYy9uhm01SzxaQ==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tI178-0007WM-Oa for bug-gnu-emacs@gnu.org; Mon, 02 Dec 2024 02:45: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: Mon, 02 Dec 2024 07:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74246 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 74246-submit@debbugs.gnu.org id=B74246.173312545228802 (code B ref 74246); Mon, 02 Dec 2024 07:45:02 +0000 Original-Received: (at 74246) by debbugs.gnu.org; 2 Dec 2024 07:44:12 +0000 Original-Received: from localhost ([127.0.0.1]:54120 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tI16K-0007UU-Hn for submit@debbugs.gnu.org; Mon, 02 Dec 2024 02:44:12 -0500 Original-Received: from relay5-d.mail.gandi.net ([217.70.183.197]:60489) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tI16J-0007U6-CK for 74246@debbugs.gnu.org; Mon, 02 Dec 2024 02:44:11 -0500 Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id 95A141C000A; Mon, 2 Dec 2024 07:44:04 +0000 (UTC) In-Reply-To: (martin rudalics's message of "Sun, 1 Dec 2024 09:46:18 +0100") X-GND-Sasl: juri@linkov.net 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:296301 Archived-At: >> I agree with the need to set the window parameter always. >> For example, I often use commands that override the default action >> with e.g. windmove-display-up/down, etc. Therefore needed >> to add an advice that remembers the last window in the >> buffer-local variable: >> >> (defvar-local display-buffer-last-window nil) > > Let's define it via DEFVAR_PER_BUFFER in buffer.c and have > 'window--display-buffer' always set it. > 'display-buffer-use-some-window' then could use it either by default or > if it finds a 'some-window' entry whose cdr is nil or t or whatever we > want. > >> However, I still like your proposal to use a category instead of lru, >> that could be used here later as well. > > With 'image-dired' 'display-buffer-last-window' wouldn't help. But > 'image-dired' could define a mode-local variable, say > 'image-dired-last-window', and propose that as 'some-window'. We could > make 'some-window-method' accept a live window for that purpose. Please explain why 'display-buffer-last-window' wouldn't help for 'image-dired'? IIUC, 'image-dired' uses one source buffer that could use the buffer-local variable to remember the last window it used to display an image buffer.