GNU bug report logs - #22847
#17062: 24.3 current-fill-column breaks fill-match-adaptive-prefix

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Severity: minor; Reported by: Andreas Röhler <andreas.roehler@HIDDEN>; merged with #17062; dated Mon, 29 Feb 2016 07:33:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
Removed tag(s) moreinfo. Request was from Glenn Morris <rgm@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 22847 <at> debbugs.gnu.org:


Received: (at 22847) by debbugs.gnu.org; 8 Dec 2016 22:32:46 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Dec 08 17:32:46 2016
Received: from localhost ([127.0.0.1]:34955 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1cF7F8-0005PB-1F
	for submit <at> debbugs.gnu.org; Thu, 08 Dec 2016 17:32:46 -0500
Received: from eggs.gnu.org ([208.118.235.92]:36637)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rgm@HIDDEN>) id 1cF7F7-0005Ox-2z
 for 22847 <at> debbugs.gnu.org; Thu, 08 Dec 2016 17:32:45 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <rgm@HIDDEN>) id 1cF7F1-0003SA-5u
 for 22847 <at> debbugs.gnu.org; Thu, 08 Dec 2016 17:32:39 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:47153)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <rgm@HIDDEN>)
 id 1cF7F1-0003S6-3D
 for 22847 <at> debbugs.gnu.org; Thu, 08 Dec 2016 17:32:39 -0500
Received: from rgm by fencepost.gnu.org with local (Exim 4.82)
 (envelope-from <rgm@HIDDEN>)
 id 1cF7F0-00065S-I4; Thu, 08 Dec 2016 17:32:38 -0500
From: Glenn Morris <rgm@HIDDEN>
To: 22847 <at> debbugs.gnu.org
Subject: Re: bug#22847: #17062: 24.3 current-fill-column breaks
 fill-match-adaptive-prefix
References: <56D3F443.9000706@HIDDEN> <83si0b8q7t.fsf@HIDDEN>
X-Spook: PET Drug Administration Consular Recovery Albanian
X-Ran: :x5#/GD-TdQd,<Y_BPt{d@5]<B]Pc6]r;-~@Q;TNv\sv<=4!@#SkH+jEKtvwmv>hpLHb48
X-Hue: yellow
X-Attribution: GM
Date: Thu, 08 Dec 2016 17:32:38 -0500
In-Reply-To: <83si0b8q7t.fsf@HIDDEN> (Eli Zaretskii's message of "Mon, 29 Feb
 2016 17:56:54 +0200")
Message-ID: <7dvauuyruh.fsf@HIDDEN>
User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/)
MIME-Version: 1.0
Content-Type: text/plain
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -8.0 (--------)
X-Debbugs-Envelope-To: 22847
Cc: Eli Zaretskii <eliz@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -8.0 (--------)


So this seems like a mess.

fill-column is documented to be an integer, and that is its custom-type.
Nowhere does it say it can be nil, AFAICS.
Many places in Emacs are not prepared for it (or current-fill-column) to
be nil.

Yet 1e87252 explicitly added a check for a nil fill-column to
current-fill-column. AFAICS, do-auto-fill is the only place in Emacs
that tests for this, and uses it to disable auto-fill.

The only uses I find for "(setq fill-column nil)" are a few people using
it in their .emacs to disable auto-fill (I guess) in some major mode.
The idiomatic way to do this is just to turn off auto-fill in that mode.

TLDR:
Let's remove the test for nil fill-column in current-fill-column.





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#22847; Package emacs. Full text available.

Message received at 22847 <at> debbugs.gnu.org:


Received: (at 22847) by debbugs.gnu.org; 29 Feb 2016 15:57:18 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Feb 29 10:57:18 2016
Received: from localhost ([127.0.0.1]:53863 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1aaQCE-0005uq-3w
	for submit <at> debbugs.gnu.org; Mon, 29 Feb 2016 10:57:18 -0500
Received: from eggs.gnu.org ([208.118.235.92]:45820)
 by debbugs.gnu.org with esmtp (Exim 4.84)
 (envelope-from <eliz@HIDDEN>) id 1aaQCC-0005ue-CE
 for 22847 <at> debbugs.gnu.org; Mon, 29 Feb 2016 10:57:16 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1aaQC3-0003VZ-EK
 for 22847 <at> debbugs.gnu.org; Mon, 29 Feb 2016 10:57:11 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:60975)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1aaQC3-0003VV-B2; Mon, 29 Feb 2016 10:57:07 -0500
Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4729
 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1aaQC2-0007FI-Ho; Mon, 29 Feb 2016 10:57:07 -0500
