9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] indenting source?
@ 2004-03-01 20:27 David Tolpin
  2004-03-01 20:37 ` andrey mirtchovski
                   ` (3 more replies)
  0 siblings, 4 replies; 25+ messages in thread
From: David Tolpin @ 2004-03-01 20:27 UTC (permalink / raw)
  To: 9fans


Hi,

many sources in libc are written with four characters indent. What
editor have they been written with? sam is rather incovenient to
input text with indents other than one tab, or am I missing something?

David


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

* Re: [9fans] indenting source?
  2004-03-01 20:27 [9fans] indenting source? David Tolpin
@ 2004-03-01 20:37 ` andrey mirtchovski
  2004-03-01 20:46   ` David Tolpin
  2004-03-01 20:52 ` rog
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 25+ messages in thread
From: andrey mirtchovski @ 2004-03-01 20:37 UTC (permalink / raw)
  To: 9fans

> Hi,
> 
> many sources in libc are written with four characters indent. What
> editor have they been written with? sam is rather incovenient to
> input text with indents other than one tab, or am I missing something?
> 
> David

which libraries are those?  i haven't seen anything but tabs for
indentation.

if you edit using acme(1) you can set $tabstop to whatever you like,
but the source will still have tabs.

andrey



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

* Re: [9fans] indenting source?
  2004-03-01 20:37 ` andrey mirtchovski
@ 2004-03-01 20:46   ` David Tolpin
  0 siblings, 0 replies; 25+ messages in thread
From: David Tolpin @ 2004-03-01 20:46 UTC (permalink / raw)
  To: 9fans

> > many sources in libc are written with four characters indent. What
> > editor have they been written with? sam is rather incovenient to
> > input text with indents other than one tab, or am I missing something?
> > 
> > David
>
> which libraries are those?  i haven't seen anything but tabs for
> indentation.
>
> if you edit using acme(1) you can set $tabstop to whatever you like,
> but the source will still have tabs.

You are right. There are tabs there.
I just cat /sys/src/libc/port/abs.c and saw 4 positions indent
in term. Under examination, there are tabs there, and they
show as 8 characters indents in sam.

Can it be controlled somehow in window?


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

* Re: [9fans] indenting source?
  2004-03-01 20:27 [9fans] indenting source? David Tolpin
  2004-03-01 20:37 ` andrey mirtchovski
@ 2004-03-01 20:52 ` rog
  2004-03-02  2:13 ` boyd, rounin
  2004-03-02  9:36 ` Douglas A. Gwyn
  3 siblings, 0 replies; 25+ messages in thread
From: rog @ 2004-03-01 20:52 UTC (permalink / raw)
  To: 9fans

> many sources in libc are written with four characters indent.

% cd /sys/src/libc
% grep '^ +[^*]' */*.c

gives just the following lines of code for me:

port/pow.c: zreturn:
port/strtoul.c: 	if(base<2 || 36<base)
port/strtoul.c:    Return:

(plus some table initialisation data, which doesn't count.)



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

* Re: [9fans] indenting source?
  2004-03-01 20:27 [9fans] indenting source? David Tolpin
  2004-03-01 20:37 ` andrey mirtchovski
  2004-03-01 20:52 ` rog
@ 2004-03-02  2:13 ` boyd, rounin
  2004-03-02  6:00   ` David Tolpin
  2004-03-02  9:36 ` Douglas A. Gwyn
  3 siblings, 1 reply; 25+ messages in thread
From: boyd, rounin @ 2004-03-02  2:13 UTC (permalink / raw)
  To: 9fans

From: "David Tolpin" <dvd@davidashen.net>
> editor have they been written with? sam is rather incovenient to
> input text with indents other than one tab, or am I missing something?

pauvre cherie



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

* Re: [9fans] indenting source?
  2004-03-02  2:13 ` boyd, rounin
@ 2004-03-02  6:00   ` David Tolpin
  2004-03-02  9:06     ` Rob Pike
  2004-03-02 16:05     ` boyd, rounin
  0 siblings, 2 replies; 25+ messages in thread
From: David Tolpin @ 2004-03-02  6:00 UTC (permalink / raw)
  To: 9fans

> > editor have they been written with? sam is rather incovenient to
> > input text with indents other than one tab, or am I missing something?
>
> pauvre cherie
>

I don't know what is that 'cherie' that is poor, but please
how can I make my text windows in rio show indents in increments of 8
for tabs, and not of 4?

