9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] tabstops
@ 2012-11-16 11:12 Steve Simon
  2012-11-16 11:37 ` dexen deVries
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Steve Simon @ 2012-11-16 11:12 UTC (permalink / raw)
  To: 9fans

I am working on a project that insists on 4 space indentation of code.

I can change the tabstop environment variable so I layout the code
how they want but I am still inderting tabs into my source.

I can use russ's tab(1) to convert the tabs to whitespace before every
checkin, but thats a bit painful.

anyone hacked sam to replace tabs with spaces or found a similar workaround?

I know this is horrid but what can I do, I am outnumbered (as usual).

-Steve



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [9fans] tabstops
  2012-11-16 11:12 [9fans] tabstops Steve Simon
@ 2012-11-16 11:37 ` dexen deVries
  2012-11-16 11:58   ` Nemo
  2012-11-16 12:09 ` lucio
  2012-11-16 13:12 ` Juan Fuentes
  2 siblings, 1 reply; 6+ messages in thread
From: dexen deVries @ 2012-11-16 11:37 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

On Friday 16 of November 2012 11:12:38 Steve Simon wrote:
> I am working on a project that insists on 4 space indentation of code.
> 
> I can change the tabstop environment variable so I layout the code
> how they want but I am still inderting tabs into my source.
> 
> I can use russ's tab(1) to convert the tabs to whitespace before every
> checkin, but thats a bit painful.

create tabfs, a stacking FS? convert leading tabs to spaces on write(3), 
convert leading quartets of spaces to tabs on read(3).

IIRC there was already some stacking FS doing somet ranslation, perhaps it was 
CRLF <->LF

-- 
dexen deVries

[[[↓][→]]]


Reality is just a convenient measure of complexity.
                -- Alvy Ray Smith



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [9fans] tabstops
  2012-11-16 11:37 ` dexen deVries
@ 2012-11-16 11:58   ` Nemo
  2012-11-16 12:11     ` lucio
  0 siblings, 1 reply; 6+ messages in thread
From: Nemo @ 2012-11-16 11:58 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

or a script that does everything for you. 
you edit at one tree and Rin the script
which copies to another replaces and submits. 

On Nov 16, 2012, at 12:37 PM, dexen deVries <dexen.devries@gmail.com> wrote:

> On Friday 16 of November 2012 11:12:38 Steve Simon wrote:
>> I am working on a project that insists on 4 space indentation of code.
>> 
>> I can change the tabstop environment variable so I layout the code
>> how they want but I am still inderting tabs into my source.
>> 
>> I can use russ's tab(1) to convert the tabs to whitespace before every
>> checkin, but thats a bit painful.
> 
> create tabfs, a stacking FS? convert leading tabs to spaces on write(3), 
> convert leading quartets of spaces to tabs on read(3).
> 
> IIRC there was already some stacking FS doing somet ranslation, perhaps it was 
> CRLF <->LF
> 
> -- 
> dexen deVries
> 
> [[[↓][→]]]
> 
> 
> Reality is just a convenient measure of complexity.
>                -- Alvy Ray Smith



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [9fans] tabstops
  2012-11-16 11:12 [9fans] tabstops Steve Simon
  2012-11-16 11:37 ` dexen deVries
@ 2012-11-16 12:09 ` lucio
  2012-11-16 13:12 ` Juan Fuentes
  2 siblings, 0 replies; 6+ messages in thread
From: lucio @ 2012-11-16 12:09 UTC (permalink / raw)
  To: 9fans

> anyone hacked sam to replace tabs with spaces or found a similar workaround?

Would it not be most practical to hook tab(1) onto Sam's "w" command?

++L




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [9fans] tabstops
  2012-11-16 11:58   ` Nemo
@ 2012-11-16 12:11     ` lucio
  0 siblings, 0 replies; 6+ messages in thread
From: lucio @ 2012-11-16 12:11 UTC (permalink / raw)
  To: 9fans

> or a script that does everything for you.

Check-in functions in most version control systems allow you to run a
script, so that may also be an option.

++L




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [9fans] tabstops
  2012-11-16 11:12 [9fans] tabstops Steve Simon
  2012-11-16 11:37 ` dexen deVries
  2012-11-16 12:09 ` lucio
@ 2012-11-16 13:12 ` Juan Fuentes
  2 siblings, 0 replies; 6+ messages in thread
From: Juan Fuentes @ 2012-11-16 13:12 UTC (permalink / raw)
  To: 9fans

I'm working a lot in Python and feel your pain, what I do is:

X/.* / ,|tab -n 4 -u

I normally work with several python files open in Sam, this has
worked well for me.

As already pointed out another solution is to run a script to do the
conversion for you on a pre-commit hook.



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-11-16 13:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-16 11:12 [9fans] tabstops Steve Simon
2012-11-16 11:37 ` dexen deVries
2012-11-16 11:58   ` Nemo
2012-11-16 12:11     ` lucio
2012-11-16 12:09 ` lucio
2012-11-16 13:12 ` Juan Fuentes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).