Re: Subversion Repository for Euphoria
- Posted by Robert Craig <rds at RapidEuphoria.com> Nov 25, 2006
- 516 views
Ricardo M. Forno wrote: > However, I think ed indenting is inconsistent because when you edit with > another editor Euphoria source files generated by ed then the tabs get > messed up. > I think this is because ed uses tabs in certain cases and spaces in other > circumstances, for the same file. Unless you change ed.ex, ed uses tab=4 for Euphoria files as well as .c and .h files. This lets you easily indent your Euphoria or C code, at 4 spaces per indent *while you are editing*. When you save a file with ed, it converts to tab=8, so two leading tab4's on a line of source in the editor become one tab8 in the file. I did it this way because most of the Linux and Windows world assumes that a tab stored in a file means tab=8. Most editors let you change this, but many people just leave it as tab=8, and many printers also assume tab=8. I think some editors have a "soft tab" that might be 4 when you are typing, while a "hard tab" in a file means 8. I recall, at the start of a project many years ago, for a company I used to work for, we had a conflict because some people used editors with tab=4 and others used editors with tab=8. Most people agreed that 4 spaces per indent was probably better than 8 spaces, but we had to get everyone to set their editors to tab=4, rather than having some people type, say, one tab plus 4 spaces to indent 3 levels, while others typed 3 tabs. > I've found that the best way to deal with inconsistent indenting and > general tabbing is to not use tab characters at all, replacing them by > spaces. I could easily change ed to store source files with all tabs replaced by blanks (4 blanks per tab, roughly speaking). This would eliminate any confusion, while still letting ed users use the tab key to move 4 spaces, since ed converts leading whitespace *back* into tabs when you load a program file. I think I resisted this idea many years ago because it would waste a bit of space and make scanning of the source file take a tiny bit longer. (A tab8 can be scanned faster than 8 blanks). I propose that we keep indenting the Euphoria and C source code at 4 spaces per indent, but I'm open to suggestion on how we can avoid "tab wars". Regards, Rob Craig Rapid Deployment Software http://www.RapidEuphoria.com