From unknown Fri Jun 20 07:09:43 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#18970 <18970@debbugs.gnu.org> To: bug#18970 <18970@debbugs.gnu.org> Subject: Status: 24.3; indent region fails in C++ mode after adding a #include Reply-To: bug#18970 <18970@debbugs.gnu.org> Date: Fri, 20 Jun 2025 14:09:43 +0000 retitle 18970 24.3; indent region fails in C++ mode after adding a #include reassign 18970 emacs,cc-mode submitter 18970 Piotr Sipika severity 18970 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 05 22:45:51 2014 Received: (at submit) by debbugs.gnu.org; 6 Nov 2014 03:45:51 +0000 Received: from localhost ([127.0.0.1]:50722 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XmE18-0000NT-5O for submit@debbugs.gnu.org; Wed, 05 Nov 2014 22:45:50 -0500 Received: from eggs.gnu.org ([208.118.235.92]:42203) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XmDzt-0000Kv-Op for submit@debbugs.gnu.org; Wed, 05 Nov 2014 22:44:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XmDzn-0008HF-Gr for submit@debbugs.gnu.org; Wed, 05 Nov 2014 22:44:33 -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.8 required=5.0 tests=AC_HTML_NONSENSE_TAGS, BAYES_50, FREEMAIL_FROM,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:50287) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XmDzn-0008HB-Df for submit@debbugs.gnu.org; Wed, 05 Nov 2014 22:44:27 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43902) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XmDzh-0005bk-8U for bug-gnu-emacs@gnu.org; Wed, 05 Nov 2014 22:44:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XmDzb-0008CB-79 for bug-gnu-emacs@gnu.org; Wed, 05 Nov 2014 22:44:21 -0500 Received: from mail-qc0-x230.google.com ([2607:f8b0:400d:c01::230]:57864) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XmDzb-0008C5-1a for bug-gnu-emacs@gnu.org; Wed, 05 Nov 2014 22:44:15 -0500 Received: by mail-qc0-f176.google.com with SMTP id x3so176982qcv.21 for ; Wed, 05 Nov 2014 19:44:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:message-id:date:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; bh=YoENwS61LdRn8JP9+jyYQ2r3r1ezyRRzSz6OP42cuCE=; b=HyM8+dQEMO0xPCC+yL6cSuRL3BwBvtZW+AqEYix3ug/FeIqDHThcMakFjT9FmnDgZG i+GpcDr6XohzuKC73zuxW8WUZLhkJzfqsDlhoOMwPX31ag5gwo6npImHZVwMe/Mr51Em iuJp51UU7YU8KBajhp4UhXbp22BWS7VjBEsS4XDKw0Nhoo6wQBv2Mv1z5TTyWzHScQSz /1YQ4ju+y9sVYpLmM3fe2tk14T2OwF8f/tXRdbifn4b5cxVsZi4kGXyoBpyd1aGbBY9l rvCtycvpa3VGMiRLBvF3JO5KElUFdsA6Ghrja6DQTUTUv3xkdXvBVMMjG8TCocGUDM2s i0Mg== X-Received: by 10.224.41.142 with SMTP id o14mr2581769qae.100.1415245453655; Wed, 05 Nov 2014 19:44:13 -0800 (PST) Received: from [192.168.1.5] (pool-108-5-32-69.nwrknj.east.verizon.net. [108.5.32.69]) by mx.google.com with ESMTPSA id z1sm4909058qaj.43.2014.11.05.19.44.11 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Nov 2014 19:44:12 -0800 (PST) From: Piotr Sipika X-Google-Original-From: Piotr Sipika Message-ID: <545AEE8A.6090906@gmail.com> Date: Wed, 05 Nov 2014 22:44:10 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: bug-gnu-emacs@gnu.org Subject: 24.3; indent region fails in C++ mode after adding a #include Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -3.0 (---) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Wed, 05 Nov 2014 22:45:48 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.0 (---) --text follows this line-- 1. Edited a C++ header file in a buffer. 2. Switched to another buffer. 3. Went back to buffer in #1, above. 4. Added a #include to the top of the buffer. 5. Indentation for all code blocks following the include, when using TAB, resets to line 0. In GNU Emacs 24.3.1 (x86_64-pc-linux-gnu, GTK+ Version 3.10.7) of 2014-03-07 on lamiak, modified by Debian Windowing system distributor `The X.Org Foundation', version 11.0.11501000 System Description: Ubuntu 14.04.1 LTS Configured using: `configure '--build' 'x86_64-linux-gnu' '--build' 'x86_64-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var/lib' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs24:/etc/emacs:/usr/local/share/emacs/24.3/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.3/site-lisp:/usr/share/emacs/site-lisp' '--with-crt-dir=/usr/lib/x86_64-linux-gnu' '--with-x=yes' '--with-x-toolkit=gtk3' '--with-toolkit-scroll-bars' 'build_alias=x86_64-linux-gnu' 'CFLAGS=-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wall' 'LDFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro' 'CPPFLAGS=-D_FORTIFY_SOURCE=2'' Important settings: value of $LC_MONETARY: en_US.UTF-8 value of $LC_NUMERIC: en_US.UTF-8 value of $LC_TIME: en_US.UTF-8 value of $LANG: en_US.UTF-8 value of $XMODIFIERS: @im=ibus locale-coding-system: utf-8-unix default enable-multibyte-characters: t Major mode: C++/l Minor modes in effect: shell-dirtrack-mode: t show-paren-mode: t display-time-mode: t tooltip-mode: t mouse-wheel-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t column-number-mode: t line-number-mode: t transient-mark-mode: t abbrev-mode: t Recent input: b C-y C-x C-s C-k C-k C-k C-x C-s C-x C-s x s u b b u r e p o r t Load-path shadows: /usr/share/emacs/24.3/site-lisp/debian-startup hides /usr/share/emacs/site-lisp/debian-startup Features: (shadow sort gnus-util mail-extr emacsbug message cl-macs gv format-spec rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils help-mode pcmpl-unix shell pcomplete comint ansi-color ring make-mode misearch multi-isearch cc-langs cl cl-lib cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs cus-edit easymenu wid-edit edmacro kmacro paren autoinsert cus-start cus-load time time-date tooltip ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment lisp-mode register page menu-bar rfn-eshadow timer select scroll-bar 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 minibuffer loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process dbusbind dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs) From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 06 06:54:33 2014 Received: (at 18970) by debbugs.gnu.org; 6 Nov 2014 11:54:33 +0000 Received: from localhost ([127.0.0.1]:51157 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XmLe5-0004gv-64 for submit@debbugs.gnu.org; Thu, 06 Nov 2014 06:54:33 -0500 Received: from colin.muc.de ([193.149.48.1]:13490 helo=mail.muc.de) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XmLe2-0004gi-RK for 18970@debbugs.gnu.org; Thu, 06 Nov 2014 06:54:31 -0500 Received: (qmail 80516 invoked by uid 3782); 6 Nov 2014 11:54:29 -0000 Date: 6 Nov 2014 11:54:29 -0000 Message-ID: <20141106115429.80515.qmail@mail.muc.de> From: Alan Mackenzie To: Piotr Sipika Subject: Re: bug#18970: 24.3; indent region fails in C++ mode after adding a #include Organization: muc.de e.V. In-Reply-To: X-Newsgroups: gnu.emacs.bug User-Agent: tin/2.2.0-20131224 ("Lochindaal") (UNIX) (FreeBSD/8.4-RELEASE (amd64)) X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: 18970 Cc: 18970@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.3 (-) Hello, Piotr. In article you wrote: > 1. Edited a C++ header file in a buffer. > 2. Switched to another buffer. > 3. Went back to buffer in #1, above. > 4. Added a #include to the top of the buffer. > 5. Indentation for all code blocks following the include, when using > TAB, resets to line 0. This bug will be dependent on the exact contents of the file, or at least the first few hundred or thousand bytes in it. Is there any chance you could post the file as it was just before you edited it in step 1., and say exactly what keys you used for 1. - 4.? Thanks! > In GNU Emacs 24.3.1 (x86_64-pc-linux-gnu, GTK+ Version 3.10.7) > of 2014-03-07 on lamiak, modified by Debian > Windowing system distributor `The X.Org Foundation', version 11.0.11501000 > System Description: Ubuntu 14.04.1 LTS [ ... ] -- Alan Mackenzie (Nuremberg, Germany). From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 06 08:53:48 2014 Received: (at 18970) by debbugs.gnu.org; 6 Nov 2014 13:53:48 +0000 Received: from localhost ([127.0.0.1]:51191 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XmNVU-0000XI-AE for submit@debbugs.gnu.org; Thu, 06 Nov 2014 08:53:48 -0500 Received: from mail-qg0-f45.google.com ([209.85.192.45]:54074) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XmNVR-0000XA-VU for 18970@debbugs.gnu.org; Thu, 06 Nov 2014 08:53:46 -0500 Received: by mail-qg0-f45.google.com with SMTP id z107so725522qgd.4 for <18970@debbugs.gnu.org>; Thu, 06 Nov 2014 05:53:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:message-id:date:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type; bh=qVxQuBcDWF1TcZhAUVvC6aNoX9euS1+PHlfdowynE5U=; b=BVZqDMj7BlJjZ/Py8ofmCBIYMNWs6fmopedWGe09RbHiBmkyt4XzBikkNhrDGPZI9a u0yfdnz9LlEQ1ueQCt+GBSL/dktsG+hm0GvPBl1oVU+vn2Ga4nvF0q/dDr8zcREKjjKD PGTUBhquATc8KOhdeESS+Ev1P8UqKzE7NRN/ZvuRdoNoc4CTcIVEZBr8t0kpNuanm4zg wFegFHB6f+w7Atost7QgtWcJc34alwelj+ZJGAkQpAxFymorefC8/2TKvTm8SGqvr6uw P14UEGY2oDhH0/iKCy/1Hgn35hJfYdSM249U1dJbolmX+QpykovVzuuffeuZA3aAfETj SS/g== X-Received: by 10.224.103.74 with SMTP id j10mr6759531qao.101.1415282025050; Thu, 06 Nov 2014 05:53:45 -0800 (PST) Received: from [192.168.1.5] (pool-108-5-32-69.nwrknj.east.verizon.net. [108.5.32.69]) by mx.google.com with ESMTPSA id f65sm4630800qgf.41.2014.11.06.05.53.42 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 06 Nov 2014 05:53:43 -0800 (PST) From: Piotr Sipika X-Google-Original-From: Piotr Sipika Message-ID: <545B7D65.8080505@gmail.com> Date: Thu, 06 Nov 2014 08:53:41 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Alan Mackenzie Subject: Re: bug#18970: 24.3; indent region fails in C++ mode after adding a #include References: <20141106115429.80515.qmail@mail.muc.de> In-Reply-To: <20141106115429.80515.qmail@mail.muc.de> Content-Type: multipart/mixed; boundary="------------010208000008050205070704" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 18970 Cc: 18970@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) This is a multi-part message in MIME format. --------------010208000008050205070704 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Hi Alan, On 11/06/2014 06:54 AM, Alan Mackenzie wrote: > This bug will be dependent on the exact contents of the file, or at least > the first few hundred or thousand bytes in it. Is there any chance you > could post the file as it was just before you edited it in step 1., and > say exactly what keys you used for 1. - 4.? Certainly. The steps were: 1. Edited a C++ header file in a buffer. The file is attached (resource.h) 2. Switched to another buffer. C-x b [ENTER] (possibly edited the other buffer, but don't recall the exact keys...) 3. Went back to buffer in #1, above. C-x b [ENTER] 4. Added a #include to the top of the buffer. Went to line 9, moved the two #include's there down using [ENTER] (twice). Added: #include [ENTER] Saved buffer: C-x C-s 5. Indentation for all code blocks following the include, when using TAB, resets to line 0. Went down to the declaration of findLocation() and hit [TAB]; the function ended up being moved to line 0. > Thanks! Hope this helps... Cheers, Piotr --------------010208000008050205070704 Content-Type: text/plain; charset=UTF-8; name="resource.h" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="resource.h" CiNpZm5kZWYgTFhXRUFUSEVSX1JFU09VUkNFX0hfCiNkZWZpbmUgTFhXRUFUSEVSX1JFU09V UkNFX0hfCgojaW5jbHVkZSAiZXhjZXB0aW9uLmgiCiNpbmNsdWRlICJsb2NhdGlvbi5oIgoj aW5jbHVkZSAidHJhbnNwb3J0LmgiCgojaW5jbHVkZSA8c3RyaW5nPgojaW5jbHVkZSA8dmVj dG9yPgoKbmFtZXNwYWNlIExYV2VhdGhlcgp7CiAgdHlwZWRlZiBlbnVtCiAgICB7CiAgICAg IFJFU09VUkNFX1VOS05PV04sCiAgICAgIFJFU09VUkNFX1lBSE9PLAogICAgICBSRVNPVVJD RV9NQVgKICAgIH0gUmVzb3VyY2VUeXBlOwoKICBjbGFzcyBSZXNvdXJjZUV4Y2VwdGlvbiA6 IHB1YmxpYyBFeGNlcHRpb24KICB7CiAgcHVibGljOgogICAgUmVzb3VyY2VFeGNlcHRpb24o Y29uc3Qgc3RkOjpzdHJpbmcgJm1zZykgOiBFeGNlcHRpb24obXNnKSB7fTsKICB9OwoKICBj bGFzcyBSZXNvdXJjZQogIHsKICBwdWJsaWM6CiAgICBSZXNvdXJjZShjb25zdCBSZXNvdXJj ZVR5cGUgdHlwZSwgVHJhbnNwb3J0ICZ0cmFuc3BvcnQpIDogCiAgICAgIHR5cGVfKHR5cGUp LCAKICAgICAgbG9jYXRpb25fKE5VTEwpLAogICAgICB0cmFuc3BvcnRfKHRyYW5zcG9ydCkg e307CgogICAgdmlydHVhbCB+UmVzb3VyY2UoKSAKICAgIHsKICAgICAgaWYgKGxvY2F0aW9u XykKICAgICAgICB7CiAgICAgICAgICBkZWxldGUgbG9jYXRpb25fOwogICAgICAgIH0KICAg IH07CgogICAgUmVzb3VyY2VUeXBlIHR5cGUoKSB7IHJldHVybiB0eXBlXzsgfTsKCiAgICBM b2NhdGlvbiAqbG9jYXRpb24oKSBjb25zdCB7IHJldHVybiBsb2NhdGlvbl87IH07CgogICAg dm9pZCBsb2NhdGlvbihMb2NhdGlvbiAqbG9jYXRpb24pIAogICAgeyAKICAgICAgaWYgKGxv Y2F0aW9uXykKICAgICAgICB7CiAgICAgICAgICBkZWxldGUgbG9jYXRpb25fOwogICAgICAg IH0KICAgICAgCiAgICAgIGxvY2F0aW9uXyA9IGxvY2F0aW9uOyAKICAgIH07CgogICAgVHJh bnNwb3J0ICZ0cmFuc3BvcnQoKSBjb25zdCB7IHJldHVybiB0cmFuc3BvcnRfOyB9OwoKICAg IHZpcnR1YWwgc3RkOjp2ZWN0b3I8TG9jYXRpb24gKj4gZmluZExvY2F0aW9uKGNvbnN0IHN0 ZDo6c3RyaW5nICZuYW1lKSA9IDA7CgogICAgLyogICAgdmlydHVhbCBzdGQ6OnN0cmluZyBm b3JlY2FzdChjb25zdCBzdGQ6OnN0cmluZyAmVVJJKSA9IDA7Ki8KCiAgcHJvdGVjdGVkOgog ICAgUmVzb3VyY2VUeXBlIHR5cGVfOwoKICAgIExvY2F0aW9uICpsb2NhdGlvbl87CgogICAg VHJhbnNwb3J0ICZ0cmFuc3BvcnRfOwogIH07Cgp9IC8qIGVuZCBuYW1lc3BhY2UgTFhXZWF0 aGVyICovCgojZW5kaWYgLyogTFhXRUFUSEVSX1JFU09VUkNFX0hfICovCg== --------------010208000008050205070704-- From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 07 11:14:27 2014 Received: (at 18970) by debbugs.gnu.org; 7 Nov 2014 16:14:27 +0000 Received: from localhost ([127.0.0.1]:53064 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XmmB8-0000af-R1 for submit@debbugs.gnu.org; Fri, 07 Nov 2014 11:14:27 -0500 Received: from mail-qa0-f53.google.com ([209.85.216.53]:57356) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XmmB6-0000aX-KM for 18970@debbugs.gnu.org; Fri, 07 Nov 2014 11:14:24 -0500 Received: by mail-qa0-f53.google.com with SMTP id n8so2536659qaq.12 for <18970@debbugs.gnu.org>; Fri, 07 Nov 2014 08:14:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:message-id:date:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type; bh=cV6OF/i+aCO+LT13AMPDrFxE8q2sEkse8pav1Og8CgI=; b=nUi8NnyLwuMMmA0/qYh7wW+H9YAGoQplc/GyHJnUgNlYMwmFfMiJu6i0EvG3FvL8JN WRncsBgRhonYq37JYkygq/o28xb46mti5fEyDkashCnp+EMjbAkq7wgDItOK4Gr8UphU Hhb1Y19F771ts/9vGMshl6AFqJgL5bvLSdolWJEXw7Mec1R9gJNbIrStTuAPZ5B8Y0Uu fDZI73Y/Nt6V4v4MyVWhtGe3Fz1seZLUIjKY+gFxPmzqOrKl1PZu5IvbgXQ6QffJqgPl VKFxkJWw2X0RxPY2Yrgqjtu5LJslerl1SO9Siz+tXKuYobMnNE39Jj0LyAL0tAINBa4d VjfA== X-Received: by 10.140.49.107 with SMTP id p98mr17793209qga.20.1415376864264; Fri, 07 Nov 2014 08:14:24 -0800 (PST) Received: from [192.168.1.5] (pool-108-5-32-69.nwrknj.east.verizon.net. [108.5.32.69]) by mx.google.com with ESMTPSA id e2sm5038651qaw.10.2014.11.07.08.14.22 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 07 Nov 2014 08:14:22 -0800 (PST) From: Piotr Sipika X-Google-Original-From: Piotr Sipika Message-ID: <545CEFDD.1080404@gmail.com> Date: Fri, 07 Nov 2014 11:14:21 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Alan Mackenzie Subject: Re: bug#18970: 24.3; indent region fails in C++ mode after adding a #include References: <20141106115429.80515.qmail@mail.muc.de> <545B7D65.8080505@gmail.com> In-Reply-To: <545B7D65.8080505@gmail.com> Content-Type: multipart/mixed; boundary="------------000604040606060500090102" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 18970 Cc: 18970@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) This is a multi-part message in MIME format. --------------000604040606060500090102 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Alan, here's another instance of the problem: > The steps were: > 1. Edited a C++ header file in a buffer. The file is attached (libxmlparser.h). I've had it open in a buffer for a while and have edited it successfully (without the indentation problem) within the current emacs session. I just switched to it from another buffer. > 4. Added a #include to the top of the buffer. 4.1 I added a newline on line 8. 4.2 I then added another #include (pasted using C-y): #include 4.3 I then added another newline under the new #include. > 5. Indentation for all code blocks following the include, when using Tested line 14 (of the updated file) with a [TAB] and noticed the forward declaration got moved to column 0. When I undo all changes (steps 4.3 to 4.1), indentation is OK (remains at respective column). When I repeat the steps, indentation gets moved to column 0. Best! Piotr --------------000604040606060500090102 Content-Type: text/plain; charset=UTF-8; name="libxmlparser.h" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="libxmlparser.h" CiNpZm5kZWYgTFhXRUFUSEVSX0xJQlhNTFBBUlNFUl9IXwojZGVmaW5lIExYV0VBVEhFUl9M SUJYTUxQQVJTRVJfSF8KCiNpbmNsdWRlICJwYXJzZXIuaCIKCiNpbmNsdWRlIDxwdGhyZWFk Lmg+CgpuYW1lc3BhY2UgTFhXZWF0aGVyCnsKICAvKiBmb3J3YXJkIGRlY2xhcmF0aW9ucyAq LwogIGNsYXNzIExvY2F0aW9uOwogIGNsYXNzIEZvcmVjYXN0OwoKICBjbGFzcyBMaWJYTUxQ YXJzZXIgOiBwdWJsaWMgUGFyc2VyCiAgewogIHB1YmxpYzoKICAgIExpYlhNTFBhcnNlcihw dGhyZWFkX211dGV4X3QgKm11dGV4KTsKCiAgICB2aXJ0dWFsIH5MaWJYTUxQYXJzZXIoKTsK CiAgICB2aXJ0dWFsIHN0ZDo6dmVjdG9yPExvY2F0aW9uICo+IHBhcnNlTG9jYXRpb25MaXN0 KGNvbnN0IHN0ZDo6c3RyaW5nICZkYXRhKTsKICAgIHZpcnR1YWwgdm9pZCBwYXJzZUZvcmVj YXN0KGNvbnN0IHN0ZDo6c3RyaW5nICZkYXRhLCBGb3JlY2FzdCAqZm9yZWNhc3QpOwogICAg CiAgcHJvdGVjdGVkOgogICAgY2xhc3MgWFBBVEhXcmFwcGVyCiAgICB7CiAgICBwdWJsaWM6 CiAgICAgIFhQQVRIV3JhcHBlcigpIDogcENvbnRleHRfKE5VTEwpCiAgICAgICAgewogICAg ICAgICAgeG1sWFBhdGhJbml0KCk7CiAgICAgICAgfQoKICAgICAgfk5hbm9IVFRQV3JhcHBl cigpCiAgICAgICAgewogICAgICAgICAgeG1sTmFub0hUVFBDbG9zZShwQ29udGV4dF8pOwog ICAgICAgIH0KCiAgICAgIHN0ZDo6c3RyaW5nIGdldChjb25zdCBzdGQ6OnN0cmluZyAmVVJJ LCBpbnQgKnJldGNvZGUpOwogICAgICAKICAgIHByaXZhdGU6CiAgICAgIHZvaWQgKnBDb250 ZXh0XzsKICAgIH07CgogIHByaXZhdGU6CiAgICBwdGhyZWFkX211dGV4X3QgKm11dGV4XzsK ICB9OwoKfSAvKiBlbmQgbmFtZXNwYWNlIExYV2VhdGhlciAqLwoKI2VuZGlmIC8qIExYV0VB VEhFUl9MSUJYTUxQQVJTRVJfSF8gKi8K --------------000604040606060500090102-- From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 07 18:25:29 2014 Received: (at 18970) by debbugs.gnu.org; 7 Nov 2014 23:25:29 +0000 Received: from localhost ([127.0.0.1]:53256 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XmsuG-0003FM-5w for submit@debbugs.gnu.org; Fri, 07 Nov 2014 18:25:28 -0500 Received: from colin.muc.de ([193.149.48.1]:52187 helo=mail.muc.de) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XmsuC-0003FA-FK for 18970@debbugs.gnu.org; Fri, 07 Nov 2014 18:25:25 -0500 Received: (qmail 59007 invoked by uid 3782); 7 Nov 2014 23:25:23 -0000 Received: from acm.muc.de (pD951BADF.dip0.t-ipconnect.de [217.81.186.223]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sat, 08 Nov 2014 00:25:21 +0100 Received: (qmail 4972 invoked by uid 1000); 7 Nov 2014 23:24:44 -0000 Date: Fri, 7 Nov 2014 23:24:44 +0000 To: Piotr Sipika Subject: Re: bug#18970: 24.3; indent region fails in C++ mode after adding a #include Message-ID: <20141107232444.GE2865@acm.acm> References: <20141106115429.80515.qmail@mail.muc.de> <545D3F5E.8030801@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <545D3F5E.8030801@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: 18970 Cc: 18970@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.3 (-) Hello, Piotr. On Fri, Nov 07, 2014 at 04:53:34PM -0500, Piotr Sipika wrote: > Hi Alan, > > This bug will be dependent on the exact contents of the file, or at least > > the first few hundred or thousand bytes in it. Is there any chance you > > could post the file as it was just before you edited it in step 1., and > > say exactly what keys you used for 1. - 4.? > Hope this will help you: it seems that this problem has a higher rate of > occurrence when I kill the line with the #include (C-k) and then paste > it in (C-y). The buffer where the #include is inserted is the one where > the indentation problem occurs (it may be the same buffer in which the > line was killed). Yes, indeed, that helps a great deal! There was a problem with C-y'ing #include lines into a buffer back in May 2013, which was fixed, and the fix got into Emacs 24.4 (which was released a few days ago). To confirm that your problem is the same one, would you please do the following: (i) Kill a line starting with "#include" with C-k, then yank it back again with C-y. (ii) Move point to the beginning of that line and type C-u C-x = (`what-cursor-position' with a C-u prefix argument). (iii) You should see something like this: ######################################################################## position: 63 of 1339 (5%), column: 0 character: # (displayed as #) (codepoint 35, #o43, #x23) preferred charset: ascii (ASCII (ISO646 IRV)) code point in charset: 0x23 syntax: . which means: punctuation category: .:Base, a:ASCII, l:Latin, r:Roman to input: type "C-x 8 RET HEX-CODEPOINT" or "C-x 8 RET NAME" buffer code: #x23 file code: #x23 (encoded by coding system undecided-unix) display: terminal code #x23 Character code properties: customize what to show name: NUMBER SIGN general-category: Po (Punctuation, Other) decomposition: (35) ('#') There are text properties here: c-in-sws t c-is-sws t category c-cpp-delimiter face font-lock-preprocessor-face fontified t risky-local-variable t syntax-table nil <=================================================== [back] ######################################################################## If you see the syntax-table text property set to nil, as in the above, then we have found the bug. Either upgrade your Emacs to version 24.4, or apply the following patch to ..../emacs-24.3/lisp/progmodes/cc-mode.el: === modified file 'lisp/progmodes/cc-mode.el' --- lisp/progmodes/cc-mode.el 2013-05-02 11:18:18 +0000 +++ lisp/progmodes/cc-mode.el 2013-05-27 13:30:21 +0000 @@ -1077,12 +1077,13 @@ (setq beg end))) ;; C-y is capable of spuriously converting category properties - ;; c--as-paren-syntax into hard syntax-table properties. Remove - ;; these when it happens. + ;; c--as-paren-syntax and c-cpp-delimiter into hard syntax-table + ;; properties. Remove these when it happens. (c-clear-char-property-with-value beg end 'syntax-table c-<-as-paren-syntax) (c-clear-char-property-with-value beg end 'syntax-table c->-as-paren-syntax) + (c-clear-char-property-with-value beg end 'syntax-table nil) (c-trim-found-types beg end old-len) ; maybe we don't need all of these. (c-invalidate-sws-region-after beg end) [If you have any problems applying the patch, get back to me privately.] After applying the patch, byte compile cc-mode.el either with "M-x byte-compile-file" inside emacs, or do it from the command line like this: $ emacs -Q -batch -f batch-byte-compile .../emacs-24.3/lisp/progmodes/cc-mode.el Then copy the compiled file cc-mode.elc to where emacs normally loads it from. You can find this with "M-x locate-librarycc-mode" from inside emacs. Restart Emacs, and hopefully the bug will be gone. Please let me know whether or not this works. Thanks! > Piotr -- Alan Mackenzie (Nuremberg, Germany). From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 07 21:27:21 2014 Received: (at 18970) by debbugs.gnu.org; 8 Nov 2014 02:27:21 +0000 Received: from localhost ([127.0.0.1]:53271 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XmvkH-0007ho-5a for submit@debbugs.gnu.org; Fri, 07 Nov 2014 21:27:21 -0500 Received: from mail-qa0-f48.google.com ([209.85.216.48]:47935) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XmvkE-0007hg-Mk for 18970@debbugs.gnu.org; Fri, 07 Nov 2014 21:27:19 -0500 Received: by mail-qa0-f48.google.com with SMTP id x12so3162809qac.21 for <18970@debbugs.gnu.org>; Fri, 07 Nov 2014 18:27:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:message-id:date:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=s08vyDQqdqLcLYdHuv8knUxD6rHgOVUULsqhcCppeXU=; b=L4kwYXVYco6ZjckJgaZTy3bk5pp5eGHxvQLpYFaRA1ThpA7kPS5jjtnfsYPOHcl/SE qmBhwxGQET8AslXe91Wetm6ejw8C5NoCpHZaxMdeHXfK3OAgfB4ISBxFk2ETpc6sj6Lm hNUkCg2vHLhClxbLPuJIvnqWG2O8YmQBIO1RSvo4p8LgSHTs13m1K0+d+UFgGMWrUr+Y Ybu6zAOLDrq5yny7kHOXpE/AUM01zqpN5vXurwhsxhXQfLamNhlPI3mGq1QrCl6200QI 7c1rGVUzefiZjmHCbHiuAoOZEwsHcLLkeRo4uHFaDgQfvTQRexnM6vrQHzLqEQrlAMmV tcfA== X-Received: by 10.140.23.112 with SMTP id 103mr18275423qgo.73.1415413638257; Fri, 07 Nov 2014 18:27:18 -0800 (PST) Received: from [192.168.1.5] (pool-108-5-32-69.nwrknj.east.verizon.net. [108.5.32.69]) by mx.google.com with ESMTPSA id q9sm9888106qat.21.2014.11.07.18.27.16 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 07 Nov 2014 18:27:17 -0800 (PST) From: Piotr Sipika X-Google-Original-From: Piotr Sipika Message-ID: <545D7F83.3030502@gmail.com> Date: Fri, 07 Nov 2014 21:27:15 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Alan Mackenzie Subject: Re: bug#18970: 24.3; indent region fails in C++ mode after adding a #include References: <20141106115429.80515.qmail@mail.muc.de> <545D3F5E.8030801@gmail.com> <20141107232444.GE2865@acm.acm> In-Reply-To: <20141107232444.GE2865@acm.acm> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 18970 Cc: 18970@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) > To confirm that your problem is the same one, would you please do the > following: > (i) Kill a line starting with "#include" with C-k, then yank it back > again with C-y. > (ii) Move point to the beginning of that line and type C-u C-x = > (`what-cursor-position' with a C-u prefix argument). > (iii) You should see something like this: Awesome directions, here's the output from my instance of that command: position: 110 of 3316 (3%), column: 0 character: # (displayed as #) (codepoint 35, #o43, #x23) preferred charset: ascii (ASCII (ISO646 IRV)) code point in charset: 0x23 syntax: . which means: punctuation category: .:Base, a:ASCII, l:Latin, r:Roman to input: type "C-x 8 RET HEX-CODEPOINT" or "C-x 8 RET NAME" buffer code: #x23 file code: #x23 (encoded by coding system undecided-unix) display: by this font (glyph code) xft:-unknown-Liberation Mono-normal-normal-normal-*-15-*-*-*-m-0-iso10646-1 (#x06) Character code properties: customize what to show name: NUMBER SIGN general-category: Po (Punctuation, Other) decomposition: (35) ('#') There are text properties here: c-in-sws t c-is-sws t category c-cpp-delimiter face font-lock-preprocessor-face fontified t risky-local-variable t syntax-table nil > If you see the syntax-table text property set to nil, as in the above, > then we have found the bug. As you can see that is the exact output indicating the bug. > Either upgrade your Emacs to version 24.4, or apply the following patch > to ..../emacs-24.3/lisp/progmodes/cc-mode.el: Thank you for the patch and further directions/suggestions. > Restart Emacs, and hopefully the bug will be gone. Please let me know > whether or not this works. Will do. Best! Piotr From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 07 22:08:14 2014 Received: (at 18970) by debbugs.gnu.org; 8 Nov 2014 03:08:14 +0000 Received: from localhost ([127.0.0.1]:53275 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XmwNp-0000Ew-PG for submit@debbugs.gnu.org; Fri, 07 Nov 2014 22:08:13 -0500 Received: from mail-qc0-f179.google.com ([209.85.216.179]:55044) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XmwNn-0000Eo-NL for 18970@debbugs.gnu.org; Fri, 07 Nov 2014 22:08:12 -0500 Received: by mail-qc0-f179.google.com with SMTP id o8so3586489qcw.10 for <18970@debbugs.gnu.org>; Fri, 07 Nov 2014 19:08:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:message-id:date:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=M+cvDZIKlN3ax4lBVs1b7jjkSRg0yIcj5EVzM/N+/9Q=; b=pEWXgJlOSUsd4mEE6TNRyFsRgvogyfPN2RLy7Lf7DpVEKYnIhS3lm+4FODIGCWn8A7 kSmViQsybkQFIN1opKaCvAOBzktKOoNCObRTf0knSfWJn7cKVx66ZHggUrfe9srdhSix s9EYsCTp8abdc/eHeojqm0DwNYjO/5lLXVQh36IQUrUn2+4qAOAqaJGkAI12xdjGSsl5 JvaCgN60k6iaIfDZ5AiUB8Osfw6UxUSKPwcYp3C8VFcj2ejyvZmt2q7gn0xN8lgodILD qmbBqmxLzzOV7rgZh2joTiNpne/6I+mdGHJoqOAyn5eFts3gcLlrTzwwyDnOkKY8O+Hu BF2Q== X-Received: by 10.229.139.195 with SMTP id f3mr23393557qcu.3.1415416091423; Fri, 07 Nov 2014 19:08:11 -0800 (PST) Received: from [192.168.1.5] (pool-108-5-32-69.nwrknj.east.verizon.net. [108.5.32.69]) by mx.google.com with ESMTPSA id m8sm9958613qag.25.2014.11.07.19.08.09 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 07 Nov 2014 19:08:10 -0800 (PST) From: Piotr Sipika X-Google-Original-From: Piotr Sipika Message-ID: <545D8918.20707@gmail.com> Date: Fri, 07 Nov 2014 22:08:08 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Alan Mackenzie Subject: Re: bug#18970: 24.3; indent region fails in C++ mode after adding a #include References: <20141106115429.80515.qmail@mail.muc.de> <545D3F5E.8030801@gmail.com> <20141107232444.GE2865@acm.acm> In-Reply-To: <20141107232444.GE2865@acm.acm> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 18970 Cc: 18970@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 11/07/2014 06:24 PM, Alan Mackenzie wrote: > Either upgrade your Emacs to version 24.4, or apply the following patch > to ..../emacs-24.3/lisp/progmodes/cc-mode.el: I chose the former (upgrade to Emacs 24.4; built from source with exact options as shown in original bug report) and the erroneous behavior is no longer there. Thank you, again, for your help. Please feel free to close this bug as resolved. Cheers! Piotr From debbugs-submit-bounces@debbugs.gnu.org Sat Nov 08 03:29:59 2014 Received: (at 18970-done) by debbugs.gnu.org; 8 Nov 2014 08:29:59 +0000 Received: from localhost ([127.0.0.1]:53352 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xn1PC-0008Mc-Dw for submit@debbugs.gnu.org; Sat, 08 Nov 2014 03:29:58 -0500 Received: from colin.muc.de ([193.149.48.1]:13485 helo=mail.muc.de) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xn1PA-0008MT-My for 18970-done@debbugs.gnu.org; Sat, 08 Nov 2014 03:29:57 -0500 Received: (qmail 19158 invoked by uid 3782); 8 Nov 2014 08:29:53 -0000 Received: from acm.muc.de (pD951B668.dip0.t-ipconnect.de [217.81.182.104]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sat, 08 Nov 2014 09:29:52 +0100 Received: (qmail 2719 invoked by uid 1000); 8 Nov 2014 08:29:15 -0000 Date: Sat, 8 Nov 2014 08:29:15 +0000 To: 18970-done@debbugs.gnu.org Subject: Re: bug#18970: 24.3; indent region fails in C++ mode after adding a #include Message-ID: <20141108082914.GA2592@acm.acm> References: <20141106115429.80515.qmail@mail.muc.de> <545D3F5E.8030801@gmail.com> <20141107232444.GE2865@acm.acm> <545D8918.20707@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <545D8918.20707@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: 18970-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.3 (-) The bug was fixed on 2013-05-27 in revision #112742, and released in Emacs 24.4. -- Alan Mackenzie (Nuremberg, Germany). From unknown Fri Jun 20 07:09:43 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 06 Dec 2014 12:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator