Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #62976

Re: Searching online "indent"

From Ben Bacarisse <ben.usenet@bsb.me.uk>
Newsgroups comp.lang.c
Subject Re: Searching online "indent"
Date 2015-06-04 19:43 +0100
Organization A noiseless patient Spider
Message-ID <87oakvnwlk.fsf@bsb.me.uk> (permalink)
References <indent-20150604033951@ram.dialup.fu-berlin.de> <cta0gdFr31aU1@mid.individual.net> <Netbeans-20150604170036@ram.dialup.fu-berlin.de> <20150604125943.8fa4c0b46f4ab3a05bda7d8f@gmail.com>

Show all headers | View raw


Etienne Prud'homme <e.e.f.prudhomme@gmail.com> writes:

> On 4 Jun 2015 15:00:50 GMT
> ram@zedat.fu-berlin.de (Stefan Ram) wrote:
>
>> Ian Collins <ian-news@hotmail.com> writes:
>> >Netbeans (and probably most other IDEs) will.
>> 
>>   Yesterday, I was in a classroom looking for an on-line
>>   beautifier. Since I did not find one appropriate, I indeed
>>   did open Netbeans, which happened to be installed in that
>>   classroom. However, I had the impression that it only did
>>   support Java projects. I even was searching for »C« under the
>>   project types of »other«, but did not find it. 
>> 
>>   Netbeans would be a great solution, because it often is 
>>   installed in the classrooms where I need the beautfier!
>>   But the problem is: I can't find out how to enable its
>>   »C language mode«.
>> 
>
>    It's not online,  but I would recommand emacs. You  press [Alt]-x &
> tap indent-buffer.

(not available in my Emacs -- indent-region, yes, but not indent-buffer)

> You can also bind  a key to that command, but since
> it's not  really used, I  would not. You  may set different  styles of
> indentation. K&R, GNU, etc. You can also indent a region.

But I don't think this does what the OP wants.  Emacs indents line by
line, so if the line breaks are gone, or you've got odd lines already
(such as if (x) y = x; else x = y; all on one line) it won't split the
statement and indent the result.  The commonly used indent command has
the same restriction.

That requirement got snipped so it's easy to have missed it.  I wonder
if the suggestion to use NetBeans has the same flaw.

<snip>
-- 
Ben.

Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Re: Searching online "indent" Ian Collins <ian-news@hotmail.com> - 2015-06-04 15:54 +1200
  Re: Searching online "indent" "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-06-04 07:22 -0700
  Re: Searching online "indent" "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-06-04 08:55 -0700
  Re: Searching online "indent" "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-06-04 09:35 -0700
  Re: Searching online "indent" Etienne Prud'homme <e.e.f.prudhomme@gmail.com> - 2015-06-04 12:59 -0400
    Re: Searching online "indent" Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-06-04 19:43 +0100
      Re: Searching online "indent" Etienne <e.e.f.prudhomme@gmail.com> - 2015-06-04 15:09 -0400
      Re: Searching online "indent" James Kuyper <jameskuyper@verizon.net> - 2015-06-04 16:52 -0400
      Re: Searching online "indent" Morris Dovey <mrdovey@iedu.com> - 2015-06-04 16:37 -0500
        Re: Searching online "indent" James Kuyper <jameskuyper@verizon.net> - 2015-06-04 18:02 -0400
          Re: Searching online "indent" Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-06-04 23:37 +0100
  Re: Searching online "indent" Ian Collins <ian-news@hotmail.com> - 2015-06-05 07:23 +1200

csiph-web