From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#62419: 28.2; Elisp let-bound buffer-local variable and kill-local-variable Date: Sun, 26 Mar 2023 10:34:05 -0400 Message-ID: References: <19A857D6-D071-44DE-AF89-539A563FD782@gmail.com> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10000"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 62419@debbugs.gnu.org To: Matthew Malcomson Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Mar 26 16:35:25 2023 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 1pgRSv-0002Jr-F9 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 26 Mar 2023 16:35:25 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pgRSf-0002F7-5q; Sun, 26 Mar 2023 10:35:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pgRSc-0002Ex-7E for bug-gnu-emacs@gnu.org; Sun, 26 Mar 2023 10:35:06 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pgRSY-0001Re-MT for bug-gnu-emacs@gnu.org; Sun, 26 Mar 2023 10:35:05 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pgRSY-0005H3-5n for bug-gnu-emacs@gnu.org; Sun, 26 Mar 2023 10:35:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 26 Mar 2023 14:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62419 X-GNU-PR-Package: emacs Original-Received: via spool by 62419-submit@debbugs.gnu.org id=B62419.167984125720213 (code B ref 62419); Sun, 26 Mar 2023 14:35:02 +0000 Original-Received: (at 62419) by debbugs.gnu.org; 26 Mar 2023 14:34:17 +0000 Original-Received: from localhost ([127.0.0.1]:45660 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pgRRp-0005Fx-AY for submit@debbugs.gnu.org; Sun, 26 Mar 2023 10:34:17 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:1095) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pgRRn-0005Fj-3D for 62419@debbugs.gnu.org; Sun, 26 Mar 2023 10:34:15 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 78E67440BB1; Sun, 26 Mar 2023 10:34:08 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 0E44C440B52; Sun, 26 Mar 2023 10:34:07 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1679841247; bh=xKwTolfeTvrZT2pPLgy5S0jzIKz/90oGmST+ETMw2gU=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=Bvq9Z6hpBHfveFaldtglNLGxsZijPiDjN+PGFKXdcmZEfYdgWaQz0vbAEXFiPciZM FKlcyQSY7msc1Wadl1BFfecmMVBgJbt3PyRTEak48w0s2lgjl6F6/F7j77Et8rsfvt wWIQyDxPksdME9s3uq0Yxa9lhY8LkHdSic37kvDpj2ICVRg6O6drKhzB73XtFdzBUL IS/qi2pQYJjsGDCl7RyNXwRHUDhQwjcITS4JnouD2+4huzCilXcTkl8zUJg+30gvMN MBSfyDG6MMZPnuiyWE1XsvSJSmUbByK0+nE/nJVGCLDzEOGLZOZTt3XA3v26KH/pOu 8SCzjCyQICBMA== Original-Received: from pastel (unknown [216.154.34.24]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id E06A712331D; Sun, 26 Mar 2023 10:34:06 -0400 (EDT) In-Reply-To: (Stefan Monnier's message of "Sun, 26 Mar 2023 10:01:48 -0400") 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:258686 Archived-At: > The "`newline` let-binds `auto-fill-mode`" seems like the source of the > problem :-( We could fix it with a patch like the one below (intended for `master`). Stefan diff --git a/lisp/simple.el b/lisp/simple.el index 3e50e888dad..6f0215bfb1d 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -659,7 +659,7 @@ newline (beforepos (point)) (last-command-event ?\n) ;; Don't auto-fill if we have a prefix argument. - (auto-fill-function (if arg nil auto-fill-function)) + (inhibit-auto-fill (or inhibit-auto-fill arg)) (arg (prefix-numeric-value arg)) (procsym (make-symbol "newline-postproc")) ;(bug#46326) (postproc @@ -9269,11 +9269,15 @@ default-indent-new-line ;; If we're not inside a comment, just try to indent. (t (indent-according-to-mode)))))) +(defvar inhibit-auto-fill nil + "Non-nil means to do as if `auto-fill-mode' was disabled.") + (defun internal-auto-fill () "The function called by `self-insert-command' to perform auto-filling." - (when (or (not comment-start) - (not comment-auto-fill-only-comments) - (nth 4 (syntax-ppss))) + (when (and (not inhibit-auto-fill) + (or (not comment-start) + (not comment-auto-fill-only-comments) + (nth 4 (syntax-ppss)))) (funcall auto-fill-function))) (defvar normal-auto-fill-function #'do-auto-fill