Please use English.

David


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

* Re: [9fans] indenting source?
  2004-03-02  6:00   ` David Tolpin
@ 2004-03-02  9:06     ` Rob Pike
  2004-03-02  9:19       ` David Tolpin
  2004-03-02 16:05     ` boyd, rounin
  1 sibling, 1 reply; 25+ messages in thread
From: Rob Pike @ 2004-03-02  9:06 UTC (permalink / raw)
  To: 9fans

>
> I don't know what is that 'cherie' that is poor, but please
> how can I make my text windows in rio show indents in increments of 8
> for tabs, and not of 4?
>
> Please use English.
>

how about using shell?
	tabstop=8 rio

-rob



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

* Re: [9fans] indenting source?
  2004-03-02  9:06     ` Rob Pike
@ 2004-03-02  9:19       ` David Tolpin
  2004-03-02  9:26         ` David Presotto
  0 siblings, 1 reply; 25+ messages in thread
From: David Tolpin @ 2004-03-02  9:19 UTC (permalink / raw)
  To: 9fans

> >
> > I don't know what is that 'cherie' that is poor, but please
> > how can I make my text windows in rio show indents in increments of 8
> > for tabs, and not of 4?
> >
> > Please use English.
> >
>
> how about using shell?
> 	tabstop=8 rio

Yes, I used grep to find that I must restart rio, not just
open a window, for the setting to take effect. It is obvious
when you know how it is working, but neither the page on 'window'
says anything about it, nor man rio mentions tabstop.

Besides, I also wondered in a followup, why acme repeats the
code in rio to figure out the value for tabstop? Is it intended
to run outside of rio? The code seems to be just copied from
rio.c.

The confusion has come from the fact that by default sam uses 8 spaces
per tab, rio uses 4 spaces for tab. And nowhere in the documentation (besides
the sources) could I easily find  how to affect it.


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

* Re: [9fans] indenting source?
  2004-03-02  9:19       ` David Tolpin
@ 2004-03-02  9:26         ` David Presotto
  2004-03-02  9:30           ` David Tolpin
  2004-03-02  9:31           ` Charles Forsyth
  0 siblings, 2 replies; 25+ messages in thread
From: David Presotto @ 2004-03-02  9:26 UTC (permalink / raw)
  To: 9fans

several people do indeed run acme instead of rio.  Rio just offers an interface within
each window that looks like what you get from the OS itself, i.e., rio's windows are
to a certain extent screen/mouse/keyboard VM's.  If you start up acme first, you
can live witout rio.

For that matter, you could start up sam instead of rio and do everything from there.
Just type a ! in the command window for running commands.  Might seem a bit limiting
though.


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

* Re: [9fans] indenting source?
  2004-03-02  9:26         ` David Presotto
@ 2004-03-02  9:30           ` David Tolpin
  2004-03-02 10:10             ` lucio
  2004-03-02  9:31           ` Charles Forsyth
  1 sibling, 1 reply; 25+ messages in thread
From: David Tolpin @ 2004-03-02  9:30 UTC (permalink / raw)
  To: 9fans

> several people do indeed run acme instead of rio.  Rio just offers an interface within
> each window that looks like what you get from the OS itself, i.e., rio's windows are
> to a certain extent screen/mouse/keyboard VM's.  If you start up acme first, you
> can live witout rio.

Thank you, I did not realize that. So I can launch a Plan 9 based 'kiosk'
with Acme as its only interface?

Great. That's what I need.


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

* Re: [9fans] indenting source?
  2004-03-02  9:31           ` Charles Forsyth
@ 2004-03-02  9:31             ` David Tolpin
  2004-03-02  9:43               ` Charles Forsyth
  0 siblings, 1 reply; 25+ messages in thread
From: David Tolpin @ 2004-03-02  9:31 UTC (permalink / raw)
  To: 9fans

> from intro(1) which are the first manual pages you see when you open the book!

Thank you. I don't have the book, just read recommended articles
and man whatever when I have a question.


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

* Re: [9fans] indenting source?
  2004-03-02  9:26         ` David Presotto
  2004-03-02  9:30           ` David Tolpin
@ 2004-03-02  9:31           ` Charles Forsyth
  2004-03-02  9:31             ` David Tolpin
  1 sibling, 1 reply; 25+ messages in thread
