Find the answer to your Linux question:
Results 1 to 4 of 4
Does anyone have their body inside the foreach loop indented? Here's what it looks like in emacs: Code: foreach ( $colors as $i ) { echo $i, ' '; } ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Engineer
    Join Date
    Nov 2002
    Location
    Queens, NY
    Posts
    1,319

    foreach and emacs indenting


    Does anyone have their body inside the foreach loop indented? Here's what it looks like in emacs:
    Code:
    foreach ( $colors as $i ) {
    echo $i, '
    ';
    }
    I would love it if the statement(s) inside the body were indented 2 spaces like in C.
    The best things in life are free.

  2. #2
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    My version of emacs indents that. Does your version have a PHP mode?

  3. #3
    Linux Engineer
    Join Date
    Nov 2002
    Location
    Queens, NY
    Posts
    1,319
    Yes, it does. Here's the weird thing. On one file, it indents perfectly. On another, it doesn't indent at all. As far as I can see, both don't have syntax errors and they run just fine. Could I possibly send you the files? My copy and paste still is non existent thanks to Qt2.
    The best things in life are free.

  4. #4
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    Yeah, sure.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •