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: Sun, 10 Jan 2021 11:31:44 -0600 Message-ID: References: <01d09a7b-09b0-9221-5bf3-8454f94704f7@gmx.at> <83k0smgeq8.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="28549"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 45748@debbugs.gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jan 10 18:33:17 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 1kyeaa-0007Kx-N2 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 10 Jan 2021 18:33:16 +0100 Original-Received: from localhost ([::1]:51106 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kyeaZ-0004O7-PY for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 10 Jan 2021 12:33:15 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40774) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kyeaM-0004Ny-Qe for bug-gnu-emacs@gnu.org; Sun, 10 Jan 2021 12:33:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:43289) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kyeaM-00063H-Ji for bug-gnu-emacs@gnu.org; Sun, 10 Jan 2021 12:33:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kyeaM-0007P5-Ev for bug-gnu-emacs@gnu.org; Sun, 10 Jan 2021 12:33: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: Sun, 10 Jan 2021 17:33: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.161029993728375 (code B ref 45748); Sun, 10 Jan 2021 17:33:02 +0000 Original-Received: (at 45748) by debbugs.gnu.org; 10 Jan 2021 17:32:17 +0000 Original-Received: from localhost ([127.0.0.1]:54835 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kyeZO-0007N1-BG for submit@debbugs.gnu.org; Sun, 10 Jan 2021 12:32:17 -0500 Original-Received: from mail-yb1-f170.google.com ([209.85.219.170]:37454) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kyeZM-0007Mb-Md for 45748@debbugs.gnu.org; Sun, 10 Jan 2021 12:32:01 -0500 Original-Received: by mail-yb1-f170.google.com with SMTP id d37so14682045ybi.4 for <45748@debbugs.gnu.org>; Sun, 10 Jan 2021 09:32:00 -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=XTLT/2PcgWZOxAdj7r8gNuCzOUM3okXc6/Beuj+EDLo=; b=lkaj0Xtjfkiq6VFI64BHnbxGYm/HMx7IYTLrsZYOutoC/b3W191zpeLOKh3sTHzJOX 900Ijh/bAgX6zDg3ZubMWQyGgroNHRJMZP6yD8JnYDTuPNgjo1F6LjlKDAzelRD9jtJ1 idI82AdD4llDc3Q1X//RCZj/2o0A8S60DCHj6sB3FGf7WmUmUKEk6Yp62FJw5WceC0VN /BP5JxyZp03fFLRgkGhq6DoVCnOpkUWL8/Ny07qVDc4A+WGn7nu78a1Ce8vix45iRuTv xSEeN7jVzqmVP4TxwQ2+Ssog3gCNP4oHVNU2y8Lz/IwpPmrxbdWpm0SdLBkfl+a+MbRL Kz8Q== 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=XTLT/2PcgWZOxAdj7r8gNuCzOUM3okXc6/Beuj+EDLo=; b=VVG7lwHcXZjlmzRiR+dYv8WFWshbgLG+nZUgHexDyxpQ0yqqmWraIM1y9GSH+OpilY Oumd0jTe9ZC1XA+nTt1mL8Top2Et5oiCyWjrHdU21tc3c/PkG4lmYGHAUsFQcsph+wAr KZEz1fo641EtOUtMQVJ3CksUqbB6Tbjm84VF0riPjCNX//5cusIQi+UaLe8/c5TcCSzs ClXLPPIKZ+TtPBR7/4tod7AwomsY+7MZpa7srYeOkq9PgXJYJHAsCfauC1gy3HlW677Z 7yHVkcWGXX7zsJFNmXlR+lf1eTC3vgorIdZaefQUnZwx8lvGCv8D4/PtihuhnJl7u2MC BLxA== X-Gm-Message-State: AOAM532RlA9e0wvbKKGWk6845+WyoRSPMq5vPQgeHuZ/msEbgHJjMcJj aXjcSDDQcPeoo16wkrL2ockPaA3TBB8jmjbBUhY= X-Google-Smtp-Source: ABdhPJxjIU7xYm+CFo/Q2Xe+alOUNXJcuoH+01tK9+hyC1xVjI5rpR308EKXRINkWvKw0SK8VToWulcxZ6XIg4HGyyI= X-Received: by 2002:a25:9c07:: with SMTP id c7mr19425427ybo.21.1610299915170; Sun, 10 Jan 2021 09:31:55 -0800 (PST) In-Reply-To: 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:197649 Archived-At: On Sun, Jan 10, 2021 at 10:05 AM martin rudalics wrote: > > > Let me know how this looks and if you want me to make any tweaks. > > dec_both (&end, &bpos); > c = FETCH_BYTE (bpos); > if (!(c == ' ' || c == '\t' || c == '\n' || c == '\r')) > > Sorry but on that last line I have > > if (!(c == ' ' || c == '\t')) > > or am I confused? Not sure I follow, does the patch not apply? Here is what I have after my patch for the handling of the TO == t: end = ZV; bpos = ZV_BYTE; while (bpos > BEGV_BYTE) { dec_both (&end, &bpos); c = FETCH_BYTE (bpos); if (!(c == ' ' || c == '\t' || c == '\n' || c == '\r')) { inc_both (&end, &bpos); break; } } while (bpos < ZV_BYTE) { c = fetch_char_advance (&end, &bpos); if (!(c == ' ' || c == '\t')) break; } and before: end = ZV; bpos = ZV_BYTE; while (bpos > BEGV_BYTE) { dec_both (&end, &bpos); c = FETCH_BYTE (bpos); if (!(c == ' ' || c == '\t' || c == '\n' || c == '\r')) break; } while (bpos < ZV_BYTE) { c = fetch_char_advance (&end, &bpos); if (!(c == ' ' || c == '\t')) break; } The difference is the inc_both before the break in the *first* loop, not the second.