Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[9fans] Acme tabs to spaces

462 views
Skip to first unread message

Paul Lalonde

unread,
Dec 6, 2005, 1:43:53 PM12/6/05
to
So my new employer has a coding convention that tabs don't appear in
source, and that indent levels are 4 spaces. Ick. But in the
interest of global harmony, I'm willing to adapt. I know I can
trivially convert the tabs to spaces at any given time, and set
$tabstops to 4 to get the right width, but I have to do the
conversion with each file I save. Ick.
Is there some automatic tab conversion code somewhere in Acme? Where
would be the sane place to put such a thing? (yes, I already know
there is no sane place for such a thing...)

Paul

andrey mirtchovski

unread,
Dec 6, 2005, 1:46:56 PM12/6/05
to
tab/untab scripts? presumably you'd like to have something that
reverses spaces to tabs when you open a file for editing.

Russ Cox

unread,
Dec 6, 2005, 1:55:01 PM12/6/05
to

acme -a goes a long way to making typing four spaces an okay
thing to do by hand.

everyone has their own programs to convert.
mine is in /n/sources/contrib/rsc/cmd/tab.c

tab -n4 converts from spaces to tabs
tab -u -n4 converts from tabs to spaces

you could go a step further and create scripts T and U
for execution in acme windows that use $winid to
pick up the window contents, process it, and put it back.

russ

Rob Pike

unread,
Dec 6, 2005, 1:55:52 PM12/6/05
to
There's no code, but using -a helps a lot. We have a two-space
indent rule here and I hate it but I've adapted.

-rob

pl...@sigint.cs.purdue.edu

unread,
Dec 6, 2005, 2:07:20 PM12/6/05
to
On 12/6/05, Paul Lalonde <plal...@telus.net> wrote:
> Is there some automatic tab conversion code somewhere in Acme? Where
> would be the sane place to put such a thing? (yes, I already know
> there is no sane place for such a thing...)

Okay, I'll ask the obvious-- why not an en- and de-tabbing file server?

Skip Tavakkolian

unread,
Dec 6, 2005, 2:40:28 PM12/6/05
to
>> Is there some automatic tab conversion code somewhere in Acme? Where
>> would be the sane place to put such a thing? (yes, I already know
>> there is no sane place for such a thing...)
>
> Okay, I'll ask the obvious-- why not an en- and de-tabbing file server?

Kwel!!! it should read emacs style headers and figure out what the
tabbing should be on reads and on writes it should reduce multiple
consecutive spaces to one, to save space! perhaps it could have
auto-capitalization for '\.([0-9]|man)$' files!

i'm joking of course.

David Leimbach

unread,
Dec 6, 2005, 3:25:55 PM12/6/05
to
On 12/6/05, Rob Pike <rob...@gmail.com> wrote:
> There's no code, but using -a helps a lot. We have a two-space
> indent rule here and I hate it but I've adapted.
>
> -rob

Writing lots of C++ are we? :-)

Just a guess.

0 new messages