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 01:42:48 +0900 Message-ID: <002701c8fb09$4fbef050$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 1218388069 21749 80.91.229.12 (10 Aug 2008 17:07:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 10 Aug 2008 17:07:49 +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:08:40 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 1KSEP8-00055O-Di for geb-bug-gnu-emacs@m.gmane.org; Sun, 10 Aug 2008 19:08:30 +0200 Original-Received: from localhost ([127.0.0.1]:34547 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KSEOC-0007Qi-HB for geb-bug-gnu-emacs@m.gmane.org; Sun, 10 Aug 2008 13:07:32 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KSEO8-0007QT-6Y for bug-gnu-emacs@gnu.org; Sun, 10 Aug 2008 13:07:28 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KSEO7-0007QB-GK for bug-gnu-emacs@gnu.org; Sun, 10 Aug 2008 13:07:27 -0400 Original-Received: from [199.232.76.173] (port=59591 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KSEO7-0007Q8-9q for bug-gnu-emacs@gnu.org; Sun, 10 Aug 2008 13:07:27 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:47818) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KSEO6-0000Xj-Ry for bug-gnu-emacs@gnu.org; Sun, 10 Aug 2008 13:07: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 m7AH7O5U008649; Sun, 10 Aug 2008 10:07:24 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id m7AH04wB005215; Sun, 10 Aug 2008 10:00:04 -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:00:04 +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.12183870793367 (code B ref 681); Sun, 10 Aug 2008 17:00:04 +0000 Original-Received: (at 681) by emacsbugs.donarmstrong.com; 10 Aug 2008 16:51:19 +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 m7AGpFEJ003361 for <681@emacsbugs.donarmstrong.com>; Sun, 10 Aug 2008 09:51:16 -0700 Original-Received: from yourhigxg9gyo4 (p2121-ipad70marunouchi.tokyo.ocn.ne.jp [220.97.27.121]) by smtp.air.ocn.ne.jp (Postfix) with SMTP id 8632D2F54; Mon, 11 Aug 2008 01:51:13 +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-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Resent-Date: Sun, 10 Aug 2008 13:07:27 -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:19240 Archived-At: Do not send me any mail! NO thank you!! 1----- 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. >