From: Charles Forsyth @ 2004-03-02  9:31 UTC (permalink / raw)
  To: 9fans

>>The confusion has come from the fact that by default sam uses 8 spaces
>>per tab, rio uses 4 spaces for tab. And nowhere in the documentation (besides
>>the sources) could I easily find  how to affect it.

          For historical reasons, sam uses a tab stop setting of 8
          spaces, while the other editors and window systems use 4
          spaces.  These defaults can be overridden by setting the
          value of the environment variable $tabstop to the desired
          number of spaces per tab.

from intro(1) which are the first manual pages you see when you open the book!



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

* Re: [9fans] indenting source?
  2004-03-01 20:27 [9fans] indenting source? David Tolpin
                   ` (2 preceding siblings ...)
  2004-03-02  2:13 ` boyd, rounin
@ 2004-03-02  9:36 ` Douglas A. Gwyn
  3 siblings, 0 replies; 25+ messages in thread
From: Douglas A. Gwyn @ 2004-03-02  9:36 UTC (permalink / raw)
  To: 9fans

David Tolpin wrote:
> many sources in libc are written with four characters indent. What
> editor have they been written with? sam is rather incovenient to
> input text with indents other than one tab, or am I missing something?

8-character tab stops were standard in the world of DEC,
nicely fitting the 6-character identifier size.  Unix
inherited this..  As to handling other tab settings, my
"retab" utility is by far the most flexible I have seen,
and it works nicely with sam's | command.  You're welcome
to a copy; just send e-mail (that doesn't look like spam).


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

* Re: [9fans] indenting source?
  2004-03-02  9:31             ` David Tolpin
@ 2004-03-02  9:43               ` Charles Forsyth
  2004-03-02  9:44                 ` David Presotto
  2004-03-02  9:45                 ` Geoff Collyer
  0 siblings, 2 replies; 25+ messages in thread
From: Charles Forsyth @ 2004-03-02  9:43 UTC (permalink / raw)
  To: 9fans

[-- Attachment #1: Type: text/plain, Size: 206 bytes --]

well, to be fair then, one might consider grep'ing /sys/man/?/*
before complaining that something is undocumented.

not that there aren't indeed things, even important things,
that are not documented.

[-- Attachment #2: Type: message/rfc822, Size: 2171 bytes --]

From: David Tolpin <dvd@davidashen.net>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] indenting source?
Date: Tue, 2 Mar 2004 13:31:30 +0400 (AMT)
Message-ID: <200403020931.i229VUgi071929@adat.davidashen.net>

> from intro(1) which are the first manual pages you see when you open the book!

Thank you. I don't have the book, just read recommended articles
and man whatever when I have a question.

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

* Re: [9fans] indenting source?
  2004-03-02  9:43               ` Charles Forsyth
@ 2004-03-02  9:44                 ` David Presotto
  2004-03-02  9:45                 ` Geoff Collyer
  1 sibling, 0 replies; 25+ messages in thread
From: David Presotto @ 2004-03-02  9:44 UTC (permalink / raw)
  To: 9fans

