From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#22847: #17062: 24.3 current-fill-column breaks fill-match-adaptive-prefix Date: Wed, 12 May 2021 15:25:51 +0200 Message-ID: <871rackrs0.fsf@gnus.org> References: <56D3F443.9000706@easy-emacs.de> <83si0b8q7t.fsf@gnu.org> <7dvauuyruh.fsf@fencepost.gnu.org> <831sxhikxu.fsf@gnu.org> <875yzqstc6.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1650"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 22847@debbugs.gnu.org, Glenn Morris To: Stefan Kangas Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed May 12 15:27: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 1lgotL-0000Gr-BB for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 12 May 2021 15:27:11 +0200 Original-Received: from localhost ([::1]:52376 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lgotJ-00053g-N4 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 12 May 2021 09:27:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48008) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lgotC-00053D-P0 for bug-gnu-emacs@gnu.org; Wed, 12 May 2021 09:27:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:55137) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lgotC-0007CY-I4 for bug-gnu-emacs@gnu.org; Wed, 12 May 2021 09:27:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lgotC-0005ks-EZ for bug-gnu-emacs@gnu.org; Wed, 12 May 2021 09:27:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 12 May 2021 13:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22847 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 22847-submit@debbugs.gnu.org id=B22847.162082596722010 (code B ref 22847); Wed, 12 May 2021 13:27:02 +0000 Original-Received: (at 22847) by debbugs.gnu.org; 12 May 2021 13:26:07 +0000 Original-Received: from localhost ([127.0.0.1]:38446 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lgosI-0005iu-Cx for submit@debbugs.gnu.org; Wed, 12 May 2021 09:26:06 -0400 Original-Received: from quimby.gnus.org ([95.216.78.240]:58220) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lgosD-0005iP-Rh for 22847@debbugs.gnu.org; Wed, 12 May 2021 09:26:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=x3S1s3NSQXYBxzfrtVXleNKNt8hpjzKxsQonOR3FKk0=; b=ocs7bbQDVMDMyNQhvgfq52e6G3 skW1UC3lk8v0tx+/Vu7NGWuGr22TM9zR19oj5Y5WyJB2FvVUMV2URP+8122XRzVIOVsMdMVqcA+F4 XECzRlKTLS/8s7Aww4tk4q6/dOrfUIefS9NUd6PArx1LPSYCmDYVFqi6slZVKEGmRGN0=; Original-Received: from cm-84.212.220.105.getinternet.no ([84.212.220.105] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lgos4-0004oY-7T; Wed, 12 May 2021 15:25:55 +0200 X-Now-Playing: Neil Young's _Archives Vol. II (1): Everybody's Alone (1972 - 1976)_: "Sweet Joni" In-Reply-To: (Stefan Kangas's message of "Mon, 10 May 2021 08:29:49 -0500") 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:206319 Archived-At: Stefan Kangas writes: > There might be a subtle problem with it after all but I can't remember > the details now. > > This code is a little bit more tricky than what first meets the eye, I > think. So I would suggest someone takes a closer look before > installing. I've given the patch a try, and it seems to work as advertised. Does anybody else have a comment? I've respun the patch against the current tree and done some minor edits: diff --git a/etc/NEWS b/etc/NEWS index de3779cd73..3069b4d498 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -108,6 +108,16 @@ avoid security issues when executing untrusted code. See the manual page for 'seccomp' system call, for details about Secure Computing filters. +** Setting 'fill-column' to nil is obsolete. +This undocumented use of 'fill-column' is now obsolete. If you have +set this value to nil disable auto filling, instead disable +'auto-fill-mode' in the relevant mode instead. + +For instance, you could add something like the following to your init +file: + + (add-hook 'foo-mode-hook (lambda () (auto-fill-mode -1)) + * Changes in Emacs 28.1 diff --git a/lisp/simple.el b/lisp/simple.el index b4e34f1e4c..d21daf9e19 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -7931,7 +7931,7 @@ do-auto-fill (let (fc justify give-up (fill-prefix fill-prefix)) (if (or (not (setq justify (current-justification))) - (null (setq fc (current-fill-column))) + (setq fc (current-fill-column)) (and (eq justify 'left) (<= (current-column) fc)) (and auto-fill-inhibit-regexp diff --git a/lisp/textmodes/fill.el b/lisp/textmodes/fill.el index 3914bdeb83..f394171fb6 100644 --- a/lisp/textmodes/fill.el +++ b/lisp/textmodes/fill.el @@ -133,6 +133,8 @@ adaptive-fill-function (defvar fill-indent-according-to-mode nil ;Screws up CC-mode's filling tricks. "Whether or not filling should try to use the major mode's indentation.") +(defvar current-fill-column--has-warned nil) + (defun current-fill-column () "Return the fill-column to use for this line. The fill-column to use for a buffer is stored in the variable `fill-column', @@ -158,7 +160,14 @@ current-fill-column (< col fill-col))) (setq here change here-col col)) - (max here-col fill-col))))) + (max here-col fill-col)) + ;; This warning was added in 28.1. It should be removed later, + ;; and this function changed to never return nil. + (unless current-fill-column--has-warned + (lwarn '(fill-column) :warning + "Setting this variable to nil is obsolete; use `(auto-fill-mode -1)' instead") + (setq current-fill-column--has-warned t)) + most-positive-fixnum))) (defun canonically-space-region (beg end) "Remove extra spaces between words in region. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no