home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / indent-1.9.1-base.tgz / indent-1.9.1-base.tar / fsf / indent / Projects < prev    next >
Text File  |  1994-01-29  |  4KB  |  135 lines

  1. * wishlist from tarjeij@ulrik.uio.no
  2.  
  3.    struct a {   /* Cuddling variable with declaration independent of other */
  4.       int b;    /* settings */
  5.    } c;
  6.  
  7.    if (condition)   /* Force a blank line after single statement ifs. */
  8.       whatever;     /* force single statment to begin on new line */
  9.  
  10.  
  11.    while (*c = *p)  /* Force semicolon on new line. Same with for and if */
  12.      ;              /* (Force single statement while, do, to begin statement
  13.             /* on new line) */
  14.  
  15.  
  16. * Consider an option to use spaces rather than tabs in output.
  17.  
  18. * 'whitesmiths style', apparently after the examples shipped with
  19.   that firm's compiler.  It differs from the GNU style mainly in that
  20.   the statements inside braces are lined up with the braces.  E.g.:
  21.  
  22.   int main(int argc, char *argv[])
  23.       {
  24.       if (argc <= 1)
  25.       printf("No args\n");
  26.       else
  27.       {
  28.       switch (argc)
  29.           {
  30.           case 2:
  31.           printf("One arg\n");
  32.           break;
  33.           default:
  34.           printf("Lotsa args\n");
  35.           break;
  36.           }
  37.       }
  38.       return EXIT_SUCCESS;
  39.       }
  40.  
  41. * Someone requested an option to keep cases statments all on one line.
  42.  
  43. * Consider an option to produce "char* c" rather than  "char *c"
  44.  
  45. *  There is no way to specify that a unary & (as in address-of
  46.    operator) not preceed it's argument by a space.
  47. [rms: I agree that is a desirable mode we should support somehow.]
  48.  
  49.  
  50. *  It would be nice to have a different line length for comments than
  51.    for code.
  52. [rms: I agree that is a desirable mode we should support somehow.
  53. It should not be terribly hard.]
  54.  
  55.  
  56. *  Indent gets confused by a multiple "C" statements nested in a macro:
  57.  
  58.    This line:
  59.  
  60.     CHECK_ZERO(rpmsg->rip_res, tracef(" reserved fields not zero"); break );
  61.  
  62.    yields these errors:
  63.  
  64.     ../rip.c: 115: Unbalanced parens
  65.     ../rip.c: 115: Line broken
  66.     ../rip.c: 115: Extra )
  67.  
  68. [rms: Code like this appears in other programs too.
  69. For example, toplev.c in GCC.  So it is important not to get too upset
  70. when things like this appear in the input.]
  71.  
  72.  
  73. Add a new option specifying how goto labels are indented.
  74.  
  75. Make it so that the line numbers indent reports are the real line
  76. numbers (currently it is often off by a few).
  77.  
  78. Error recover should probably be enhanced.  At a minimum, "indent
  79. foo.c" should not overwrite foo.c when it gets an error.  Fancy error
  80. recover is probably not worth the effort because indent is pretty
  81. fast.  Stopping after the first error might be more helpful than the
  82. current error cascades.
  83.  
  84. Make the -nss option cause
  85.   while (foo)
  86.     ;
  87. This is the real alternative to 
  88.   while (foo) ;
  89.  
  90. Look at all the undocumented options, and determine which of them are
  91. bug-free enough that they should be documented.
  92.  
  93.     1) Is it possible to control how indent puts white space *within*
  94. an expression?  I notice that "(x*y<5)" comes out like "(x * y < 5)".  Can
  95. I configure "indent" to put spaces around "the following list of characters"
  96. and do not put spaces around "the following list of characters"?  I.E. Can
  97. I make it put spaces around "< > + - || &&" and *not* put spaces around
  98. "* / ^ &", etc. ?
  99.  
  100.  
  101. Consider leaving the spacing between the preprocessor
  102. # and the "if", "endif", etc. and indent that line as if it were
  103. a regular if () in C.
  104.  
  105. Thus, given
  106.  
  107. main()
  108. {
  109.     int x = 1, y = 1, z = 1;
  110.     if (x)
  111.     if (y)
  112.         if (z)
  113. #        ifdef FOO
  114.             printf("hello\n");
  115. #        else FOO
  116.             printf("world\n");
  117. #        endif FOO
  118. }
  119.  
  120.  
  121.  
  122. main()
  123. {
  124.     int             x = 1, y = 1, z = 1;
  125.     if (x)
  126.     if (y)
  127.         if (z)
  128. #               ifdef FOO
  129.             printf("hello\n");
  130. #               else    /* FOO */
  131.             printf("world\n");
  132. #               endif    /* FOO */
  133. }
  134.  
  135.