From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.bugs Subject: bug#19972: Font size change doesn't update (window-total-width) Date: Mon, 02 Mar 2015 18:10:35 +0100 Message-ID: <54F4998B.40507@gmx.at> References: <874mq5o3di.fsf@fastmail.fm> <2B9A60CD-AAAA-40E8-B116-8A75A78B0DDC@sanityinc.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1425316281 3779 80.91.229.3 (2 Mar 2015 17:11:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 2 Mar 2015 17:11:21 +0000 (UTC) To: Steve Purcell , 19972@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Mar 02 18:11:12 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YSTs7-0007gp-C6 for geb-bug-gnu-emacs@m.gmane.org; Mon, 02 Mar 2015 18:11:11 +0100 Original-Received: from localhost ([::1]:58356 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YSTs6-0005Ur-OQ for geb-bug-gnu-emacs@m.gmane.org; Mon, 02 Mar 2015 12:11:10 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51407) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YSTs1-0005Pd-Il for bug-gnu-emacs@gnu.org; Mon, 02 Mar 2015 12:11:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YSTry-0004ZH-Cs for bug-gnu-emacs@gnu.org; Mon, 02 Mar 2015 12:11:05 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:34454) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YSTry-0004Z3-9V for bug-gnu-emacs@gnu.org; Mon, 02 Mar 2015 12:11:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YSTry-0002Lc-43 for bug-gnu-emacs@gnu.org; Mon, 02 Mar 2015 12:11:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 02 Mar 2015 17:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19972 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 19972-submit@debbugs.gnu.org id=B19972.14253162469003 (code B ref 19972); Mon, 02 Mar 2015 17:11:02 +0000 Original-Received: (at 19972) by debbugs.gnu.org; 2 Mar 2015 17:10:46 +0000 Original-Received: from localhost ([127.0.0.1]:33022 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YSTrh-0002L8-Nu for submit@debbugs.gnu.org; Mon, 02 Mar 2015 12:10:46 -0500 Original-Received: from mout.gmx.net ([212.227.15.15]:63828) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YSTrf-0002Ku-8G for 19972@debbugs.gnu.org; Mon, 02 Mar 2015 12:10:43 -0500 Original-Received: from [188.23.120.185] ([188.23.120.185]) by mail.gmx.com (mrgmx002) with ESMTPSA (Nemesis) id 0MRWzQ-1Y4NRV2T8K-00Scc1; Mon, 02 Mar 2015 18:10:37 +0100 In-Reply-To: <2B9A60CD-AAAA-40E8-B116-8A75A78B0DDC@sanityinc.com> X-Provags-ID: V03:K0:PT7zV6AQFtP7pL5TSqqlFzqqDawYQ8CoNMJKPF91DH/EcL03wkc oYsfkLGyEdIceArCkuwCfUDJcHXkVBYfrQoY0D0vycRPS1Oo6SJCzMG51zLWxKES1ovBtPt cC5imu6Kk1sXfbsvmx5a7h/RU4WPukmIu6+sbduepzcXnLLFTUK9gPKt8xCdhIfDKyQp8ta ersx8ue4wni5hLFVDY7gw== X-UI-Out-Filterresults: notjunk:1; X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 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.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:99971 Archived-At: > - Consider the case of full-screen frames, which never change in pixel= > size. The window-width should change when the font size changes in > this case too. This is the case (hopefully) with Emacs 25 but not with Emacs 24.5. Although some window managers may refuse to change the frame size even with Emacs 24.5 as we've learned here. > - set-frame-font is a built-in function with a KEEP-SIZE param which > tells it to try to preserve the pixel-size of the frame after the > font has changed: my code is copied from there. If you look at the implementation of this you will see that it first resizes the frame (via x_new_font) and then tries to size it back to the original size. This will fail miserably when the frame was maximized before (because maximization is a state and not just a specific size) and will fail when the frame size was not an integral multiple of its default character size (because `set-frame-font' does some strange rounding). So never ever use `set-frame-font' with KEEP-SIZE non-nil. With Emacs 25 you can do, for example, (let ((frame-inhibit-implied-resize t)) (custom-push-theme 'theme-face 'default 'user 'set '((t (:height 128))= )) (face-spec-recalc 'default (selected-frame))) unless you have set `frame-inhibit-implied-resize' to non-nil already. Which currently causes `window-total-width' to return a wrong value ;-) > So there really shouldn=E2=80=99t be any assumption that the frame siz= e will > necessarily change when the font changes. Emacas <=3D 24.5 at least _always_ tries to change it. martin