Date: Mon, 29 Feb 2016 17:56:54 +0200
Message-Id: <83si0b8q7t.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Andreas =?utf-8?Q?R=C3=B6hler?= <andreas.roehler@HIDDEN>
In-reply-to: <56D3F443.9000706@HIDDEN> (message from Andreas
 =?utf-8?Q?R=C3=B6hler?= on Mon, 29 Feb 2016 08:33:23 +0100)
Subject: Re: bug#22847: #17062: 24.3 current-fill-column breaks
 fill-match-adaptive-prefix
References: <56D3F443.9000706@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 22847
Cc: 22847 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: Eli Zaretskii <eliz@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

> From: Andreas Röhler <andreas.roehler@HIDDEN>
> Date: Mon, 29 Feb 2016 08:33:23 +0100
> 
> fill-match-adaptive-prefix counts on current-fill-column having:
> 
> (>= (+ (current-left-margin) (length str)) (current-fill-column))
> 
> This will be broken if current-fill-column returns nil.
> 
> Returning nil is possible, see inside current-fill-column:
> 
> (if fill-column
> 
> If fill-column is nil, current-fill-column will return nil which was the case coming upon.
> A fix might make sure an integer is returned anyway: think at 0 or default value.

While at that, please also fix the calculation of string length: it
should use 'string-width', not 'length', IMO.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#22847; Package emacs. Full text available.
Forcibly Merged 17062 22847. Request was from Lars Ingebrigtsen <larsi@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 29 Feb 2016 07:32:36 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Feb 29 02:32:36 2016
Received: from localhost ([127.0.0.1]:51799 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1aaIJn-0002oo-VC
	for submit <at> debbugs.gnu.org; Mon, 29 Feb 2016 02:32:36 -0500
Received: from eggs.gnu.org ([208.118.235.92]:60161)
 by debbugs.gnu.org with esmtp (Exim 4.84)
 (envelope-from <andreas.roehler@HIDDEN>) id 1aaIJn-0002oY-E4
 for submit <at> debbugs.gnu.org; Mon, 29 Feb 2016 02:32:35 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <andreas.roehler@HIDDEN>) id 1aaIJh-0004Rh-13
 for submit <at> debbugs.gnu.org; Mon, 29 Feb 2016 02:32:29 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,HTML_MESSAGE
 autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:47707)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <andreas.roehler@HIDDEN>) id 1aaIJg-0004Rd-UO
 for submit <at> debbugs.gnu.org; Mon, 29 Feb 2016 02:32:28 -0500
Received: from eggs.gnu.org ([2001:4830:134:3::10]:51125)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <andreas.roehler@HIDDEN>) id 1aaIJf-00088p-Uc
 for bug-gnu-emacs@HIDDEN; Mon, 29 Feb 2016 02:32:28 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <andreas.roehler@HIDDEN>) id 1aaIJb-0004Pf-Pw
 for bug-gnu-emacs@HIDDEN; Mon, 29 Feb 2016 02:32:27 -0500
Received: from mout.kundenserver.de ([212.227.126.130]:59586)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <andreas.roehler@HIDDEN>) id 1aaIJb-0004PN-GN
 for bug-gnu-emacs@HIDDEN; Mon, 29 Feb 2016 02:32:23 -0500
Received: from [192.168.178.35] ([77.6.162.94]) by mrelayeu.kundenserver.de
 (mreue004) with ESMTPSA (Nemesis) id 0MSFaB-1aSmMQ3Cgd-00TYid for
 <bug-gnu-emacs@HIDDEN>; Mon, 29 Feb 2016 08:32:21 +0100
To: bug-gnu-emacs@HIDDEN
From: =?UTF-8?Q?Andreas_R=c3=b6hler?= <andreas.roehler@HIDDEN>
Subject: #17062: 24.3 current-fill-column breaks fill-match-adaptive-prefix
Message-ID: <56D3F443.9000706@HIDDEN>
Date: Mon, 29 Feb 2016 08:33:23 +0100
User-Agent: Mozilla/5.0 (X11; Linux i686; rv:38.0) Gecko/20100101
 Icedove/38.5.0
