From unknown Sat Jun 21 10:32:29 2025 X-Loop: bug-gnu-emacs@gnu.org Subject: bug#5649: 23.1.92; Indentation problems in C mode Resent-From: Michael Welsh Duggan Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 25 Feb 2010 16:18:02 +0000 Resent-Message-ID: Resent-Sender: bug-gnu-emacs@gnu.org X-Emacs-PR-Message: report 5649 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: To: 5649@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.126711462619562 (code B ref -1); Thu, 25 Feb 2010 16:18:02 +0000 Received: (at submit) by debbugs.gnu.org; 25 Feb 2010 16:17:06 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NkgOU-00055A-0N for submit@debbugs.gnu.org; Thu, 25 Feb 2010 11:17:06 -0500 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NkgJs-00051z-Oh for submit@debbugs.gnu.org; Thu, 25 Feb 2010 11:12:09 -0500 Received: from mail.gnu.org ([199.232.76.166]:43277 helo=mx10.gnu.org) by fencepost.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NkgJn-0004gG-Vr for submit@debbugs.gnu.org; Thu, 25 Feb 2010 11:12:04 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NkgJU-0004qe-4a for submit@debbugs.gnu.org; Thu, 25 Feb 2010 11:11:49 -0500 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on monty-python X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00, UNPARSEABLE_RELAY autolearn=ham version=3.1.0 Received: from lists.gnu.org ([199.232.76.165]:49621) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NkgJT-0004qa-So for submit@debbugs.gnu.org; Thu, 25 Feb 2010 11:11:44 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NkgJT-0002wd-A1 for bug-gnu-emacs@gnu.org; Thu, 25 Feb 2010 11:11:43 -0500 Received: from [140.186.70.92] (port=41849 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NkgJR-0002vE-Ru for bug-gnu-emacs@gnu.org; Thu, 25 Feb 2010 11:11:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NkgJP-0001cP-V3 for bug-gnu-emacs@gnu.org; Thu, 25 Feb 2010 11:11:41 -0500 Received: from upton.red.cert.org ([192.88.209.60]:53782) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NkgJP-0001c6-Mu for bug-gnu-emacs@gnu.org; Thu, 25 Feb 2010 11:11:39 -0500 Received: from bucknell.indigo.cert.org (bucknell.indigo.cert.org [10.60.10.121]) by upton.red.cert.org (8.13.8/8.13.8) with ESMTP id o1PGBbNO008339 for ; Thu, 25 Feb 2010 11:11:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cert.org; s=jthatj15xw2j; t=1267114298; bh=qiVk8eebQ2geTtKBx7y92ENC1MYqjssJMtyQt7OHpCI=; h=From:To:Subject:Reply-To:Date:Message-ID:MIME-Version: Content-Type:Sender:Cc:In-Reply-To:References; b=B/rP9bu84bxcaJghIFENYvPZXAApgrFV87S1wF45jSKRpwQOv2YgRk09pH4TPmK6R JmaW/oVXC1N4Qbi+pZMQR4ikFSRqVX6hTggE9Wr3qvBSTpafZHbaISJq1RRXCm3hev hoSSQ/1yieL0i7nK+JpB+C/Baqc2tptWQ1+mX6jE= Received: from maru.green.cert.org (maru.green.cert.org [10.21.10.16]) by bucknell.indigo.cert.org (8.13.8/8.13.8/2.77) with ESMTP id o1PGBbTZ019840 for ; Thu, 25 Feb 2010 11:11:37 -0500 Received: (from mwd@localhost) by maru.green.cert.org (8.13.8/8.13.8/Submit/1.6) id o1PGBbnN021844; Thu, 25 Feb 2010 11:11:37 -0500 X-Authentication-Warning: maru.green.cert.org: mwd set sender to mwd@cert.org using -f From: Michael Welsh Duggan Date: Thu, 25 Feb 2010 11:11:37 -0500 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.92 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Spam-Score: -6.0 (------) X-Mailman-Approved-At: Thu, 25 Feb 2010 11:16:53 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.0 (------) --=-=-= I'm getting some screwy indentation behavior from C mode. From a current bzr checkout/install of emacs, try the following recipe: emacs -Q foo.c | starts emacs on foo.c (included below) C-u 7 C-n | move down 7 lines TAB | indent, nothing changes (good) C-p C-p | move up 2 lines TAB C-n TAB C-n | indent 2 lines, nothing changes (good) TAB | line unindents by 2 (bad) TAB | line re-indents (good, but strange) TAB | no change this time And here's another recipe for weirdness: emacs -Q foo.c | starts emacs on foo.c (included below) C-x h | select buffer C-M-\ | indent region everything from line 7 | down to the while (0) unindents 2 C-u 5 C-n | move down to the do { C-x ( TAB C-n C-x ) | define a macro to indent and move down | a line C-x e e e e e e | Indent each line, no change Here's foo.c --=-=-= Content-Disposition: inline; filename=foo.c #if !SK_ENABLE_IPV6 # define skipaddrApplyCIDR(ipaddr, cidr) \ ipUnionApplyCIDRV4(&(ipaddr)->ip_ip, cidr) #else # define skipaddrApplyCIDR(ipaddr, cidr) \ do { \ if (skipaddrIsV6(ipaddr)) { \ ipUnionApplyCIDRV6(&((ipaddr)->ip_ip), cidr); \ } else { \ ipUnionApplyCIDRV4(&((ipaddr)->ip_ip), cidr); \ } \ } while (0) #endif --=-=-= In GNU Emacs 23.1.92.2 (i686-pc-linux-gnu, GTK+ Version 2.10.4) of 2010-02-19 on maru.green.cert.org Windowing system distributor `The X.Org Foundation', version 11.0.70101000 configured using `configure '--prefix=/home/mwd' '--without-toolkit-scroll-bars' '--with-gif=no'' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: en_US.UTF-8 value of $XMODIFIERS: @im=none locale-coding-system: utf-8-unix default enable-multibyte-characters: t Major mode: Group Minor modes in effect: gnus-undo-mode: t shell-dirtrack-mode: t display-time-mode: t diff-auto-refine-mode: t tooltip-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t Recent input: C-x h C-M-\ C-n C-n C-n C-n C-n C-n C-n C-n C-p C-o C-_ C-p C-n C-n C-n C-n C-b C-b } SPC C-p C-p C-p C-p C-p C-a C-p C-x h C-M-\ C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b \ C-p C-x h C-M-\ C-n C-n C-n C-n C-n C-n C-n C-n C-p C-n C-n C-n C-n C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-n C-a C-p C-a C-x h C-M-\ C-_ M-x r e p o r e t - e m r t - e m I n d e n t a t i o n SPC p r o b l e m s SPC i n SPC c c - m o d e M-x c c - b - b r e s u y M-p C-e C SPC m o d e C-x o C-x k y e s C-x 0 M-v M-v C-n C-p C-n C-n C-n C-n C-n C-n C-n C-n C-n C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-_ C-x k M-x r e p o r t - e m Recent messages: Checking 39 files in /home/mwd/share/emacs/23.1.92/lisp/obsolete... Checking 1 files in /home/mwd/share/emacs/23.1.92/leim... Checking for load-path shadows...done Making completion list... [4 times] Do you want to submit a report on CC Mode? (y or n) Formatting bug report buffer....... Please enter your report. Type C-c C-c to send, C-c C-k to abort. call-interactively: Beginning of buffer Auto-saving...done Undo! Load-path shadows: /afs/cert.org/usr/mwd/src/elisp/nnir hides /home/mwd/share/emacs/23.1.92/lisp/gnus/nnir Features: (reporter shadow emacsbug time-stamp tabify whitespace dabbrev vc-dispatcher vc-svn flyspell ispell cc-mode cc-fonts cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs help-mode view copyright gnus-dup mule-util gnus-cite ansi-color mail-extr gnus-async gnus-bcklg parse-time timezone sort gnus-ml disp-table byte-opt bytecomp byte-compile nnml utf-7 utf7 nndraft nnmh tls nnimap imap gnus-agent gnus-srvr gnus-score score-mode nnvirtual gnus-msg gnus-art mm-uu mml2015 epg-config mm-view gnus-cache nnir edmacro kmacro gnus-sum gnus-demon nntp gnus-group gnus-undo nnmail mail-source nnoo gnus-start gnus-spec gnus-int gnus-range gnus-win uniquify tramp-imap assoc tramp-gw tramp-fish tramp-smb tramp-cache tramp-ftp tramp-cmds tramp auth-source advice help-fns advice-preload shell format-spec tramp-compat trampver time smime dig server psvn cl cl-19 log-edit pcvs-util add-log diff-mode easy-mmode pgg pgg-parse pgg-def message sendmail ecomplete rfc822 mml easymenu mml-sec password-cache mm-decode mm-bodies mm-encode mailcap mail-parse rfc2231 rfc2047 rfc2045 qp ietf-drums mailabbrev gmm-utils mailheader canlock sha1 hex-util hashcash gnus gnus-ems nnheader gnus-util netrc time-date mail-utils mm-util mail-prsvr wid-edit generic-x dired-x dired-aux dired ange-ftp regexp-opt comint ring tooltip ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd font-setting tool-bar dnd fontset image fringe lisp-mode register page menu-bar rfn-eshadow timer select scroll-bar mldrag mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev loaddefs button minibuffer faces cus-face files text-properties overlay md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process dbusbind system-font-setting font-render-setting gtk x-toolkit x multi-tty emacs) -- Michael Welsh Duggan (mwd@cert.org) --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 25 12:43:44 2010 Received: (at control) by debbugs.gnu.org; 25 Feb 2010 17:43:44 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NkhkV-00067N-Oo for submit@debbugs.gnu.org; Thu, 25 Feb 2010 12:43:43 -0500 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NkhkU-00067G-O7 for control@debbugs.gnu.org; Thu, 25 Feb 2010 12:43:42 -0500 Received: from rgm by fencepost.gnu.org with local (Exim 4.69) (envelope-from ) id 1NkhkO-0007mW-Uf; Thu, 25 Feb 2010 12:43:37 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <19334.46792.929588.351017@fencepost.gnu.org> Date: Thu, 25 Feb 2010 12:43:36 -0500 From: Glenn Morris To: control Subject: control X-Attribution: GM X-Mailer: VM (www.wonderworks.com/vm), GNU Emacs (www.gnu.org/software/emacs) X-Hue: green X-Ran: oxg91J+[,X{YUPu%@Mkp.9mE!K"*?5Lz6t0~"V/iy-:Son"*5;dbTW6qW-5KIB&cK^9wZP X-Debbugs-No-Ack: yes X-Spam-Score: -5.1 (-----) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.1 (-----) merge 5387 5647 reassign 5649 emacs,cc-mode severity 5648 minor retitle 5648 some rmail doc strings severity 5644 wishlist severity 5641 wishlist retitle 5628 minibuffer crash reassign 5628 emacs,w32 tags 5628 moreinfo tags 5639 moreinfo unreproducible From unknown Sat Jun 21 10:32:29 2025 X-Loop: bug-gnu-emacs@gnu.org Subject: bug#5649: 23.1.92; Indentation problems in C mode Resent-From: Chong Yidong Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 27 Feb 2010 00:13:01 +0000 Resent-Message-ID: Resent-Sender: bug-gnu-emacs@gnu.org X-Emacs-PR-Message: followup 5649 X-Emacs-PR-Package: emacs,cc-mode X-Emacs-PR-Keywords: To: Michael Welsh Duggan Cc: Alan Mackenzie , 5649@debbugs.gnu.org Received: via spool by 5649-submit@debbugs.gnu.org id=B5649.126722953529566 (code B ref 5649); Sat, 27 Feb 2010 00:13:01 +0000 Received: (at 5649) by debbugs.gnu.org; 27 Feb 2010 00:12:15 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NlAI2-0007go-Ie for submit@debbugs.gnu.org; Fri, 26 Feb 2010 19:12:14 -0500 Received: from pantheon-po33.its.yale.edu ([130.132.50.94]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NlAHz-0007gi-9S for 5649@debbugs.gnu.org; Fri, 26 Feb 2010 19:12:13 -0500 Received: from furry (dhcp128036014008.central.yale.edu [128.36.14.8]) (authenticated bits=0) by pantheon-po33.its.yale.edu (8.12.11.20060308/8.12.11) with ESMTP id o1R0C6RC004377 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 26 Feb 2010 19:12:06 -0500 Received: by furry (Postfix, from userid 1000) id 522C3C05D; Fri, 26 Feb 2010 19:12:06 -0500 (EST) From: Chong Yidong References: Date: Fri, 26 Feb 2010 19:12:06 -0500 In-Reply-To: (Michael Welsh Duggan's message of "Thu, 25 Feb 2010 11:11:37 -0500") Message-ID: <87d3zredux.fsf@stupidchicken.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.92 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-YaleITSMailFilter: Version 1.2c (attachment(s) not renamed) X-Spam-Score: -2.9 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.9 (--) Michael Welsh Duggan writes: > I'm getting some screwy indentation behavior from C mode. From a > current bzr checkout/install of emacs, try the following recipe: > > emacs -Q foo.c | starts emacs on foo.c (included below) > C-u 7 C-n | move down 7 lines > TAB | indent, nothing changes (good) > C-p C-p | move up 2 lines > TAB C-n TAB C-n | indent 2 lines, nothing changes (good) > TAB | line unindents by 2 (bad) > TAB | line re-indents (good, but strange) > TAB | no change this time Thanks. This is a regression vs Emacs 23.1, so we should definitely fix it before releasing Emacs 23.2. I can reproduce the bug with the Emacs 23.0.90, so it's be around since at lease 12-09 last year. However, I haven't yet had the time to do a proper bisect. From unknown Sat Jun 21 10:32:29 2025 X-Loop: bug-gnu-emacs@gnu.org Subject: bug#5649: 23.1.92; Indentation problems in C mode Resent-From: Alan Mackenzie Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 01 Mar 2010 11:32:01 +0000 Resent-Message-ID: Resent-Sender: bug-gnu-emacs@gnu.org X-Emacs-PR-Message: followup 5649 X-Emacs-PR-Package: emacs,cc-mode X-Emacs-PR-Keywords: To: Chong Yidong Cc: 5649@debbugs.gnu.org, Michael Welsh Duggan Received: via spool by 5649-submit@debbugs.gnu.org id=B5649.12674430703053 (code B ref 5649); Mon, 01 Mar 2010 11:32:01 +0000 Received: (at 5649) by debbugs.gnu.org; 1 Mar 2010 11:31:10 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Nm3q9-0000nC-VM for submit@debbugs.gnu.org; Mon, 01 Mar 2010 06:31:10 -0500 Received: from colin.muc.de ([193.149.48.1] helo=mail.muc.de) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Nm3q5-0000mf-RI for 5649@debbugs.gnu.org; Mon, 01 Mar 2010 06:31:09 -0500 Received: (qmail 98771 invoked by uid 3782); 1 Mar 2010 11:30:59 -0000 Received: from acm.muc.de (pD9E507B3.dip.t-dialin.net [217.229.7.179]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Mon, 01 Mar 2010 12:30:57 +0100 Received: (qmail 12855 invoked by uid 1000); 1 Mar 2010 11:38:32 -0000 Date: Mon, 1 Mar 2010 11:38:32 +0000 Message-ID: <20100301113832.GA12488@muc.de> References: <87d3zredux.fsf@stupidchicken.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87d3zredux.fsf@stupidchicken.com> User-Agent: Mutt/1.5.9i X-Delivery-Agent: TMDA/1.1.5 (Fettercairn) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: -2.6 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) Hi, Michael and Yidong On Fri, Feb 26, 2010 at 07:12:06PM -0500, Chong Yidong wrote: > Michael Welsh Duggan writes: > > I'm getting some screwy indentation behavior from C mode. From a > > current bzr checkout/install of emacs, try the following recipe: > > emacs -Q foo.c | starts emacs on foo.c (included below) > > C-u 7 C-n | move down 7 lines > > TAB | indent, nothing changes (good) > > C-p C-p | move up 2 lines > > TAB C-n TAB C-n | indent 2 lines, nothing changes (good) > > TAB | line unindents by 2 (bad) > > TAB | line re-indents (good, but strange) > > TAB | no change this time > Thanks. This is a regression vs Emacs 23.1, so we should definitely fix > it before releasing Emacs 23.2. > I can reproduce the bug with the Emacs 23.0.90, so it's be around since > at lease 12-09 last year. However, I haven't yet had the time to do a > proper bisect. I've just committed the folowing patch, which should fix the bug: === modified file 'lisp/progmodes/cc-engine.el' --- lisp/progmodes/cc-engine.el 2010-02-25 21:21:25 +0000 +++ lisp/progmodes/cc-engine.el 2010-03-01 11:23:59 +0000 @@ -2641,7 +2641,8 @@ ;; (car c-state-cache). There can be no open parens/braces/brackets ;; between `good-pos'/`good-pos-actual-macro-start' and (point-max), ;; due to the interface spec to this function. - (setq pos (if good-pos-actual-macro-end + (setq pos (if (and good-pos-actual-macro-end + (> in-macro-start good-pos-actual-macro-start)) (1+ good-pos-actual-macro-end) ; get outside the macro as ; marked by a `category' text property. good-pos)) Thanks for the clean and concise bug report! -- Alan Mackenzie (Nuremberg, Germany). From unknown Sat Jun 21 10:32:29 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.427 (Entity 5.427) X-Loop: bug-gnu-emacs@gnu.org From: bug-gnu-emacs@gnu.org (Emacs bug Tracking System) To: mwd@md5i.com Subject: bug#5649 closed by Chong Yidong (Re: bug#5649: 23.1.92; Indentation problems in C mode) Message-ID: References: <87ocj85bo6.fsf@stupidchicken.com> X-Emacs-PR-Message: they-closed 5649 X-Emacs-PR-Package: emacs,cc-mode Reply-To: 5649@debbugs.gnu.org Date: Mon, 01 Mar 2010 15:02:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1267455722-14109-1" This is a multi-part message in MIME format... ------------=_1267455722-14109-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This is an automatic notification regarding your bug report which was filed against the emacs,cc-mode package: #5649: 23.1.92; Indentation problems in C mode It has been closed by Chong Yidong . Their explanation is attached below along with your original report. If this explanation is unsatisfactory and you have not received a better one in a separate message then please contact Chong Yidong by replying to this email. --=20 5649: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D5649 Emacs Bug Tracking System Contact bug-gnu-emacs@gnu.org with problems ------------=_1267455722-14109-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 5649-done) by debbugs.gnu.org; 1 Mar 2010 15:01:10 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Nm77N-0003f0-Lr for submit@debbugs.gnu.org; Mon, 01 Mar 2010 10:01:09 -0500 Received: from pantheon-po35.its.yale.edu ([130.132.50.83]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Nm77K-0003ed-25 for 5649-done@debbugs.gnu.org; Mon, 01 Mar 2010 10:01:08 -0500 Received: from furry (adsl-99-70-212-195.dsl.wlfrct.sbcglobal.net [99.70.212.195]) (authenticated bits=0) by pantheon-po35.its.yale.edu (8.12.11.20060308/8.12.11) with ESMTP id o21F0v3X001088 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 1 Mar 2010 10:00:58 -0500 Received: by furry (Postfix, from userid 1000) id 53460C05D; Mon, 1 Mar 2010 10:00:57 -0500 (EST) From: Chong Yidong To: Alan Mackenzie Subject: Re: bug#5649: 23.1.92; Indentation problems in C mode References: <87d3zredux.fsf@stupidchicken.com> <20100301113832.GA12488@muc.de> Date: Mon, 01 Mar 2010 10:00:57 -0500 In-Reply-To: <20100301113832.GA12488@muc.de> (Alan Mackenzie's message of "Mon, 1 Mar 2010 11:38:32 +0000") Message-ID: <87ocj85bo6.fsf@stupidchicken.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.93 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-YaleITSMailFilter: Version 1.2c (attachment(s) not renamed) X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 5649-done Cc: 5649-done@debbugs.gnu.org, Michael Welsh Duggan X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) Alan Mackenzie writes: > > I've just committed the folowing patch, which should fix the bug: Thanks! ------------=_1267455722-14109-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 25 Feb 2010 16:17:06 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NkgOU-00055A-0N for submit@debbugs.gnu.org; Thu, 25 Feb 2010 11:17:06 -0500 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NkgJs-00051z-Oh for submit@debbugs.gnu.org; Thu, 25 Feb 2010 11:12:09 -0500 Received: from mail.gnu.org ([199.232.76.166]:43277 helo=mx10.gnu.org) by fencepost.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NkgJn-0004gG-Vr for submit@debbugs.gnu.org; Thu, 25 Feb 2010 11:12:04 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NkgJU-0004qe-4a for submit@debbugs.gnu.org; Thu, 25 Feb 2010 11:11:49 -0500 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on monty-python X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00, UNPARSEABLE_RELAY autolearn=ham version=3.1.0 Received: from lists.gnu.org ([199.232.76.165]:49621) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NkgJT-0004qa-So for submit@debbugs.gnu.org; Thu, 25 Feb 2010 11:11:44 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NkgJT-0002wd-A1 for bug-gnu-emacs@gnu.org; Thu, 25 Feb 2010 11:11:43 -0500 Received: from [140.186.70.92] (port=41849 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NkgJR-0002vE-Ru for bug-gnu-emacs@gnu.org; Thu, 25 Feb 2010 11:11:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NkgJP-0001cP-V3 for bug-gnu-emacs@gnu.org; Thu, 25 Feb 2010 11:11:41 -0500 Received: from upton.red.cert.org ([192.88.209.60]:53782) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NkgJP-0001c6-Mu for bug-gnu-emacs@gnu.org; Thu, 25 Feb 2010 11:11:39 -0500 Received: from bucknell.indigo.cert.org (bucknell.indigo.cert.org [10.60.10.121]) by upton.red.cert.org (8.13.8/8.13.8) with ESMTP id o1PGBbNO008339 for ; Thu, 25 Feb 2010 11:11:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cert.org; s=jthatj15xw2j; t=1267114298; bh=qiVk8eebQ2geTtKBx7y92ENC1MYqjssJMtyQt7OHpCI=; h=From:To:Subject:Reply-To:Date:Message-ID:MIME-Version: Content-Type:Sender:Cc:In-Reply-To:References; b=B/rP9bu84bxcaJghIFENYvPZXAApgrFV87S1wF45jSKRpwQOv2YgRk09pH4TPmK6R JmaW/oVXC1N4Qbi+pZMQR4ikFSRqVX6hTggE9Wr3qvBSTpafZHbaISJq1RRXCm3hev hoSSQ/1yieL0i7nK+JpB+C/Baqc2tptWQ1+mX6jE= Received: from maru.green.cert.org (maru.green.cert.org [10.21.10.16]) by bucknell.indigo.cert.org (8.13.8/8.13.8/2.77) with ESMTP id o1PGBbTZ019840 for ; Thu, 25 Feb 2010 11:11:37 -0500 Received: (from mwd@localhost) by maru.green.cert.org (8.13.8/8.13.8/Submit/1.6) id o1PGBbnN021844; Thu, 25 Feb 2010 11:11:37 -0500 X-Authentication-Warning: maru.green.cert.org: mwd set sender to mwd@cert.org using -f From: Michael Welsh Duggan To: bug-gnu-emacs@gnu.org Subject: 23.1.92; Indentation problems in C mode Date: Thu, 25 Feb 2010 11:11:37 -0500 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.92 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Spam-Score: -6.0 (------) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Thu, 25 Feb 2010 11:16:53 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Reply-To: mwd@md5i.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.0 (------) --=-=-= I'm getting some screwy indentation behavior from C mode. From a current bzr checkout/install of emacs, try the following recipe: emacs -Q foo.c | starts emacs on foo.c (included below) C-u 7 C-n | move down 7 lines TAB | indent, nothing changes (good) C-p C-p | move up 2 lines TAB C-n TAB C-n | indent 2 lines, nothing changes (good) TAB | line unindents by 2 (bad) TAB | line re-indents (good, but strange) TAB | no change this time And here's another recipe for weirdness: emacs -Q foo.c | starts emacs on foo.c (included below) C-x h | select buffer C-M-\ | indent region everything from line 7 | down to the while (0) unindents 2 C-u 5 C-n | move down to the do { C-x ( TAB C-n C-x ) | define a macro to indent and move down | a line C-x e e e e e e | Indent each line, no change Here's foo.c --=-=-= Content-Disposition: inline; filename=foo.c #if !SK_ENABLE_IPV6 # define skipaddrApplyCIDR(ipaddr, cidr) \ ipUnionApplyCIDRV4(&(ipaddr)->ip_ip, cidr) #else # define skipaddrApplyCIDR(ipaddr, cidr) \ do { \ if (skipaddrIsV6(ipaddr)) { \ ipUnionApplyCIDRV6(&((ipaddr)->ip_ip), cidr); \ } else { \ ipUnionApplyCIDRV4(&((ipaddr)->ip_ip), cidr); \ } \ } while (0) #endif --=-=-= In GNU Emacs 23.1.92.2 (i686-pc-linux-gnu, GTK+ Version 2.10.4) of 2010-02-19 on maru.green.cert.org Windowing system distributor `The X.Org Foundation', version 11.0.70101000 configured using `configure '--prefix=/home/mwd' '--without-toolkit-scroll-bars' '--with-gif=no'' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: en_US.UTF-8 value of $XMODIFIERS: @im=none locale-coding-system: utf-8-unix default enable-multibyte-characters: t Major mode: Group Minor modes in effect: gnus-undo-mode: t shell-dirtrack-mode: t display-time-mode: t diff-auto-refine-mode: t tooltip-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t Recent input: C-x h C-M-\ C-n C-n C-n C-n C-n C-n C-n C-n C-p C-o C-_ C-p C-n C-n C-n C-n C-b C-b } SPC C-p C-p C-p C-p C-p C-a C-p C-x h C-M-\ C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b \ C-p C-x h C-M-\ C-n C-n C-n C-n C-n C-n C-n C-n C-p C-n C-n C-n C-n C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-n C-a C-p C-a C-x h C-M-\ C-_ M-x r e p o r e t - e m r t - e m I n d e n t a t i o n SPC p r o b l e m s SPC i n SPC c c - m o d e M-x c c - b - b r e s u y M-p C-e C SPC m o d e C-x o C-x k y e s C-x 0 M-v M-v C-n C-p C-n C-n C-n C-n C-n C-n C-n C-n C-n C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-_ C-x k M-x r e p o r t - e m Recent messages: Checking 39 files in /home/mwd/share/emacs/23.1.92/lisp/obsolete... Checking 1 files in /home/mwd/share/emacs/23.1.92/leim... Checking for load-path shadows...done Making completion list... [4 times] Do you want to submit a report on CC Mode? (y or n) Formatting bug report buffer....... Please enter your report. Type C-c C-c to send, C-c C-k to abort. call-interactively: Beginning of buffer Auto-saving...done Undo! Load-path shadows: /afs/cert.org/usr/mwd/src/elisp/nnir hides /home/mwd/share/emacs/23.1.92/lisp/gnus/nnir Features: (reporter shadow emacsbug time-stamp tabify whitespace dabbrev vc-dispatcher vc-svn flyspell ispell cc-mode cc-fonts cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs help-mode view copyright gnus-dup mule-util gnus-cite ansi-color mail-extr gnus-async gnus-bcklg parse-time timezone sort gnus-ml disp-table byte-opt bytecomp byte-compile nnml utf-7 utf7 nndraft nnmh tls nnimap imap gnus-agent gnus-srvr gnus-score score-mode nnvirtual gnus-msg gnus-art mm-uu mml2015 epg-config mm-view gnus-cache nnir edmacro kmacro gnus-sum gnus-demon nntp gnus-group gnus-undo nnmail mail-source nnoo gnus-start gnus-spec gnus-int gnus-range gnus-win uniquify tramp-imap assoc tramp-gw tramp-fish tramp-smb tramp-cache tramp-ftp tramp-cmds tramp auth-source advice help-fns advice-preload shell format-spec tramp-compat trampver time smime dig server psvn cl cl-19 log-edit pcvs-util add-log diff-mode easy-mmode pgg pgg-parse pgg-def message sendmail ecomplete rfc822 mml easymenu mml-sec password-cache mm-decode mm-bodies mm-encode mailcap mail-parse rfc2231 rfc2047 rfc2045 qp ietf-drums mailabbrev gmm-utils mailheader canlock sha1 hex-util hashcash gnus gnus-ems nnheader gnus-util netrc time-date mail-utils mm-util mail-prsvr wid-edit generic-x dired-x dired-aux dired ange-ftp regexp-opt comint ring tooltip ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd font-setting tool-bar dnd fontset image fringe lisp-mode register page menu-bar rfn-eshadow timer select scroll-bar mldrag mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev loaddefs button minibuffer faces cus-face files text-properties overlay md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process dbusbind system-font-setting font-render-setting gtk x-toolkit x multi-tty emacs) -- Michael Welsh Duggan (mwd@cert.org) --=-=-=-- ------------=_1267455722-14109-1-- From unknown Sat Jun 21 10:32:29 2025 X-Loop: bug-gnu-emacs@gnu.org Subject: bug#5649: 23.1.92; Indentation problems in C mode Resent-From: Michael Welsh Duggan Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 01 Mar 2010 15:20:02 +0000 Resent-Message-ID: Resent-Sender: bug-gnu-emacs@gnu.org X-Emacs-PR-Message: followup 5649 X-Emacs-PR-Package: emacs,cc-mode X-Emacs-PR-Keywords: To: Alan Mackenzie Cc: Chong Yidong , "5649@debbugs.gnu.org" <5649@debbugs.gnu.org> Received: via spool by 5649-submit@debbugs.gnu.org id=B5649.126745678514813 (code B ref 5649); Mon, 01 Mar 2010 15:20:02 +0000 Received: (at 5649) by debbugs.gnu.org; 1 Mar 2010 15:19:45 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Nm7PM-0003qs-I8 for submit@debbugs.gnu.org; Mon, 01 Mar 2010 10:19:44 -0500 Received: from euclid.red.cert.org ([192.88.209.48]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Nm7Mo-0003p0-NM for 5649@debbugs.gnu.org; Mon, 01 Mar 2010 10:17:07 -0500 Received: from bucknell.indigo.cert.org (bucknell.indigo.cert.org [10.60.10.121]) by euclid.red.cert.org (8.13.8/8.13.8) with ESMTP id o21FGc56029427; Mon, 1 Mar 2010 10:16:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cert.org; s=jthatj15xw2j; t=1267456598; bh=dodK9UOODNJyxDFCjF61jpN6vgx+Apq+ykMfUzY5IUs=; h=From:To:Cc:Subject:References:Date:In-Reply-To:Message-ID: MIME-Version:Content-Type:Sender:Reply-To; b=EeSoqmwSQgvipPGSgIyRGEBjEJm8s4WK7bw2j8EU+k6JwReJV3Pid8w2xs/KPXmFg MtfoIy3axnoucW7bC+IWLVeq9gIFoFxiaLmX7f+6oR210dqph6zDlgduN880GqdDIQ epHKSQdymfmh81CWiFHgonBIk/RlKmycsv0vhUbU= Received: from maru.green.cert.org (maru.green.cert.org [10.21.10.16]) by bucknell.indigo.cert.org (8.13.8/8.13.8/2.77) with ESMTP id o21FH0nL015673; Mon, 1 Mar 2010 10:17:00 -0500 Received: (from mwd@localhost) by maru.green.cert.org (8.13.8/8.13.8/Submit/1.6) id o21FH0tg026073; Mon, 1 Mar 2010 10:17:00 -0500 X-Authentication-Warning: maru.green.cert.org: mwd set sender to mwd@cert.org using -f From: Michael Welsh Duggan References: <87d3zredux.fsf@stupidchicken.com> <20100301113832.GA12488@muc.de> Date: Mon, 01 Mar 2010 10:17:00 -0500 In-Reply-To: <20100301113832.GA12488@muc.de> (Alan Mackenzie's message of "Mon, 1 Mar 2010 06:38:32 -0500") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.93 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -4.3 (----) X-Mailman-Approved-At: Mon, 01 Mar 2010 10:19:43 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.7 (---) Alan Mackenzie writes: > Hi, Michael and Yidong > > On Fri, Feb 26, 2010 at 07:12:06PM -0500, Chong Yidong wrote: >> Michael Welsh Duggan writes: > >> > I'm getting some screwy indentation behavior from C mode. From a >> > current bzr checkout/install of emacs, try the following recipe: > >> > emacs -Q foo.c | starts emacs on foo.c (included below) >> > C-u 7 C-n | move down 7 lines >> > TAB | indent, nothing changes (good) >> > C-p C-p | move up 2 lines >> > TAB C-n TAB C-n | indent 2 lines, nothing changes (good) >> > TAB | line unindents by 2 (bad) >> > TAB | line re-indents (good, but strange) >> > TAB | no change this time > >> Thanks. This is a regression vs Emacs 23.1, so we should definitely fix >> it before releasing Emacs 23.2. > >> I can reproduce the bug with the Emacs 23.0.90, so it's be around since >> at lease 12-09 last year. However, I haven't yet had the time to do a >> proper bisect. > > I've just committed the folowing patch, which should fix the bug: I'm afraid this causes a much more serious bug. Recipe: emacs -Q Open a new C-mode file. Then type the following: #if FOO #endif int bar; For me the following happens: The #endif is not fontified. The "int bar" is not fontified. The semicolon causes an error. I have verified that reverting the patch below goes back to the old behavior, so this patch is what is causing the bug. > === modified file 'lisp/progmodes/cc-engine.el' > --- lisp/progmodes/cc-engine.el 2010-02-25 21:21:25 +0000 > +++ lisp/progmodes/cc-engine.el 2010-03-01 11:23:59 +0000 > @@ -2641,7 +2641,8 @@ > ;; (car c-state-cache). There can be no open parens/braces/brackets > ;; between `good-pos'/`good-pos-actual-macro-start' and (point-max), > ;; due to the interface spec to this function. > - (setq pos (if good-pos-actual-macro-end > + (setq pos (if (and good-pos-actual-macro-end > + (> in-macro-start good-pos-actual-macro-start)) > (1+ good-pos-actual-macro-end) ; get outside the macro as > ; marked by a `category' text property. > good-pos)) > > > Thanks for the clean and concise bug report! -- Michael Welsh Duggan (mwd@cert.org) From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 01 10:59:27 2010 Received: (at control) by debbugs.gnu.org; 1 Mar 2010 15:59:27 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Nm81n-0004IY-9b for submit@debbugs.gnu.org; Mon, 01 Mar 2010 10:59:27 -0500 Received: from pantheon-po33.its.yale.edu ([130.132.50.94]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Nm81j-0004IP-N5 for control@debbugs.gnu.org; Mon, 01 Mar 2010 10:59:25 -0500 Received: from furry (dhcp128036203163.central.yale.edu [128.36.203.163]) (authenticated bits=0) by pantheon-po33.its.yale.edu (8.12.11.20060308/8.12.11) with ESMTP id o21FxI4m014104 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 1 Mar 2010 10:59:19 -0500 Received: by furry (Postfix, from userid 1000) id CD0ACC05D; Mon, 1 Mar 2010 10:59:18 -0500 (EST) From: Chong Yidong To: control@debbugs.gnu.org Subject: reopen 5649 Date: Mon, 01 Mar 2010 10:59:18 -0500 Message-ID: <874ol09go9.fsf@stupidchicken.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-YaleITSMailFilter: Version 1.2c (attachment(s) not renamed) X-Spam-Score: -2.9 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.9 (--) reopen 5649 severity 5649 serious thanks From unknown Sat Jun 21 10:32:29 2025 X-Loop: bug-gnu-emacs@gnu.org Subject: bug#5649: 23.1.92; Indentation problems in C mode Resent-From: Alan Mackenzie Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 01 Mar 2010 17:57:02 +0000 Resent-Message-ID: Resent-Sender: bug-gnu-emacs@gnu.org X-Emacs-PR-Message: followup 5649 X-Emacs-PR-Package: emacs,cc-mode X-Emacs-PR-Keywords: To: Michael Welsh Duggan Cc: Chong Yidong , "5649@debbugs.gnu.org" <5649@debbugs.gnu.org> Received: via spool by 5649-submit@debbugs.gnu.org id=B5649.126746619724125 (code B ref 5649); Mon, 01 Mar 2010 17:57:02 +0000 Received: (at 5649) by debbugs.gnu.org; 1 Mar 2010 17:56:37 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Nm9rA-0006H4-O3 for submit@debbugs.gnu.org; Mon, 01 Mar 2010 12:56:37 -0500 Received: from colin.muc.de ([193.149.48.1] helo=mail.muc.de) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Nm9r8-0006Gz-51 for 5649@debbugs.gnu.org; Mon, 01 Mar 2010 12:56:35 -0500 Received: (qmail 24027 invoked by uid 3782); 1 Mar 2010 17:56:28 -0000 Received: from acm.muc.de (pD9E5025A.dip.t-dialin.net [217.229.2.90]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Mon, 01 Mar 2010 18:56:26 +0100 Received: (qmail 2974 invoked by uid 1000); 1 Mar 2010 18:04:01 -0000 Date: Mon, 1 Mar 2010 18:04:01 +0000 Message-ID: <20100301180401.GA2864@muc.de> References: <87d3zredux.fsf@stupidchicken.com> <20100301113832.GA12488@muc.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.9i X-Delivery-Agent: TMDA/1.1.5 (Fettercairn) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: -2.6 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) Hello, again, On Mon, Mar 01, 2010 at 10:17:00AM -0500, Michael Welsh Duggan wrote: > Alan Mackenzie writes: > > I've just committed the folowing patch, which should fix the bug: > I'm afraid this causes a much more serious bug. Recipe: > emacs -Q > Open a new C-mode file. Then type the following: > #if FOO > #endif > int bar; Sorry. > For me the following happens: The #endif is not fontified. The "int > bar" is not fontified. The semicolon causes an error. I have verified > that reverting the patch below goes back to the old behavior, so this > patch is what is causing the bug. Yes. > > === modified file 'lisp/progmodes/cc-engine.el' > > --- lisp/progmodes/cc-engine.el 2010-02-25 21:21:25 +0000 > > +++ lisp/progmodes/cc-engine.el 2010-03-01 11:23:59 +0000 > > @@ -2641,7 +2641,8 @@ > > ;; (car c-state-cache). There can be no open parens/braces/brackets > > ;; between `good-pos'/`good-pos-actual-macro-start' and (point-max), > > ;; due to the interface spec to this function. > > - (setq pos (if good-pos-actual-macro-end > > + (setq pos (if (and good-pos-actual-macro-end > > + (> in-macro-start good-pos-actual-macro-start)) > > (1+ good-pos-actual-macro-end) ; get outside the macro as > > ; marked by a `category' text property. > > good-pos)) I was thrown by my own bad commenting. :-( I've committed a correction to this. The relevant diff (wrt the buggy "middle" version) is: === modified file 'lisp/progmodes/cc-engine.el' --- lisp/progmodes/cc-engine.el 2010-03-01 11:31:42 +0000 +++ lisp/progmodes/cc-engine.el 2010-03-01 17:42:35 +0000 @@ -2591,7 +2591,7 @@ (save-restriction (narrow-to-region 1 (point-max)) (save-excursion - (let* ((in-macro-start ; point-max or beginning of macro containing it + (let* ((in-macro-start ; start of macro containing (point-max) or nil. (save-excursion (goto-char (point-max)) (and (c-beginning-of-macro) @@ -2642,7 +2642,8 @@ ;; between `good-pos'/`good-pos-actual-macro-start' and (point-max), ;; due to the interface spec to this function. (setq pos (if (and good-pos-actual-macro-end - (> in-macro-start good-pos-actual-macro-start)) + (not (eq good-pos-actual-macro-start + in-macro-start))) (1+ good-pos-actual-macro-end) ; get outside the macro as ; marked by a `category' text property. good-pos)) > > Thanks for the clean and concise bug report! I hope it's right now. > -- > Michael Welsh Duggan > (mwd@cert.org) -- Alan Mackenzie (Nuremberg, Germany). From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 01 13:44:59 2010 Received: (at control) by debbugs.gnu.org; 1 Mar 2010 18:45:00 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NmAbz-0006lA-L3 for submit@debbugs.gnu.org; Mon, 01 Mar 2010 13:44:59 -0500 Received: from pantheon-po33.its.yale.edu ([130.132.50.94]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NmAby-0006l5-62 for control@debbugs.gnu.org; Mon, 01 Mar 2010 13:44:58 -0500 Received: from furry (dhcp128036203163.central.yale.edu [128.36.203.163]) (authenticated bits=0) by pantheon-po33.its.yale.edu (8.12.11.20060308/8.12.11) with ESMTP id o21IirlZ009795 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 1 Mar 2010 13:44:53 -0500 Received: by furry (Postfix, from userid 1000) id B9344C05D; Mon, 1 Mar 2010 13:44:53 -0500 (EST) From: Chong Yidong To: control@debbugs.gnu.org Subject: close 5649 Date: Mon, 01 Mar 2010 13:44:53 -0500 Message-ID: <87wrxv51ay.fsf@stupidchicken.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-YaleITSMailFilter: Version 1.2c (attachment(s) not renamed) X-Spam-Score: -2.9 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.9 (--) close 5649 thanks From unknown Sat Jun 21 10:32:29 2025 X-Loop: bug-gnu-emacs@gnu.org Subject: bug#5649: 23.1.92; Indentation problems in C mode Resent-From: Michael Welsh Duggan Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 01 Mar 2010 18:56:01 +0000 Resent-Message-ID: Resent-Sender: bug-gnu-emacs@gnu.org X-Emacs-PR-Message: followup 5649 X-Emacs-PR-Package: emacs,cc-mode X-Emacs-PR-Keywords: To: Alan Mackenzie Cc: Chong Yidong , "5649@debbugs.gnu.org" <5649@debbugs.gnu.org> Received: via spool by 5649-submit@debbugs.gnu.org id=B5649.126746970326369 (code B ref 5649); Mon, 01 Mar 2010 18:56:01 +0000 Received: (at 5649) by debbugs.gnu.org; 1 Mar 2010 18:55:03 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NmAli-0006rG-VD for submit@debbugs.gnu.org; Mon, 01 Mar 2010 13:55:03 -0500 Received: from euclid.red.cert.org ([192.88.209.48]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NmAXe-0006ic-Q7 for 5649@debbugs.gnu.org; Mon, 01 Mar 2010 13:40:31 -0500 Received: from bucknell.indigo.cert.org (bucknell.indigo.cert.org [10.60.10.121]) by euclid.red.cert.org (8.13.8/8.13.8) with ESMTP id o21Ie2Pc001312; Mon, 1 Mar 2010 13:40:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cert.org; s=jthatj15xw2j; t=1267468803; bh=4jMIAMOK0lfwER06QwWAJVSP+Cg3Xd01cXdcv2ALHnU=; h=From:To:Cc:Subject:References:Date:In-Reply-To:Message-ID: MIME-Version:Content-Type:Sender:Reply-To; b=Pf8j16PT6aCSSXnM6lp6uVLmlXryahr4f2Cwdy4Jfo4ivy28oQgehCWUIkP1Xm7QW VoK6MSqemfviFk38octU3WRktCWWU7ZE5BDVJgLRgT+HE2+dOWFA7aa3zaZ9ZtE5ED 1DvSMoO3tRtUipuKgfEIxMC5dDqng1yriAa4atcs= Received: from maru.green.cert.org (maru.green.cert.org [10.21.10.16]) by bucknell.indigo.cert.org (8.13.8/8.13.8/2.77) with ESMTP id o21IePeO025499; Mon, 1 Mar 2010 13:40:25 -0500 Received: (from mwd@localhost) by maru.green.cert.org (8.13.8/8.13.8/Submit/1.6) id o21IeP9R007062; Mon, 1 Mar 2010 13:40:25 -0500 X-Authentication-Warning: maru.green.cert.org: mwd set sender to mwd@cert.org using -f From: Michael Welsh Duggan References: <87d3zredux.fsf@stupidchicken.com> <20100301113832.GA12488@muc.de> <20100301180401.GA2864@muc.de> Date: Mon, 01 Mar 2010 13:40:25 -0500 In-Reply-To: <20100301180401.GA2864@muc.de> (Alan Mackenzie's message of "Mon, 1 Mar 2010 13:04:01 -0500") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.93 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -3.5 (---) X-Mailman-Approved-At: Mon, 01 Mar 2010 13:55:01 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.3 (---) Alan Mackenzie writes: > Hello, again, > > On Mon, Mar 01, 2010 at 10:17:00AM -0500, Michael Welsh Duggan wrote: >> Alan Mackenzie writes: > >> > I've just committed the folowing patch, which should fix the bug: > >> I'm afraid this causes a much more serious bug. Recipe: > >> emacs -Q >> Open a new C-mode file. Then type the following: >> #if FOO >> #endif > >> int bar; [...] > I was thrown by my own bad commenting. :-( I've committed a correction > to this. The relevant diff (wrt the buggy "middle" version) is: [...] >> > Thanks for the clean and concise bug report! > > I hope it's right now. This does now seem to work. Thanks! -- Michael Welsh Duggan (mwd@cert.org)