From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Manuel Giraud via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#68486: 29.1; Confusing window layout changes in image-dired Date: Tue, 16 Jan 2024 10:52:50 +0100 Message-ID: <87zfx5vc3x.fsf@ledu-giraud.fr> References: <86le8qfj3s.fsf@chopper> <874jfdwspy.fsf@ledu-giraud.fr> Reply-To: Manuel Giraud 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="39491"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: joakim@verona.se To: 68486@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jan 16 10:53:23 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 1rPg8I-000A3x-Qb for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 16 Jan 2024 10:53:22 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rPg80-0005KS-T4; Tue, 16 Jan 2024 04:53:06 -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 1rPg7y-0005Id-9N for bug-gnu-emacs@gnu.org; Tue, 16 Jan 2024 04:53:02 -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 1rPg7y-0005us-1N for bug-gnu-emacs@gnu.org; Tue, 16 Jan 2024 04:53:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rPg7y-0000Lr-9Z for bug-gnu-emacs@gnu.org; Tue, 16 Jan 2024 04:53:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Manuel Giraud Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 16 Jan 2024 09:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68486 X-GNU-PR-Package: emacs X-Debbugs-Original-To: Manuel Giraud via "Bug reports for GNU Emacs, the Swiss army knife of text editors" X-Debbugs-Original-Cc: 68486@debbugs.gnu.org, joakim@verona.se Original-Received: via spool by 68486-submit@debbugs.gnu.org id=B68486.17053987771334 (code B ref 68486); Tue, 16 Jan 2024 09:53:02 +0000 Original-Received: (at 68486) by debbugs.gnu.org; 16 Jan 2024 09:52:57 +0000 Original-Received: from localhost ([127.0.0.1]:47778 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rPg7t-0000LS-G2 for submit@debbugs.gnu.org; Tue, 16 Jan 2024 04:52:57 -0500 Original-Received: from ledu-giraud.fr ([51.159.28.247]:17490) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rPg7o-0000LF-VY for 68486@debbugs.gnu.org; Tue, 16 Jan 2024 04:52:56 -0500 DKIM-Signature: v=1; a=ed25519-sha256; c=simple/simple; s=ed25519; bh=IOWPGb5/ UxcmrTc3+TumWEbmwP1zBcYskJmC3Wli2Rc=; h=date:references:in-reply-to: subject:cc:to:from; d=ledu-giraud.fr; b=pNNv0PBvl9xUyJNEWic9cPxE0Mkm+l gOqqVZo4iPML4NVUgMex6S4MItEvnDQxyFeDYJ++8VLRiTaPrUjDGfBg== DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=rsa; bh=IOWPGb5/UxcmrTc3 +TumWEbmwP1zBcYskJmC3Wli2Rc=; h=date:references:in-reply-to:subject: cc:to:from; d=ledu-giraud.fr; b=09dKl99YGWKiDY9O3QxB+3RFbydLHWrVrSdiYF ed7D8JttYYCS/TzqkPNlC9c/FmYOUBNJD87WcIBJB8OF8rdNhYwkZhLYrxpXPsPjhO1zZr kXutm2XLtzcxKYQ7B8k9joUh2s4kW7stGLU9MXnMhnw4SS/W6ih4FWIEKPKlXZ8eZ4zw3a TO8z+3Uos7RAUUGwdfdQ09RIwcPofUNH9x7i8hRN+wGOgOW9R7cr0k9rvmt4W7tEcCfu84 vyjeiy55LhyZLBk5t9VtIG1zr3rOJYJ/WpJLT34d0AvQCj8+KHVj58xZ6cQcykUZVsBp7d cSC/rx9/4Hd1nY9SmfTvkdQw== Original-Received: from computer ( [10.1.1.1]) by ledu-giraud.fr (OpenSMTPD) with ESMTPSA id 3d2c905c (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Tue, 16 Jan 2024 10:52:51 +0100 (CET) In-Reply-To: <874jfdwspy.fsf@ledu-giraud.fr> (Manuel Giraud via's message of "Tue, 16 Jan 2024 10:08: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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:278324 Archived-At: --=-=-= Content-Type: text/plain Hi, Could you try this patch? -- Manuel Giraud --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Refill-image-dired-display-image-buffer.patch >From b979865cf8cf2fa8ec73ac8bc6cfee32f6de68fc Mon Sep 17 00:00:00 2001 From: Manuel Giraud Date: Tue, 16 Jan 2024 10:47:45 +0100 Subject: [PATCH] Refill 'image-dired-display-image-buffer' Bug#68486 * lisp/image/image-dired.el (image-dired-display-image): Refill 'image-dired-display-image-buffer' instead of killing it, open a new file and then renaming it. --- lisp/image/image-dired.el | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/lisp/image/image-dired.el b/lisp/image/image-dired.el index 9eb68e240fe..b08aa129b98 100644 --- a/lisp/image/image-dired.el +++ b/lisp/image/image-dired.el @@ -1260,18 +1260,18 @@ 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)) + (let ((buf (get-buffer-create image-dired-display-image-buffer)) (cur-win (selected-window))) - (when buf - (kill-buffer buf)) - (when-let ((buf (find-file-noselect file nil t))) - (pop-to-buffer buf) - (rename-buffer image-dired-display-image-buffer) - (if (string-match (image-file-name-regexp) file) - (image-dired-image-mode) - ;; Support visiting PDF files. - (normal-mode)) - (select-window cur-win)))) + (with-current-buffer buf + (let ((inhibit-read-only t)) + (erase-buffer) + (insert-file-contents file) + (if (string-match (image-file-name-regexp) file) + (image-dired-image-mode) + ;; Support visiting PDF files. + (normal-mode)))) + (when buf (pop-to-buffer buf)) + (select-window cur-win))) (defun image-dired-display-this (&optional arg) "Display current thumbnail's original image in display buffer. -- 2.43.0 --=-=-=--