From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: joakim@verona.se Newsgroups: gmane.emacs.bugs Subject: bug#68486: 29.1; Confusing window layout changes in image-dired Date: Tue, 16 Jan 2024 12:51:42 +0100 Message-ID: <874jfdh4xd.fsf@tanaka.verona.se> References: <86le8qfj3s.fsf@chopper> <874jfdwspy.fsf@ledu-giraud.fr> <87zfx5vc3x.fsf@ledu-giraud.fr> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20846"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: manuel@ledu-giraud.fr 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 12:52:19 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 1rPhzP-0005FG-Ce for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 16 Jan 2024 12:52:19 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rPhz9-0004Wh-OM; Tue, 16 Jan 2024 06:52:03 -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 1rPhz7-0004WH-JI for bug-gnu-emacs@gnu.org; Tue, 16 Jan 2024 06:52:01 -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 1rPhz7-0001NH-Ag for bug-gnu-emacs@gnu.org; Tue, 16 Jan 2024 06:52:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rPhz7-0000Lr-Kl for bug-gnu-emacs@gnu.org; Tue, 16 Jan 2024 06:52:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: joakim@verona.se Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 16 Jan 2024 11:52:01 +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, Manuel Giraud Original-Received: via spool by submit@debbugs.gnu.org id=B.17054059181343 (code B ref -1); Tue, 16 Jan 2024 11:52:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 16 Jan 2024 11:51:58 +0000 Original-Received: from localhost ([127.0.0.1]:47959 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rPhz4-0000La-Al for submit@debbugs.gnu.org; Tue, 16 Jan 2024 06:51:58 -0500 Original-Received: from lists.gnu.org ([2001:470:142::17]:33106) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rPhz2-0000L3-Db for submit@debbugs.gnu.org; Tue, 16 Jan 2024 06:51:57 -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 1rPhyw-0004Vr-1U for bug-gnu-emacs@gnu.org; Tue, 16 Jan 2024 06:51:50 -0500 Original-Received: from smtp.outgoing.loopia.se ([93.188.3.37]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rPhyt-0001LE-Nz for bug-gnu-emacs@gnu.org; Tue, 16 Jan 2024 06:51:49 -0500 Original-Received: from s807.loopia.se (localhost [127.0.0.1]) by s807.loopia.se (Postfix) with ESMTP id 08C6F2FCD65D for ; Tue, 16 Jan 2024 12:51:44 +0100 (CET) Original-Received: from s899.loopia.se (unknown [172.22.191.5]) by s807.loopia.se (Postfix) with ESMTP id EDA162E28AAF; Tue, 16 Jan 2024 12:51:43 +0100 (CET) Original-Received: from s898.loopia.se (unknown [172.22.191.6]) by s899.loopia.se (Postfix) with ESMTP id EBCAE2C8BA9C; Tue, 16 Jan 2024 12:51:43 +0100 (CET) X-Virus-Scanned: amavisd-new at amavis.loopia.se Original-Received: from s934.loopia.se ([172.22.191.5]) by s898.loopia.se (s898.loopia.se [172.22.190.17]) (amavisd-new, port 10024) with UTF8LMTP id z9-QIoIyqCCb; Tue, 16 Jan 2024 12:51:43 +0100 (CET) X-Loopia-Auth: user X-Loopia-User: joakim@alicantealmeria.se X-Loopia-Originating-IP: 193.234.148.196 Original-Received: from tanaka.verona.se (unknown [193.234.148.196]) (Authenticated sender: joakim@alicantealmeria.se) by s934.loopia.se (Postfix) with ESMTPSA id 1CB177CEA4E; Tue, 16 Jan 2024 12:51:43 +0100 (CET) In-Reply-To: <87zfx5vc3x.fsf@ledu-giraud.fr> (Manuel Giraud via's message of "Tue, 16 Jan 2024 10:52:50 +0100") Received-SPF: pass client-ip=93.188.3.37; envelope-from=joakim@verona.se; helo=smtp.outgoing.loopia.se X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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:278330 Archived-At: Manuel Giraud via "Bug reports for GNU Emacs, the Swiss army knife of text editors" writes: > Hi, > > Could you try this patch? After some failures trying the patch in my running emacs session, I tried with emacs -q, and now it worked, big improvement! > -- > Manuel Giraud > > 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. -- Joakim Verona joakim@verona.se