From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Morgan Smith Newsgroups: gmane.emacs.bugs Subject: bug#74246: [PATCH] Reuse display windows in image-dired Date: Thu, 07 Nov 2024 15:19:15 -0500 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15862"; mail-complaints-to="usenet@ciao.gmane.io" To: 74246@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Nov 07 21:25:28 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 1t994K-00041j-3m for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 07 Nov 2024 21:25:28 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t993z-0001J7-Oa; Thu, 07 Nov 2024 15:25: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 1t993u-0001Id-Pa for bug-gnu-emacs@gnu.org; Thu, 07 Nov 2024 15:25:04 -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 1t993u-00075j-Af for bug-gnu-emacs@gnu.org; Thu, 07 Nov 2024 15:25:02 -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:From:To:Subject; bh=4b+/rRN6AOTh3dHcAY1oK6zsqIe3qvcAcXDVdrZlBnw=; b=XUCL0UdGltrfUxQ6hAKtItUopFeGesA/hUc7JcX9BqCe8vsYlrxn7SBQo8e+CwnZGv/7JabPOtisxdugqRLZgbx3dFZUtwdn5eVNgoa3PfYxT/uuoShnaji7ZHF362NUhv9GxhUm9xmdl3HjjSEMUwkRPI22lMYHijWapa3Ib5n30viCZwMMSP3qvxcCLFUWlPj6n1DPSBeKO0Y71orl0CyXZ5kHuzTph9ZEjOacHYX+HVrnvXzhI8SQut5dTM0EM8k3iIb2X55PV22TN0h3h1oAfYGm2Y4TDGUAYM2X7H/GgTN5Wv83zepyZ1/JTGEtp4bfbPPvkpAv5UO83M5q5g==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1t993u-0002BC-3r for bug-gnu-emacs@gnu.org; Thu, 07 Nov 2024 15:25:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Morgan Smith Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 07 Nov 2024 20:25:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 74246 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.17310110608315 (code B ref -1); Thu, 07 Nov 2024 20:25:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 7 Nov 2024 20:24:20 +0000 Original-Received: from localhost ([127.0.0.1]:49710 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t993D-0002A1-Io for submit@debbugs.gnu.org; Thu, 07 Nov 2024 15:24:20 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:40170) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t993B-00029t-KY for submit@debbugs.gnu.org; Thu, 07 Nov 2024 15:24:18 -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 1t993B-0001Dg-Dz for bug-gnu-emacs@gnu.org; Thu, 07 Nov 2024 15:24:17 -0500 Original-Received: from mail-mw2nam10olkn20830.outbound.protection.outlook.com ([2a01:111:f403:2c12::830] helo=NAM10-MW2-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t9939-00071Z-PP for bug-gnu-emacs@gnu.org; Thu, 07 Nov 2024 15:24:17 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Pm9S+Q6CwQrfIlwyDpgHsMNpTXWijuzNaqZYVeZ3heYbbFHl4Ayvhz5gmcqjtYtUNV8dzRXKRhllhTU9ZWtWC0Eve4F9sMOT4ThDAZ2LVkkqbdjAOXZNzJOoMDa6cV/O5ImImcDUTOH4BLyFM25hxa84zC/aAfo1PPhgtDpoPYivBA+MTXedlVQY+nIpSZm8W8yj2+D2j+wCtkaVx+dd4Jf9yjuH5LgIe3Yt3YsBuw8OwylWx+TYkJ4CIojilMordUydWKYy0+ZaNNDvkFmHLXsyi0mRoQH/oHRBrVk1GWxzcKmflp8BcPUUVyY+9dIWXnaRRdPrJ/SOx677xA8wQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=4b+/rRN6AOTh3dHcAY1oK6zsqIe3qvcAcXDVdrZlBnw=; b=m/rNOuEJrM+Tkn8aJ2k8601P6W9IWc5YFOf0XrfnSqwy8qT6rFp57/rxEnNdWy4ifXDIxJReSuqD4xRgxmqsi1F5d90yF7AUVCwuuuJxwLUMtnol6LGwb6afnhthKKffEf7GpBvMWJ/JVqoWDTUSXYIousySkbNd7boBBoZRJGmfjQmiiJwwOU9FdZjHV9KjM7FanmKNOgtiP0HJ+SAJKfZfiZgUKjdOf3WqSlQglYbrv2KSTR0QxPDwamvGe30buauLzVsNSJN9UcWHDGmb7FGeVl+yVnP6LMNkI3ljUBC+rY3awzJd8gZ91KOFRoxxl7IAIGxJ/+aAecef8dN/Vw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4b+/rRN6AOTh3dHcAY1oK6zsqIe3qvcAcXDVdrZlBnw=; b=W2eX11r56KdsHAjud3pgM9PafBY5dE9rc0Nx+VueqoiMp0c/mdMjzmUU1hSHOYAtS4QBNMnvBVsYuBQ7Ei42HGQJHRrypmMyS5AGPmd5234dv5x+d86m4T+WaNJRFOExcBGY+A8uU+DzLvZPj4mOXiTsFdyJuyce6vCqJERctrQSVy4hdhAZuznlhsB/I+yVoW6O13xLRjgYtHb5a4aupDzprDgwJ0Yy8h61pfIl5/mSPXU0SlR6AmG94s4PCP9Ffo3LW8fRAYqsWp2kJnBlwI+E63cM5nHKuoBYzDlZgiOW72aS5FexJOZTVyYCral2VwX98TVBYNc7smD0Grwxdg== Original-Received: from CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM (2603:10b6:610:1c4::17) by MN0PR84MB3915.NAMPRD84.PROD.OUTLOOK.COM (2603:10b6:208:4c9::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.19; Thu, 7 Nov 2024 20:19:05 +0000 Original-Received: from CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM ([fe80::5c77:7a58:48ed:9aef]) by CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM ([fe80::5c77:7a58:48ed:9aef%3]) with mapi id 15.20.8137.018; Thu, 7 Nov 2024 20:19:05 +0000 X-Hashcash: 1:20:241107:bug-gnu-emacs@gnu.org::LrAp8fK8QK008asY:Qze X-ClientProxiedBy: MA2P292CA0014.ESPP292.PROD.OUTLOOK.COM (2603:10a6:250:1::10) To CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM (2603:10b6:610:1c4::17) X-Microsoft-Original-Message-ID: <871pzmlruk.fsf@outlook.com> X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH3PR84MB3424:EE_|MN0PR84MB3915:EE_ X-MS-Office365-Filtering-Correlation-Id: 6f27ec8c-b8d8-4d41-9f93-08dcff696cf1 X-Microsoft-Antispam: BCL:0; ARA:14566002|8060799006|6092099012|5072599009|19110799003|15080799006|7092599003|461199028|13095399003|3412199025|440099028; X-Microsoft-Antispam-Message-Info: 7vlyiVHRTv4dUzC4caqvwvtJC1D+WTNpPEzM6QJHJ6pB5P4WQaG/30nMa3+XGGf3PbeWzNrR0qmvTww5MLGGHPvyAVzzJwMCmHjeN5sQngOx2/vCBocl/YIY3PhBO51Rkve06osMNb0uq+r5kXtLQZbzB6Q+IdRcJniPP81jld4FoUjkockJUHKPZbBzRzccosGK8JgK9jvbmpFmOPwo8+A89QiGW1BbMjq5REkdM8G0GZr9NsY558olDBGUK930bRfryfq/bIRRALkpHOf63optyfZ6Lu73sH02/sGRCOP2IZiLY5OR/fZrE5bSoGG2zeqplng1k0zlz4lQUvcuNmoUUqzlUhWkenyHheCaVXz372Jj8xcHX5R8Uhl322sYXg3K2sMpYW24SscXBpLolA7UkejukMcCUIwzEiY2wQusCYmnffmWadXzLoksJXg8i3WkDJLnMir05K9pjGxoFE+hZs1FSCsvjr10jHpWx4yEcRGe9BHbDVknbPafPA3lcp4eHZO7o3knCkNYU5hDG6ReMSE3dOCov87SonxT85GzYBLJT3koh9ol2VeXaoVqYSXXhYGunYcqiZbk92tSHEtjCbkPilh9T9SV5Sa08NwTnFHid6CL7yVAtrxQ6dgTH//MH5GDaEjyxogtXTywEbN2ZI/gUwu6xhXmPZdSESRptLwOLFxM9p1okodeCP6IDDLxUiJtUqx92UhUX8QVWkm9dM/I+mdlEU4sOuupfxpC9Zxjo4ZtGW8sTwnHj DAX07wvw+MIQq25mAeMjvx+xk6TnLMgfAfaRa8X/00QCUkHHFLeweVDTeyVSlV9fV+r44RHPDWs1igzo+5GASD3vxEKXVmT93U X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: tRsPCytWW2lgRxRRuKxWwHQfE5orKmGEYC08BWPpCZeXxLdnqlnMwPtm10rvCKW4Wu07m0vAX1b2xVxGyYTa6RS/7EP90kd6k5JB8mRia7Viqi+MZad6oJcuaW5igLMWhWrpCWj6qHM2uskY0WKakO3NMrLZ0SW/D0bZYn/tmpH7CMRYlRXnHagLWIlyn6qpsbeCoZopCcE2PxNKKRhGoeOa64PbGZMgtdBMvFwneaJPVpBBWSJLQ9FqCFcxdzYNn7IfsVqqFULSgwdLdujvscX6u6uk90h+0AnnhcV47vztzVhbKVzdgfV140sU+jF+UEmcPSYDidBKr+QAa0Ld9RgclHSyb8VUsKZCePmJHoCSG4pOpxqflElHboJitHM0A6Njp/04vCHi++80kL8mWwdHTsLZwiUCkNN18Ac0052nEyIbMVVcuNHar0ra0dKWAJYTSYQOvkM5Q/UGDFt5mmTKMV4RruPx+3zPMnviCuMTMbdfNJJl3O3DvoINAnvShfKoHqrVGnfgljbVGAzYalhM0YamO0jBD3itad8a51whm/UHdD0mrDMpsXvBBR1biD7N46f5aonR6Dg2G//u6LJ2B6AcjkJitUC4VJO/kAcOIK/mechGG93a0sIF0KnQfo3Jtgd4qU4Il8kVG1dtOIhTktpvdkzRQL/yJXWkKwtinmHqrnjHvbpkERRyrqoKiUinSt2O5EUq7xti9bMBsKEglQo3cPMAg0Cutk9pMj5dsNSDET3ui3k+i6 tOjx3sSuW1evijyD7dII3l/HYbTpXVIqJVGKT0b9bNFDhh2FK7Zp5RjVa5hnadd/Lk35VNaNQNrAYdTjBQ2hPepTPc6TOM9CBu X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6f27ec8c-b8d8-4d41-9f93-08dcff696cf1 X-MS-Exchange-CrossTenant-AuthSource: CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Nov 2024 20:19:04.9877 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR84MB3915 Received-SPF: pass client-ip=2a01:111:f403:2c12::830; envelope-from=Morgan.J.Smith@outlook.com; helo=NAM10-MW2-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:295047 Archived-At: --=-=-= Content-Type: text/plain Tags: patch Hello, When using image-dired, one can use SPC (image-dired-display-next) repeatedly to display successive images in a dedicated buffer. However, it seems to choose a different window each time I press SPC. I can reproduce this in "emacs -Q" when I have 4 windows. The following patch works on my system. Thanks, Morgan In GNU Emacs 30.0.91 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.41, cairo version 1.18.0) System Description: Guix System Configured using: 'configure CONFIG_SHELL=/gnu/store/3jhfhxdf6v5ms10x5zmnl166dh3yhbr1-bash-minimal-5.1.16/bin/bash SHELL=/gnu/store/3jhfhxdf6v5ms10x5zmnl166dh3yhbr1-bash-minimal-5.1.16/bin/bash --prefix=/gnu/store/9x5277gcjzwlis5yd0iq7ypq8f78jhpa-emacs-next-pgtk-30.0.91-1.9a1c76b --enable-fast-install --with-pgtk --with-cairo --with-modules --with-native-compilation=aot --disable-build-details' --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=0001-Reuse-display-windows-in-image-dired.patch >From a02b37cbcdbee4c773336a82f2109b1c03467107 Mon Sep 17 00:00:00 2001 From: Morgan Smith Date: Thu, 7 Nov 2024 14:24:01 -0500 Subject: [PATCH] Reuse display windows in image-dired * lisp/image/image-dired.el(image-dired-display-image): Reuse the windows used by the previous buffer. --- lisp/image/image-dired.el | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lisp/image/image-dired.el b/lisp/image/image-dired.el index 1928b0a2955..37f23665755 100644 --- a/lisp/image/image-dired.el +++ b/lisp/image/image-dired.el @@ -1268,11 +1268,15 @@ image-dired-display-image (setq file (expand-file-name file)) (when (not (file-exists-p file)) (error "No such file: %s" file)) - (let ((buf (get-buffer image-dired-display-image-buffer)) - (cur-win (selected-window))) + (let* ((buf (get-buffer image-dired-display-image-buffer)) + (windows (and buf + (get-buffer-window-list buf t t))) + (cur-win (selected-window))) (when buf (kill-buffer buf)) (when-let ((buf (find-file-noselect file nil t))) + (dolist (window windows) + (set-window-buffer window buf)) (pop-to-buffer buf) (rename-buffer image-dired-display-image-buffer) (if (string-match (image-file-name-regexp) file) -- 2.46.0 --=-=-=--