From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#52493: 29.0.50; Setting Inconsolata up in init.el makes default face rendered wrong Date: Wed, 21 Dec 2022 03:08:16 +0200 Message-ID: References: <80e7f515-e16f-5ce8-86a3-e5f47cd2d2f5@yandex.ru> <83k0g5j4pi.fsf@gnu.org> <83a6h1husr.fsf@gnu.org> <83czlwhe0v.fsf@gnu.org> <835yrohcb1.fsf@gnu.org> <834k78h989.fsf@gnu.org> <83zgp0ftse.fsf@gnu.org> <83wnk4fpyw.fsf@gnu.org> <9df1ebce-83ff-068c-20ed-b849697a06b2@yandex.ru> <8faaa5db-7099-b4d5-fae2-97b1eb28b90c@gmx.at> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35129"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Cc: rpluim@gmail.com, 52493@debbugs.gnu.org To: martin rudalics , Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Dec 21 02:22:36 2022 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 1p7noa-0008zA-Cu for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 21 Dec 2022 02:22:36 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p7nba-0006bn-IC; Tue, 20 Dec 2022 20:09:10 -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 1p7nbS-0006Yt-Mc for bug-gnu-emacs@gnu.org; Tue, 20 Dec 2022 20:09:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p7nbS-0004Y7-Dx for bug-gnu-emacs@gnu.org; Tue, 20 Dec 2022 20:09:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p7nbS-0007Af-8q for bug-gnu-emacs@gnu.org; Tue, 20 Dec 2022 20:09:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 21 Dec 2022 01:09:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52493 X-GNU-PR-Package: emacs Original-Received: via spool by 52493-submit@debbugs.gnu.org id=B52493.167158490727558 (code B ref 52493); Wed, 21 Dec 2022 01:09:02 +0000 Original-Received: (at 52493) by debbugs.gnu.org; 21 Dec 2022 01:08:27 +0000 Original-Received: from localhost ([127.0.0.1]:48306 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p7nas-0007AQ-RQ for submit@debbugs.gnu.org; Tue, 20 Dec 2022 20:08:27 -0500 Original-Received: from mail-ej1-f52.google.com ([209.85.218.52]:33322) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p7nar-0007AK-8P for 52493@debbugs.gnu.org; Tue, 20 Dec 2022 20:08:25 -0500 Original-Received: by mail-ej1-f52.google.com with SMTP id n20so33423017ejh.0 for <52493@debbugs.gnu.org>; Tue, 20 Dec 2022 17:08:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=rr96f3OI1RDfUTVyhPR4dSYVOqIEi/dUVsGacsSwW0w=; b=OlYA+Axh52tIqF/YWZ2TKmulwGhOwNKdKB+uT3KIOZamKAfYwVCjrfArOwtu2Ze0b5 3KpFT3/UpWy9em/4vhB/ajTCibkXdAUlZ7dymd77TiVWIhuooSUVKs1zU8Xe2+yBGUWJ 5tNspJNsGGXTzVIwRoSdF8cU4xBY+dDgXuMQ04897L6khrTFuFX9tfnNbbG9Jb9kBUsd fFhm/oZW0gsMLA8xDRW2PBI5H5B9EiWiZPFVhiPSyZLwRbUapmX5U14Az2hmLmRktoz1 pKgE+CpBfqwb1A9VSnlpUXIf33IRGm+BB6tzLYSXRZxtktqeTH/vy2kbTpLKYJ8sxbHl f5fQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=rr96f3OI1RDfUTVyhPR4dSYVOqIEi/dUVsGacsSwW0w=; b=umS8uqfzxBXPRbGT3LzD7DZ0BoAN+pGZb20JiSRl/opad2hFrPQ/JSZFTkOo1X48yZ bogVWdT05hgbDWJZZ+FqE21KxWgkNdqK9AWuQGCDilYtJu1PsWsIzukNwPcp9PT27ffZ sDhrjaX3ZH0NjhxZKkXc5jnSUaZlkdcxaxG0DOPNByZoUMnuQgyfNNBfW6H/xQzyH4ra jDXr16pY2XalngORz12qAuugQ2eCnXQiqB8HyumX9hPGm5Xmsdy6YNsAHDAdfJQ1z4vd HVXiYFHagSegGdOQQQmMO226dTEj0uaM7xlhdMnuZTQ2LffUq5AUelrCZTbjLw1EDOXr xL5A== X-Gm-Message-State: AFqh2kpMf1gGMXprF8T/oYuQwoJ5uSret2kUAvK3+niprV3pvOC3Ldqj DXy/lWGUkrzg/RxQ0ZJaZNc= X-Google-Smtp-Source: AMrXdXuymddac1dinM7xBbx7nQ6TrXxyDtu4FR5HvheFWZA+jNZxk1w0AQ3A+6Yk8BMrklxnTCO7YA== X-Received: by 2002:a17:907:9d06:b0:7e8:ced8:cb9b with SMTP id kt6-20020a1709079d0600b007e8ced8cb9bmr7041730ejc.42.1671584899162; Tue, 20 Dec 2022 17:08:19 -0800 (PST) Original-Received: from [192.168.0.2] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id q25-20020a170906a09900b0078d76ee7543sm6381088ejy.222.2022.12.20.17.08.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 20 Dec 2022 17:08:18 -0800 (PST) Content-Language: en-US In-Reply-To: <8faaa5db-7099-b4d5-fae2-97b1eb28b90c@gmx.at> 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:251550 Archived-At: Hi Martin, Sorry I only got around to doing this now. This seems to still be a problem in emacs-29, however. On 17/12/2021 21:17, martin rudalics wrote: > > When I evaluate > > > >    (set-face-attribute 'default nil :height 110 :family > "InconsolataLGC") > > > > (this variation of the font doesn't have the original problem), the > height of the window shrinks, unless the window is maximized. > > When a frame is maximized, no implied resizing is done.  With > > (push 'font frame-inhibit-implied-resize) > > a non-maximized frame should also keep its size in your case. > > > If I evaluate it multiple times, the height shrinks every time I do > > that > > This might be a rounding error or some misunderstanding wrt what the WM > (mutter in your case?) thinks our frame size is and what Emacs thinks. > In x_new_font (in xterm.c) we do Not sure if it's Mutter these days, but it's definitely GNOME Shell. GNOME 43.1 now (I filed this issue with a much older GNOME). >   FRAME_COLUMN_WIDTH (f) = font->average_width; >   ... >   FRAME_LINE_HEIGHT (f) = font_ascent + font_descent; >   ... >       adjust_frame_size >       (f, FRAME_COLS (f) * FRAME_COLUMN_WIDTH (f), >        FRAME_LINES (f) * FRAME_LINE_HEIGHT (f), 3, false, Qfont); > > which should have the effect that (frame-height) and (frame-width) > remain unaltered when changing the default font.  Apparently, this fails > in your case. > > > (stopping at height 5, when even the minibuffer becomes > > inaccessible > > This is a separate issue I fixed here some time ago.  But I don't > remember whether I pushed it and/or whether it requires additional > customizations to make it DTRT (it might depend on the ability to drop > window decorations one by one when a frame is shrunk). I've tried stepping through the function, and the height does shrink when I evaluate the previously mentioned form. Not sure which of the values are useful to you, which ones I should have printed along the way. But see the debug log at the bottom. All this with 'emacs -Q'. It might be because of a rounding error, but maybe not. The bug happens with most window heights, but not with all. E.g., it stayed stable at (frame-height) = 36. Set it to a larger value - and it goes on shrinking until 36. Set it to a lower value (35 or less), and it does on to shrink until 10 in small steps. Here's the debugging log. This is just one iteration. Thread 1 "emacs" hit Breakpoint 3, x_new_font (f=0x55555628e5e0, font_object=XIL(0x555556287395), fontset=28) at xterm.c:26174 26174 FRAME_COLUMN_WIDTH (f) = font->average_width; (gdb) p font->text_height There is no member named text_height. (gdb) p f->text_height $7 = 1116 (gdb) xint $8 = 279 (gdb) n 26175 get_font_ascent_descent (font, &font_ascent, &font_descent); (gdb) n 26176 FRAME_LINE_HEIGHT (f) = font_ascent + font_descent; (gdb) n 26179 FRAME_MENU_BAR_HEIGHT (f) = FRAME_MENU_BAR_LINES (f) * FRAME_LINE_HEIGHT (f); (gdb) c Continuing. Thread 1 "emacs" hit Breakpoint 3, x_new_font (f=0x55555628e5e0, font_object=XIL(0x5555562d9865), fontset=28) at xterm.c:26174 26174 FRAME_COLUMN_WIDTH (f) = font->average_width; (gdb) c Continuing. Thread 1 "emacs" hit Breakpoint 3, x_new_font (f=0x55555628e5e0, font_object=XIL(0x555556287395), fontset=28) at xterm.c:26174 26174 FRAME_COLUMN_WIDTH (f) = font->average_width; (gdb) n 26175 get_font_ascent_descent (font, &font_ascent, &font_descent); (gdb) n 26176 FRAME_LINE_HEIGHT (f) = font_ascent + font_descent; (gdb) n 26179 FRAME_MENU_BAR_HEIGHT (f) = FRAME_MENU_BAR_LINES (f) * FRAME_LINE_HEIGHT (f); (gdb) n 26182 FRAME_TAB_BAR_HEIGHT (f) = FRAME_TAB_BAR_LINES (f) * FRAME_LINE_HEIGHT (f); (gdb) n 26188 unit = FRAME_COLUMN_WIDTH (f); (gdb) n 26189 if (FRAME_CONFIG_SCROLL_BAR_WIDTH (f) > 0) (gdb) n 26190 FRAME_CONFIG_SCROLL_BAR_COLS (f) (gdb) n 26199 if (FRAME_X_WINDOW (f) != 0 && !FRAME_TOOLTIP_P (f)) (gdb) p f->text_height $9 = 1044 (gdb) xint $10 = 261 (gdb) n 26200 adjust_frame_size (gdb) n 26205 if (FRAME_XIC (f) (gdb) p f->text_height $11 = 1008 (gdb) xint $12 = 252 (gdb) c Continuing.