From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?UTF-8?Q?=EF=BC=AF?= =?UTF-8?Q?=EF=BC=A6=EF=BC=A6=EF=BC=A9=EF=BC=A3=EF=BC=A5=E3=80=80ZERO?= Newsgroups: gmane.emacs.bugs Subject: bug#681: Wrong C++ indentation in batch mode Date: Mon, 11 Aug 2008 02:12:04 +0900 Message-ID: <001101c8fb0c$3c615450$0100a8c0@yourhigxg9gyo4> References: <200808091726.22907.Vivien.Mallet@inria.fr> Reply-To: =?UTF-8?Q?=EF=BC=AF?= =?UTF-8?Q?=EF=BC=A6=EF=BC=A6=EF=BC=A9=EF=BC=A3=EF=BC=A5=E3=80=80ZERO?= , 681@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset="utf-8"; reply-type=original Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1218389278 24645 80.91.229.12 (10 Aug 2008 17:27:58 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 10 Aug 2008 17:27:58 +0000 (UTC) To: "Vivien Mallet" , <681@emacsbugs.donarmstrong.com> Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Aug 10 19:28:49 2008 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KSEil-0001fK-0w for geb-bug-gnu-emacs@m.gmane.org; Sun, 10 Aug 2008 19:28:47 +0200 Original-Received: from localhost ([127.0.0.1]:49862 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KSEhp-0002MU-27 for geb-bug-gnu-emacs@m.gmane.org; Sun, 10 Aug 2008 13:27:49 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KSEhW-00024B-Ty for bug-gnu-emacs@gnu.org; Sun, 10 Aug 2008 13:27:30 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KSEhU-00021Z-5D for bug-gnu-emacs@gnu.org; Sun, 10 Aug 2008 13:27:29 -0400 Original-Received: from [199.232.76.173] (port=34217 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KSEhT-00020o-OR for bug-gnu-emacs@gnu.org; Sun, 10 Aug 2008 13:27:27 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:54512) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KSEhT-0002P9-7R for bug-gnu-emacs@gnu.org; Sun, 10 Aug 2008 13:27:27 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m7AHROXt014661; Sun, 10 Aug 2008 10:27:25 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id m7AHK8fw012114; Sun, 10 Aug 2008 10:20:08 -0700 X-Loop: don@donarmstrong.com Resent-From: =?UTF-8?Q?=EF=BC=AF?= =?UTF-8?Q?=EF=BC=A6=EF=BC=A6=EF=BC=A9=EF=BC=A3=EF=BC=A5=E3=80=80ZERO?= Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Sun, 10 Aug 2008 17:20:08 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 681 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 681-submit@emacsbugs.donarmstrong.com id=B681.121838833410168 (code B ref 681); Sun, 10 Aug 2008 17:20:08 +0000 Original-Received: (at 681) by emacsbugs.donarmstrong.com; 10 Aug 2008 17:12:14 +0000 Original-Received: from smtp.air.ocn.ne.jp (air.ocn.ne.jp [122.1.235.141]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m7AHCA1w010157 for <681@emacsbugs.donarmstrong.com>; Sun, 10 Aug 2008 10:12:11 -0700 Original-Received: from yourhigxg9gyo4 (p8043-ipad606marunouchi.tokyo.ocn.ne.jp [124.85.153.43]) by smtp.air.ocn.ne.jp (Postfix) with SMTP id 037642EB7; Mon, 11 Aug 2008 02:12:10 +0900 (JST) X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.3138 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198 X-CrossAssassin-Score: 3 X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Resent-Date: Sun, 10 Aug 2008 13:27:28 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:19242 Archived-At: Do not send me any mail! NO thank you!! ----- Original Message ----- From: "Vivien Mallet" To: Sent: Sunday, August 10, 2008 12:26 AM Subject: bug#681: Wrong C++ indentation in batch mode > Hello, > > The indentation in C++ mode does not seem to work properly in batch mode > with > the following code (indented in interactive mode): > """ > template > Derived::Derived(): > Base B>() // Problem: wrong indentation in batch mode. > { > } > """ > > Now, define the Lisp function: > (defun cpp_indent () > (c-set-style "gnu") > (c++-mode) > (indent-region (point-min) (point-max) ()) > (save-buffer) > ) > And apply it the previous function. It will result in: > """ > template > Derived::Derived(): > Base B>() // Problem: wrong indentation in batch mode. > { > } > """ > which is inconsistent with the interactive and is not, I presume, the > targeted result. > I found the problem in Emacs 23.0.60.1 (emacs snapshot in Kubuntu 8.04) > and > in Emacs 22.1.3. It does not appear in Emacs 21.4.1 (Debian Etch). > > > Just an unrelated note about the indentation. I found a difference between > the > two latest versions I mentioned and the version 21.4.1. This code > (indented > with Emacs 22+): > """ > template > Derived0::Derived0(): > Base > () > { > } > """ > is indented by Emacs 21.4.1 as > """ > template > Derived0::Derived0(): > Base > () > { > } > """ > I like the new indentation better, and I suppose it was an improvement > introduced in the latest versions. I mention it, just in case... > > > I attach three files: > - test.cxx: a file to be indented (but already well indented); > - test-wrong_indentation.cxx: test.cxx after indentation in batch mode > with > Emacs 22+; > - cpp_indent.lisp: the indentation function. Used in: "emacs -batch > test.cxx - > l cpp_indent.lisp -f cpp_indent". > > > Thank you for your great work, > Vivien Mallet. >