And, in fact, if you set up emacs to use tabs, emacs will use spaces to
get to a column which isn’t a tab column; it will simply use the
maximum number of tabs and then the minimum number of spaces.
Right, but then that breaks my example because it would insert more than 2
tabs before “bat, buzz)”
module Dumb
class Fake
def do_something?(bar, baz,
bat, buzz)
true
end
end
end
Change tab size to 8
module Dumb
class Fake
def do_something?(bar, baz,
bat, buzz)
true
end
end
end
The above is what you’d want, but if it had inserted the maximum number of
tabs before using spaces when tabs were size 2, then you’d have problems,
like bat/buzz going way off to the side.
However, since it is so easy to convert back and forth (tabs to spaces,
spaces to tabs) in emacs, one can certainly leave this as a matter of
personal preference.
There are two scenarios:
- “bat, buzz” is lined up with 2 tabs then as many spaces as necessary to
indent it properly
- “bat, buzz” is indented with the maximum number of tabs, then as many
spaces as needed to fill in
Number 1 works when tab size is changed, but number 2 doesn’t. As far as I
can tell, emacs does #2 when you hit the “tab” key, so unless you indent
manually, code using tabs won’t be portably aligned.
If I had the freedom to hit the “tab” key and have it “do the right thing”
while using the tab character, I’d use tabs, but it doesn’t, so I’ll stick
with spaces. I guess the only real solution to this is the python solution:
if it isn’t indented right, it doesn’t work… but I think I’ll stick with
Ruby.
Ben
···
On Sat August 2 2003 2:09 pm, Seth Kurtzberg wrote: