From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Aaron Jensen Newsgroups: gmane.emacs.bugs Subject: bug#45748: 28.0.50; fit-frame-to-buffer ignores leading spaces Date: Sat, 9 Jan 2021 11:49:34 -0600 Message-ID: References: <83r1mugg3w.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23809"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 45748@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jan 09 18:50:12 2021 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 1kyINQ-00066C-QB for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 09 Jan 2021 18:50:12 +0100 Original-Received: from localhost ([::1]:54552 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kyINP-0007R2-LX for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 09 Jan 2021 12:50:11 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45588) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kyINH-0007Qf-8N for bug-gnu-emacs@gnu.org; Sat, 09 Jan 2021 12:50:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:41034) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kyINH-0002V5-0a for bug-gnu-emacs@gnu.org; Sat, 09 Jan 2021 12:50:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kyING-0003fe-VN for bug-gnu-emacs@gnu.org; Sat, 09 Jan 2021 12:50:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Aaron Jensen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 09 Jan 2021 17:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45748 X-GNU-PR-Package: emacs Original-Received: via spool by 45748-submit@debbugs.gnu.org id=B45748.161021459414073 (code B ref 45748); Sat, 09 Jan 2021 17:50:02 +0000 Original-Received: (at 45748) by debbugs.gnu.org; 9 Jan 2021 17:49:54 +0000 Original-Received: from localhost ([127.0.0.1]:52576 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kyIN8-0003ev-Do for submit@debbugs.gnu.org; Sat, 09 Jan 2021 12:49:54 -0500 Original-Received: from mail-yb1-f177.google.com ([209.85.219.177]:42638) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kyIN4-0003ef-HA for 45748@debbugs.gnu.org; Sat, 09 Jan 2021 12:49:52 -0500 Original-Received: by mail-yb1-f177.google.com with SMTP id j17so12653474ybt.9 for <45748@debbugs.gnu.org>; Sat, 09 Jan 2021 09:49:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=6Bfmss+oub3M7r0Was5BVAIg2DwzqJYwijNp3PwUKVA=; b=gIfK8AYs9c/drUzhG8pkL5vbK9Hcmast+nGKdAGMndqpSKMohgcG6/aH/1ptSjG52C Mtpzo87tqSrOKpOnjeHtKDjr1DDk9jrDt+TJdu0NONOFk9dIWj3q5OvzRPvFofze/5iK Egr7rcKWoRo+z56+KYV+O6NNxm7NJb3xEcFutX2FF/mhyt9rmFgU5FUiDzLytwi4LOsv gpUPHUzer4da2AxQzggZ8Gmn5zjPOuLbrYNTaOoOnnoSFiA2uY698QgAR2AIsFItmn9R +6dooPjCa1mbGO9DWYgtUOGaZI8DfBG0dDMvCZvzxsIiWW7iDaBr5fXg8qjKgUf7aBcs qlNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=6Bfmss+oub3M7r0Was5BVAIg2DwzqJYwijNp3PwUKVA=; b=LQo+g28PAqkqIr+waSpiolgReHbOks8jYZEsOE1bstvHhg4XoT4Ftb//Jx3vP9jaFy 8k64A+4GqWn7ClSvnFQirVcM5CJbqXC6845pF2XVlnuO2U8MRsFyukU/H1OOtBBM16CG sruzFqHMbo3zPdeE9pgV0LFy2VS2UuFd3ZaTP+oYeN/a6gX0/EZ5tzr0L0oK0iTeRstS sG3lJviZflUOpjM62KeevvRBfae2zobn1vx7+Ww6HGJtyJ7r0KWZNhtWVTbMEknQUdLl 9gR4xqoa7NSwyApuJ61domUPhuxw86kdFyyT86+yhVaEdNNpcSsZzA83XlT1DIrrpnuO DwEw== X-Gm-Message-State: AOAM533M9dbhJZW4ZUtCPVPsSS5evcTk5CAYtkd079zKz5vzsqQI6Cwz 0/gTU4dOYbaIpNuxzNgEJMxH38+PbGByX56oXOBxcFZ3GCtZAg== X-Google-Smtp-Source: ABdhPJz7Vk5ZJ/msfLfHCsZSSqy2wXFQduGIYhkv8pEskOMlkiHAsrNNVNhhaqKNNuTvobsAULRn+THTnh4BPEMrefU= X-Received: by 2002:a25:324f:: with SMTP id y76mr14061028yby.203.1610214585100; Sat, 09 Jan 2021 09:49:45 -0800 (PST) In-Reply-To: <83r1mugg3w.fsf@gnu.org> 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" Xref: news.gmane.io gmane.emacs.bugs:197564 Archived-At: On Sat, Jan 9, 2021 at 11:44 AM Eli Zaretskii wrote: > > You mean with > > (window-text-pixel-size t t) > > right? Yes, sorry bad copy/paste. > ??? fit-frame-to-buffer always calls fit-frame-to-buffer-1, sow hat do > you mean by "unless"? I mean unless you call fit-frame-to-buffer-1 passing nil for from and to, which I believe is the most likely desired behavior for something like posframe, but I'm not the maintainer of that so I couldn't say for certain. > > The second loop looks like it's attempting to backtrack to the > > beginning of the line, but FETCH_BYTE (bpos) after a dec_both returns > > the same character that the first loop ended on. > > No, it doesn't, it returns the byte at bpos after decrementing bpos. > So it's the character before that. Maybe we're just getting hung up on my wording. After fetch_char_advance, bpos points to the byte of the character after what was returned from fetch_char_advance. If you then dec_both and FETCH_BYTE, you will get the same character returned from the last time fetch_char_advance was called, which was likely not the intent. > > In other words, start and bpos are not in sync > > ??? FETCH_BYTE doesn't change bpos, so if it was in sync with start > before FETCH_BYTE, it is still in sync after it. So I don't think I > understand what you mean here. > > Can you elaborate on your findings, please? Yeah, I was mistaken on that point. They stay in sync. They both needed to backtrack an extra time. See my patch in the email I sent right before this one.