[-- Attachment #1: Type: text/plain, Size: 48 bytes --]

lookman helps too.  It is apropos BSD's apropos.

[-- Attachment #2: Type: message/rfc822, Size: 4449 bytes --]

[-- Attachment #2.1.1: Type: text/plain, Size: 206 bytes --]

well, to be fair then, one might consider grep'ing /sys/man/?/*
before complaining that something is undocumented.

not that there aren't indeed things, even important things,
that are not documented.

[-- Attachment #2.1.2: Type: message/rfc822, Size: 2171 bytes --]

From: David Tolpin <dvd@davidashen.net>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] indenting source?
Date: Tue, 2 Mar 2004 13:31:30 +0400 (AMT)
Message-ID: <200403020931.i229VUgi071929@adat.davidashen.net>

> from intro(1) which are the first manual pages you see when you open the book!

Thank you. I don't have the book, just read recommended articles
and man whatever when I have a question.

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

* Re: [9fans] indenting source?
  2004-03-02  9:43               ` Charles Forsyth
  2004-03-02  9:44                 ` David Presotto
@ 2004-03-02  9:45                 ` Geoff Collyer
  2004-03-02  9:50                   ` David Tolpin
  1 sibling, 1 reply; 25+ messages in thread
From: Geoff Collyer @ 2004-03-02  9:45 UTC (permalink / raw)
  To: 9fans

You don't even have to do that; you can just type

	lookman word

Thus `lookman tabstop' yields:

man 1 0intro # 0intro(1)
man 1 acme # acme(1)
man 2 html # html(2)



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

* Re: [9fans] indenting source?
  2004-03-02  9:45                 ` Geoff Collyer
@ 2004-03-02  9:50                   ` David Tolpin
  2004-03-02 10:00                     ` Geoff Collyer
  0 siblings, 1 reply; 25+ messages in thread
From: David Tolpin @ 2004-03-02  9:50 UTC (permalink / raw)
  To: 9fans

> You don't even have to do that; you can just type
>
> 	lookman word
>
> Thus `lookman tabstop' yields:
>
> man 1 0intro # 0intro(1)
> man 1 acme # acme(1)
> man 2 html # html(2)

The problem is that I did not know that I must look for
'tabstop' until I looked into the source and then I didn't
need the man.

I tried 

man rio
man sam
man window

read the pages through and didn't find a single mention
of the way tab widths can be adjusted. I realize now that
grep'ing /sys/man/*/* with '[^a-z]tab' would bring the
answer, but I realize it only when I know already what
to look for. I didn't have the right question before I knew
the answer.

David


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

* Re: [9fans] indenting source?
  2004-03-02  9:50                   ` David Tolpin
@ 2004-03-02 10:00                     ` Geoff Collyer
  2004-03-02 10:05                       ` David Tolpin
  0 siblings, 1 reply; 25+ messages in thread
From: Geoff Collyer @ 2004-03-02 10:00 UTC (permalink / raw)
  To: 9fans

[-- Attachment #1: Type: text/plain, Size: 165 bytes --]

`man acme' might have been a good guess.  `lookman tab stop' would
also have led you to the right pages.  Even `lookman tab width' would
have led you to acme(1).

[-- Attachment #2: Type: message/rfc822, Size: 2748 bytes --]

From: David Tolpin <dvd@davidashen.net>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] indenting source?
Date: Tue, 2 Mar 2004 13:50:46 +0400 (AMT)
Message-ID: <200403020950.i229ok5f072068@adat.davidashen.net>

> You don't even have to do that; you can just type
>
> 	lookman word
>
> Thus `lookman tabstop' yields:
>
> man 1 0intro # 0intro(1)
> man 1 acme # acme(1)
> man 2 html # html(2)

The problem is that I did not know that I must look for
'tabstop' until I looked into the source and then I didn't
need the man.

I tried 

man rio
man sam
man window

read the pages through and didn't find a single mention
of the way tab widths can be adjusted. I realize now that
grep'ing /sys/man/*/* with '[^a-z]tab' would bring the
answer, but I realize it only when I know already what
to look for. I didn't have the right question before I knew
the answer.

David

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

* Re: [9fans] indenting source?
  2004-03-02 10:00                     ` Geoff Collyer
@ 2004-03-02 10:05                       ` David Tolpin
  2004-03-02 10:36                         ` Geoff Collyer
  2004-03-02 16:34                         ` boyd, rounin
  0 siblings, 2 replies; 25+ messages in thread
From: David Tolpin @ 2004-03-02 10:05 UTC (permalink / raw)
  To: 9fans

> `man acme' might have been a good guess.  `lookman tab stop' would
> also have led you to the right pages.  Even `lookman tab width' would
> have led you to acme(1).

But I was not interested in doing it in acme.

My question was how to set tabstop to 8 in rio, actually, in a 
window. I naively tried 

tabstop=8
window

Didn't work, man rio says nothing. I then supposed that window
is just a shell script that triggers opening of a new window,
and went to the source tree to see where in rio getenv is called.

I understand it is all obvious for anyone who knows.


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

* Re: [9fans] indenting source?
  2004-03-02  9:30           ` David Tolpin
@ 2004-03-02 10:10             ` lucio
  2004-03-02 10:56               ` David Tolpin
  0 siblings, 1 reply; 25+ messages in thread
From: lucio @ 2004-03-02 10:10 UTC (permalink / raw)
  To: 9fans

> 
> Thank you, I did not realize that. So I can launch a Plan 9 based 'kiosk'
> with Acme as its only interface?
> 
> Great. That's what I need.

Sure, but don't expect it to act as a prison.  It is only a little
less powerful than rio (as regards graphics) and has its own powerful
features.  But maybe by "kiosk" you intend something less conventional
than a restricting environment?

Of course, the private namespace allows you to apply restrictions, but
that applies to rio as well.

++L



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

* Re: [9fans] indenting source?
  2004-03-02 10:05                       ` David Tolpin
@ 2004-03-02 10:36                         ` Geoff Collyer
  2004-03-02 16:34                         ` boyd, rounin
  1 sibling, 0 replies; 25+ messages in thread
From: Geoff Collyer @ 2004-03-02 10:36 UTC (permalink / raw)
  To: 9fans

But as I said, `lookman tab stop' would have led you to 0intro(1).  A
little probing with lookman is always worth trying when in doubt.



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

* Re: [9fans] indenting source?
  2004-03-02 10:10             ` lucio
@ 2004-03-02 10:56               ` David Tolpin
  0 siblings, 0 replies; 25+ messages in thread
From: David Tolpin @ 2004-03-02 10:56 UTC (permalink / raw)
  To: 9fans

> > Thank you, I did not realize that. So I can launch a Plan 9 based 'kiosk'
> > with Acme as its only interface?
> > 
> > Great. That's what I need.
>
> Sure, but don't expect it to act as a prison.  It is only a little
> less powerful than rio (as regards graphics) and has its own powerful
> features.  But maybe by "kiosk" you intend something less conventional
> than a restricting environment?

I did not mean restricting, 'kiosk' was the wrong word. I need to
establish a workplace for a particular workflow; instead of providing
a conventional environment, I would prefer to go with acme (I did
similar thing with Oberon and it was very successful, except for
some limitations of the underlying system). 


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

* Re: [9fans] indenting source?
  2004-03-02  6:00   ` David Tolpin
  2004-03-02  9:06     ` Rob Pike
@ 2004-03-02 16:05     ` boyd, rounin
  1 sibling, 0 replies; 25+ messages in thread
From: boyd, rounin @ 2004-03-02 16:05 UTC (permalink / raw)
  To: 9fans

> Please use English.

please think



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

* Re: [9fans] indenting source?
  2004-03-02 10:05                       ` David Tolpin
  2004-03-02 10:36                         ` Geoff Collyer
@ 2004-03-02 16:34                         ` boyd, rounin
  2004-03-02 16:44                           ` Richard Miller
  1 sibling, 1 reply; 25+ messages in thread
From: boyd, rounin @ 2004-03-02 16:34 UTC (permalink / raw)
  To: 9fans

oh i understand now.  i admit,  i know nothing.  i can't even find the tab
key on my keyboard.  back to normal programming ...



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

* Re: [9fans] indenting source?
  2004-03-02 16:34                         ` boyd, rounin
@ 2004-03-02 16:44                           ` Richard Miller
  0 siblings, 0 replies; 25+ messages in thread
From: Richard Miller @ 2004-03-02 16:44 UTC (permalink / raw)
  To: 9fans

> i can't even find the tab
> key on my keyboard.

Tab keys are for wimps.  Ctrl-i does the job for me.



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

end of thread, other threads:[~2004-03-02 16:44 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-01 20:27 [9fans] indenting source? David Tolpin
2004-03-01 20:37 ` andrey mirtchovski
2004-03-01 20:46   ` David Tolpin
2004-03-01 20:52 ` rog
2004-03-02  2:13 ` boyd, rounin
2004-03-02  6:00   ` David Tolpin
2004-03-02  9:06     ` Rob Pike
2004-03-02  9:19       ` David Tolpin
2004-03-02  9:26         ` David Presotto
2004-03-02  9:30           ` David Tolpin
2004-03-02 10:10             ` lucio
2004-03-02 10:56               ` David Tolpin
2004-03-02  9:31           ` Charles Forsyth
2004-03-02  9:31             ` David Tolpin
2004-03-02  9:43               ` Charles Forsyth
2004-03-02  9:44                 ` David Presotto
2004-03-02  9:45                 ` Geoff Collyer
2004-03-02  9:50                   ` David Tolpin
2004-03-02 10:00                     ` Geoff Collyer
2004-03-02 10:05                       ` David Tolpin
2004-03-02 10:36                         ` Geoff Collyer
2004-03-02 16:34                         ` boyd, rounin
2004-03-02 16:44                           ` Richard Miller
2004-03-02 16:05     ` boyd, rounin
2004-03-02  9:36 ` Douglas A. Gwyn

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).