MIME-Version: 1.0
Content-Type: multipart/alternative;
 boundary="------------070403000008000605030402"
X-Provags-ID: V03:K0:EXFw9Kz67vAtB8dioJkHwY9tAyZEGslVnsVyiyHlRHKCbM04vAL
 ffAmNd4wX4qnKgvv5nl8JXuAbs8WW0cmZ42IAK164K/2aprv+JINkYGam8E1b+fhFHHSilT
 UMJAx5I1KTlJyh7BpO+YkBfsg5cNkFLQ94ugNmrWGH+umS0O0M5KKw6+0BVfx2EWfM2TH36
 VkKL1faO6HUqo5HTb4YTg==
X-UI-Out-Filterresults: notjunk:1;V01:K0:mhPl1pGuxOU=:8b1wAHBQHB6emPKmSv5nd7
 bNSWLARCVEOhZmyS+KBCTC/iZEAXtZmcR6EeTBEyIrvvxbeV1g8aagethZZLvkLRKpgFIi9rD
 LC1HlvOHa+8xjTmn7bXcytbIC2c+JfhsOVJ9QC/frpEQOht0BRcIV74O8bqMZh2WGBQqUp3G1
 4r1I3e9Olqk5hP9SRk2qJpxCWhnx/5x/+p5HmYHitLUdACRoQbD8r/qT3sz9EJ2PnIwE15/99
 rJvU+aMw8ZvxCe+7BkkgOVWkmMOyZj/8WR/6RpoufUj7hRk9Usr7AHvQqV29biqJC7uEH17iu
 ayFT1YyPUYYOvlhMDGpOppk69utwn5by4vl22jRjD+lOjtIqW0QMDVliUsPuJ/6rP8zMjuL69
 RXvTGnheUMNSXc27TNFkaH1coylnDD7KFlFUFlIDDiYjaFiPUkXJvJYvANTjtiXGVXkkNF9px
 r10ZuFUzOH2vEZmmq4Yp7KZYb8g2Tyihpsgs+s5qE88afj7NR19IkBXbVRme9UOb4GKdJp9Av
 yuJg78Vpno+cM63ar8BBSXPnNfzrpfwxzMeos3pZyihdbgfrAN+NYuTcc6rdaKg37KWldKiIS
 GhHo8O3LmZ4wQnhlwb+BEDIWYPjnnDE6GWyI/w7cI7Ab6xKPj2KrOHIlOmA8po9+lMANySOrU
 O6lFlqNAvPbQwsofUNZyXuxCnFzcF2hGy/scZkXkXs7tlcw4pZbZl5iT6XtbCQiLyCwEofO+J
 DQxDrFWi/WCgERuM
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

This is a multi-part message in MIME format.
--------------070403000008000605030402
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit

|reopen| #17062


Unfortunatly can't deliver a backtrace, as it was some times ago.

The bug is visible by program-logic already.

fill-match-adaptive-prefix counts on current-fill-column having:

(>= (+ (current-left-margin) (length str)) (current-fill-column))

This will be broken if current-fill-column returns nil.

Returning nil is possible, see inside current-fill-column:

     (if fill-column

If fill-column is nil, current-fill-column will return nil which was the 
case coming upon.
A fix might make sure an integer is returned anyway: think at 0 or 
default value.



--------------070403000008000605030402
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 8bit

<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=utf-8">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <code>reopen</code> #17062<br>
    <br>
    <br>
    Unfortunatly can't deliver a backtrace, as it was some times ago.<br>
    <br>
    The bug is visible by program-logic already.<br>
    <br>
    fill-match-adaptive-prefix counts on current-fill-column having:<br>
    <br>
    (&gt;= (+ (current-left-margin) (length str)) (current-fill-column))<br>
    <br>
    This will be broken if current-fill-column returns nil.<br>
    <br>
    Returning nil is possible, see inside current-fill-column:<br>
    <br>
        (if fill-column<br>
    <br>
    If fill-column is nil, current-fill-column will return nil which was
    the case coming upon.<br>
    A fix might make sure an integer is returned anyway: think at 0 or
    default value.<br>
    <br>
    <br>
    <var></var>
  </body>
</html>

--------------070403000008000605030402--




Acknowledgement sent to Andreas Röhler <andreas.roehler@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#22847; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Thu, 8 Dec 2016 22:45:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.