From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Joseph Turner via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#70213: Info-mode side window fit-window-to-buffer issue Date: Fri, 05 Apr 2024 18:34:11 -0700 Message-ID: <87sezzs20t.fsf@breatheoutbreathe.in> References: <875xww2ncc.fsf@breatheoutbreathe.in> <86h6gg56vg.fsf@gnu.org> <871q7j3l4b.fsf@breatheoutbreathe.in> <87jzlbddt3.fsf@gmx.net> <87msq71n2a.fsf@breatheoutbreathe.in> <87sezzfo22.fsf@gmx.net> Reply-To: Joseph Turner 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="30322"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 70213@debbugs.gnu.org To: Stephen Berman Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Apr 06 03:40:29 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 1rsv2i-0007bj-Bi for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 06 Apr 2024 03:40:28 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rsv2I-0006lh-M1; Fri, 05 Apr 2024 21:40:02 -0400 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 1rsv2F-0006lG-38 for bug-gnu-emacs@gnu.org; Fri, 05 Apr 2024 21:39:59 -0400 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 1rsv2C-0004K7-H8 for bug-gnu-emacs@gnu.org; Fri, 05 Apr 2024 21:39:58 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rsv2I-0002zx-0U for bug-gnu-emacs@gnu.org; Fri, 05 Apr 2024 21:40:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Joseph Turner Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 06 Apr 2024 01:40:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70213 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: notabug Original-Received: via spool by 70213-submit@debbugs.gnu.org id=B70213.171236757611439 (code B ref 70213); Sat, 06 Apr 2024 01:40:01 +0000 Original-Received: (at 70213) by debbugs.gnu.org; 6 Apr 2024 01:39:36 +0000 Original-Received: from localhost ([127.0.0.1]:37854 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rsv1r-0002yR-Rz for submit@debbugs.gnu.org; Fri, 05 Apr 2024 21:39:36 -0400 Original-Received: from out-185.mta0.migadu.com ([91.218.175.185]:60228) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rsv1o-0002y8-Cp for 70213@debbugs.gnu.org; Fri, 05 Apr 2024 21:39:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=breatheoutbreathe.in; s=key1; t=1712367559; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=94PrybTkZQOLTyLZeLaQtKbhet+X9KVOXyMuHcsQ0XM=; b=ZkMli8yuXntUZ3O5dNslbihMVFZbbJNR4onh0/1q9CLPMYlcaGE/lZu5LAECtPseTTHC3k 8EMsN56Qng5tU1x0nDJKwj05/aa5yGdrZUPX9XOhs/i6SATmCZgpnSOD5TAkHWxLgskPmZ 79KBSFhi/ojPd1AU/SZeHc33gWGGe/w= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. In-reply-to: <87sezzfo22.fsf@gmx.net> X-Migadu-Flow: FLOW_OUT 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:282733 Archived-At: --=-=-= Content-Type: text/plain Stephen Berman writes: > On Fri, 05 Apr 2024 14:58:27 -0700 Joseph Turner wrote: > >> Stephen Berman writes: >>> FWIW, I get the expected result with your recipe on master (GNU/Linux, >>> Gtk3; I don't have emacs-29 at hand to test). >> >> According to the issue that Juri linked to (bug#68081), this issue was >> resolved on master. > > Yes, I saw Juri's post after I sent mine; I had missed that bug report. > >> Was your Emacs build since January 6 (since >> d3a4fe5694f7bd1a09546d67d2cddc0f444d41ca )? > > Yep, I'm currently at > 09f381d70d8..: Michael Albinus 2024-03-31 Fix wildcard signals in dbusbind.c The attached patch fixes this issue, but more would need to be done for fit-window-to-buffer to be a meaningful value in display-buffer-alist, since navigating between info nodes doesn't cause the window to resize. --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Display-buffer-after-ensuring-it-contains-text.patch >From f8a2584e3927c149eb2b008de5cb27fb148f08e1 Mon Sep 17 00:00:00 2001 From: Joseph Turner Date: Fri, 5 Apr 2024 18:32:36 -0700 Subject: [PATCH] Display buffer after ensuring it contains text * lisp/info.el (info-pop-to-buffer): bug#70213 --- lisp/info.el | 44 +++++++++++++++++++++----------------------- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/lisp/info.el b/lisp/info.el index 1e478cdbee9..fe134161af4 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -807,30 +807,28 @@ info-pop-to-buffer (get-buffer-create "*info*"))))) (with-current-buffer buffer (unless (derived-mode-p 'Info-mode) - (Info-mode))) + (Info-mode)) + + (if file-or-node + ;; If argument already contains parentheses, don't add another set + ;; since the argument will then be parsed improperly. This also + ;; has the added benefit of allowing node names to be included + ;; following the parenthesized filename. + (Info-goto-node + (if (and (stringp file-or-node) (string-match "(.*)" file-or-node)) + file-or-node + (concat "(" file-or-node ")"))) + (if (and (zerop (buffer-size)) + (null Info-history)) + ;; If we just created the Info buffer, go to the directory. + (Info-directory)))) + + (when-let ((window (display-buffer buffer + (if other-window + '(nil (inhibit-same-window . t)) + '(display-buffer-same-window))))) + (select-window window)))) - (let* ((window - (display-buffer buffer - (if other-window - '(nil (inhibit-same-window . t)) - '(display-buffer-same-window))))) - (with-current-buffer buffer - (if file-or-node - ;; If argument already contains parentheses, don't add another set - ;; since the argument will then be parsed improperly. This also - ;; has the added benefit of allowing node names to be included - ;; following the parenthesized filename. - (Info-goto-node - (if (and (stringp file-or-node) (string-match "(.*)" file-or-node)) - file-or-node - (concat "(" file-or-node ")"))) - (if (and (zerop (buffer-size)) - (null Info-history)) - ;; If we just created the Info buffer, go to the directory. - (Info-directory)))) - - (when window - (select-window window))))) ;;;###autoload (put 'info 'info-file (purecopy "emacs")) ;;;###autoload -- 2.41.0 --=-=-=--