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: Mon, 4 Jan 2016 23:16:42 +0000 Message-ID: <20160104231642.GA13716@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 1451949327 3595 80.91.229.3 (4 Jan 2016 23:15:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 4 Jan 2016 23:15:27 +0000 (UTC) Cc: Bastien , Andrew Hyatt , 681@debbugs.gnu.org To: Vivien Mallet Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jan 05 00:15:15 2016 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 1aGELG-0000lJ-JM for geb-bug-gnu-emacs@m.gmane.org; Tue, 05 Jan 2016 00:15:10 +0100 Original-Received: from localhost ([::1]:47463 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aGELF-0007VC-Oj for geb-bug-gnu-emacs@m.gmane.org; Mon, 04 Jan 2016 18:15:09 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56130) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aGELB-0007Uz-Pq for bug-gnu-emacs@gnu.org; Mon, 04 Jan 2016 18:15:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aGEL8-00074l-FG for bug-gnu-emacs@gnu.org; Mon, 04 Jan 2016 18:15:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:49742) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aGEL8-00073p-Cn; Mon, 04 Jan 2016 18:15:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1aGEL8-00083R-1j; Mon, 04 Jan 2016 18:15: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: Mon, 04 Jan 2016 23:15: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.145194927130901 (code B ref 681); Mon, 04 Jan 2016 23:15:02 +0000 Original-Received: (at 681) by debbugs.gnu.org; 4 Jan 2016 23:14:31 +0000 Original-Received: from localhost ([127.0.0.1]:37962 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aGEKc-00082L-NW for submit@debbugs.gnu.org; Mon, 04 Jan 2016 18:14:30 -0500 Original-Received: from mail.muc.de ([193.149.48.3]:15943) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aGEKb-00082C-4l for 681@debbugs.gnu.org; Mon, 04 Jan 2016 18:14:29 -0500 Original-Received: (qmail 90585 invoked by uid 3782); 4 Jan 2016 23:14:27 -0000 Original-Received: from acm.muc.de (p548A51DA.dip0.t-ipconnect.de [84.138.81.218]) by colin.muc.de (tmda-ofmipd) with ESMTP; Tue, 05 Jan 2016 00:14:25 +0100 Original-Received: (qmail 940 invoked by uid 1000); 4 Jan 2016 23:16:42 -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:111219 Archived-At: Hello Vivien. 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've committed what I hope is a fix to the emacs-25 branch at savannah. Sorry it's taken (a lot) longer than it should have done. Would you please tell me what version of Emacs you're currently using, and I will try to adapt the patch for that version. Then I will ask you to try out the patch and let me know whether or not there are still errors. Then, hopefully, we can close this bug. -- Alan Mackenzie (Nuremberg, Germany).