From: Andreas L. <no...@sb...> - 2001-05-27 21:51:20
|
On 27 May 2001 23:21:16 +0200, Eric Bezault wrote: > > > Indentations from the left margin should be made up of tabs. > > > > Are you sure? > > Yes. That's what tabs are for. > > > I use Emacs and it's automatic indentation works great. > > I don't think so. Emacs spoils indentation. Is that what you > call "works great"? It's the only text editor that I have heard > of that produces such crap with indentation generating files > with a mixing of spaces and tabs. The big advantage with Emacs is it's support. You can get a mode for just anything. I don't need to learn new key bindings just because I need to do a SML assignement. The inital learning curve is steep, but it pays IMO. But let's not get into some religious editor war here. We have better to do (; > > I have been asking around how to solve the issue and Berend finally gave > > me the best advice: Don't use tabs. > > And then someone else will modify your code and put tabs > (because everyone, except people using Emacs, uses tabs) > and then we get ugly layout again. The same argument can be made for spaces only. > And the editors that I use works fine with autoindenting > with tabs, but not with spaces. This is normal since > tabs of for indentation, not spaces. What are you using? > Isn't it possible to do a global search/replace of > spaces to tabs before you save your file or before > you commit it to CVS? Something like that: > > sed -e 's/ /\t/g' file > file That was actually a point I forgot to mention. We _should_ come up with a standard (and be it spaces only) and we _should_ come up with tools (as part of GOBO) that automate as much of the bookkeeping work as possible. Indentation can be done completly automatic and we should strive for this goal. We may not archive this in the short term, but we can start with little scripts as yours. In the long term, I think your gelint effort could be used as a basis for a GOBO style pretty printer. Then before a checkin I run the pretty printer and before opening a file, I run the Emacs indentation command to get my preferred indentation. > Or better, Emacs is open source, right? So why this problem > has not been fixed over the years? It's not the first time > that I heard about this problem with Emacs, and only with > Emacs! So, even if Emacs users like the current behavior, > there should be a configurable way to switch it off and use > real tabs instead. That's the least I would expect from a > text editor: that it saves to disk what I typed. So if I > type a tab and don't want spaces to appear instead in my > file. Yeah, and it is possible. I once started to do it. All I have to do (IIRC) is to modify the Eiffel mode to just use multiples of TAB for intending. I don't know Lisp to well, so I stopped - maybe I find some time for this again someday... (; > > Please also have a look at: http://www.jwz.org/doc/tabs-vs-spaces.html > > It just says that Emacs is crap and that you should > switch to Vim ;-) No comment (; regards, Andreas |