bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#681: Wrong C++ indentation in batch mode


From: Vivien Mallet
Subject: bug#681: Wrong C++ indentation in batch mode
Date: Tue, 07 Jan 2014 16:36:36 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Hi Bastien,

Bastien Guerry <address@hidden> writes:
> I can't reproduce this.  I get the correct indentation.
>
> I'm closing this bug report, feel free to reopen it if needed.

Under Emacs 24.3.1, I still get the same problem. Let me be a little bit
more specific. Create a file, say "test.cpp" with:

template <class A, class B>
Derived<A, B>::Derived():
  Base<A,
       B>() // Problem: wrong indentation in batch mode.
{
  int i:
}

This is what interactive mode gives after indentation.

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 <class A, class B>
Derived<A, B>::Derived():
  Base<A,
  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.

Vivien.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]