From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#9860: 24.0.90; no auto-fill in c-mode when line begins with # Date: Sun, 15 Oct 2023 11:11:17 +0000 Message-ID: References: <871uu2b2x7.fsf@micropit.couberia.bzh> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1862"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 9860-done@debbugs.gnu.org, Stefan Kangas , acm@muc.de To: Peter =?UTF-8?Q?M=C3=BCnster?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Oct 15 13:11:59 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 1qrz2M-0000Ft-S3 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 15 Oct 2023 13:11:58 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qrz26-0006Bb-3O; Sun, 15 Oct 2023 07:11:42 -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 1qrz23-0006BL-87 for bug-gnu-emacs@gnu.org; Sun, 15 Oct 2023 07:11:39 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qrz22-00016V-NW; Sun, 15 Oct 2023 07:11:38 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qrz2Q-0007km-Mu; Sun, 15 Oct 2023 07:12:02 -0400 Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-To: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Sun, 15 Oct 2023 11:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 9860 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: confirmed Mail-Followup-To: 9860@debbugs.gnu.org, acm@muc.de, pmlists@free.fr Original-Received: via spool by 9860-done@debbugs.gnu.org id=D9860.169736831629788 (code D ref 9860); Sun, 15 Oct 2023 11:12:02 +0000 Original-Received: (at 9860-done) by debbugs.gnu.org; 15 Oct 2023 11:11:56 +0000 Original-Received: from localhost ([127.0.0.1]:51344 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qrz2K-0007kO-0X for submit@debbugs.gnu.org; Sun, 15 Oct 2023 07:11:56 -0400 Original-Received: from mail.muc.de ([193.149.48.3]:22058) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qrz2F-0007k4-0L for 9860-done@debbugs.gnu.org; Sun, 15 Oct 2023 07:11:55 -0400 Original-Received: (qmail 54780 invoked by uid 3782); 15 Oct 2023 13:11:19 +0200 Original-Received: from acm.muc.de (pd953a6c1.dip0.t-ipconnect.de [217.83.166.193]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Sun, 15 Oct 2023 13:11:18 +0200 Original-Received: (qmail 6865 invoked by uid 1000); 15 Oct 2023 11:11:17 -0000 Content-Disposition: inline In-Reply-To: <871uu2b2x7.fsf@micropit.couberia.bzh> X-Submission-Agent: TMDA/1.3.x (Ph3nix) X-Primary-Address: acm@muc.de 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:272502 Archived-At: Hello, Peter. Thank you for taking the trouble to submit this bug report all these years ago, and sorry it's taken so long to attend to it. The problem was a simple coding error, checking for a macro before checking whether or not we were in a comment. Your line of "#bla bla ...." was thus handled as a macro, and by the default setting of `c-ignore-auto-file' didn't get filled. I have now fixed this in the Emacs master branch, which will be getting released as Emacs-30.1 maybe in a year's time. I'm closing the bug with this post. If you would like to try out the fix yourself, here is the patch, which needs to be applied in directory lisp/progmodes in the Emacs source tree. diff -r 0e6ebd732cbe cc-cmds.el --- a/cc-cmds.el Sat Oct 14 18:56:50 2023 +0000 +++ b/cc-cmds.el Sun Oct 15 10:41:42 2023 +0000 @@ -4887,7 +4887,8 @@ (setq c-lit-limits (c-literal-limits nil nil t))) (unless c-lit-type (setq c-lit-type (c-literal-type c-lit-limits))) - (if (memq (cond ((c-query-and-set-macro-start) 'cpp) + (if (memq (cond ((memq c-lit-type '(c c++ string)) c-lit-type) + ((c-query-and-set-macro-start) 'cpp) ((null c-lit-type) 'code) (t c-lit-type)) c-ignore-auto-fill) On Mon, Oct 24, 2011 at 21:33:08 +0200, Peter Münster wrote: > Hello, > With latest bzr-emacs: > - emacs -Q > - open "foo.c" > - turn on auto-fill (M-x auto-fill-mode) > - write the following comment: > --8<---------------cut here---------------start------------->8--- > /* > #bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla > --8<---------------cut here---------------end--------------->8--- > - result: auto-fill does not work here > In GNU Emacs 24.0.90.2 (x86_64-suse-linux-gnu, GTK+ Version 2.22.1) > of 2011-10-23 on micropit > Windowing system distributor `The X.Org Foundation', version 11.0.10903000 > configured using `configure '--without-toolkit-scroll-bars'' > Important settings: > value of $LC_ALL: nil > value of $LC_COLLATE: nil > value of $LC_CTYPE: en_GB.utf8 > value of $LC_MESSAGES: nil > value of $LC_MONETARY: nil > value of $LC_NUMERIC: nil > value of $LC_TIME: nil > value of $LANG: nil > value of $XMODIFIERS: @im=local > locale-coding-system: utf-8-unix > default enable-multibyte-characters: t > -- > Peter -- Alan Mackenzie (Nuremberg, Germany).