From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#681: Wrong C++ indentation in batch mode Date: Tue, 29 Dec 2015 22:02:08 +0000 Message-ID: <20151229220208.GE1884@acm.fritz.box> References: <200808091726.22907.Vivien.Mallet@inria.fr> <87zjn8hu79.fsf@bzg.ath.cx> <87zjn7g5x7.fsf@verdandi.inria.fr> <87ppo3hiz0.fsf@bzg.ath.cx> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1451426423 1890 80.91.229.3 (29 Dec 2015 22:00:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 29 Dec 2015 22:00:23 +0000 (UTC) Cc: Bastien , Vivien Mallet , 681@debbugs.gnu.org To: Andrew Hyatt Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Dec 29 23:00:13 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aE2JQ-0002PC-9d for geb-bug-gnu-emacs@m.gmane.org; Tue, 29 Dec 2015 23:00:12 +0100 Original-Received: from localhost ([::1]:50333 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aE2JP-0002sI-O3 for geb-bug-gnu-emacs@m.gmane.org; Tue, 29 Dec 2015 17:00:11 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44410) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aE2JM-0002s8-2n for bug-gnu-emacs@gnu.org; Tue, 29 Dec 2015 17:00:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aE2JL-0002C0-4t for bug-gnu-emacs@gnu.org; Tue, 29 Dec 2015 17:00:08 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:41406) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aE2JH-00028m-BB; Tue, 29 Dec 2015 17:00:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1aE2JG-0005OQ-UI; Tue, 29 Dec 2015 17:00:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Tue, 29 Dec 2015 22:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 681 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: Original-Received: via spool by 681-submit@debbugs.gnu.org id=B681.145142639620690 (code B ref 681); Tue, 29 Dec 2015 22:00:02 +0000 Original-Received: (at 681) by debbugs.gnu.org; 29 Dec 2015 21:59:56 +0000 Original-Received: from localhost ([127.0.0.1]:49008 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aE2JA-0005Ne-4B for submit@debbugs.gnu.org; Tue, 29 Dec 2015 16:59:56 -0500 Original-Received: from mail.muc.de ([193.149.48.3]:57339) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aE2J8-0005NU-9k for 681@debbugs.gnu.org; Tue, 29 Dec 2015 16:59:55 -0500 Original-Received: (qmail 75505 invoked by uid 3782); 29 Dec 2015 21:59:52 -0000 Original-Received: from acm.muc.de (p579E804C.dip0.t-ipconnect.de [87.158.128.76]) by colin.muc.de (tmda-ofmipd) with ESMTP; Tue, 29 Dec 2015 22:59:50 +0100 Original-Received: (qmail 20574 invoked by uid 1000); 29 Dec 2015 22:02:08 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:110988 Archived-At: Hello, Andrew. On Mon, Dec 28, 2015 at 08:18:02PM -0500, Andrew Hyatt wrote: > Bastien writes: > > Hi Vivien, > > Vivien Mallet writes: > >> Now, launch from command line: > >> \emacs -Q test.cpp --batch --eval="(defun cpp_indent () (c-set-style \"gnu\") (c++-mode) (indent-region (point-min) (point-max) ()) (save-buffer))" --eval="(cpp_indent)" > >> You should get: > >> template > >> Derived::Derived(): > >> Base >> B>() // Problem: wrong indentation in batch mode. > >> { > >> int i: > >> } > >> In addition, it seems that "c-set-style" is not honored. It may be > >> "bsd", "k&r", etc. without any difference. > > Mhh... yes, I see now. > > I reopend the bug and will let someone more familiar > > with the code fix it. > I'm not the one more familiar, but I just want to record that this still > reproduces on emacs 25. I started looking at this back in 2011, but got stuck. I've still got my notes from then. I'll see if I can get this fixed now. -- Alan Mackenzie (Nuremberg, Germany).