Re: [9fans] equality sign in Rc

2017-05-15 Thread trebol
So putting control characters aside, and space wich is not part of an unquoted 
word,
they are just one of "!\"#$%&'()+,-./:;<=>?@[\\]^`{|}~",
I'm looking in the wrong file, lex.c? If not, may be that explicit list would 
be nice in rio(1).

I'm going to study the code and shut up my mouth.

>> characters of the same type (c>' ' && 
>> !strchr("!\"#$%&'()+,-./:;<=>?@[\\]^`{|}~", c)) should be skipped too,
> 
> I'm making a mess again...
> 
> the type I'm talking about is chars that don't match that expression, I 
> suppose that not matching
> that expression is what is used for
> 
> "character other than an alphanumeric, underscore, or *".
> 
> trebol.



Re: [9fans] equality sign in Rc

2017-05-15 Thread trebol
> characters of the same type (c>' ' && 
> !strchr("!\"#$%&'()+,-./:;<=>?@[\\]^`{|}~", c)) should be skipped too,

I'm making a mess again...

the type I'm talking about is chars that don't match that expression, I suppose 
that not matching 
that expression is what is used for 

"character other than an alphanumeric, underscore, or *".

trebol.



Re: [9fans] equality sign in Rc

2017-05-15 Thread trebol
> $^x is a syntax error, and not $x.
> $^x would be "whatever $ is" concatenated with literal "x"
> but "$" by itself is a syntax error

That's my point!

$-fu should be a syntax error, because is (our should be) equivalent
to $^-fu, an incorrect expression.

>From rc(1)
[...]
If  an unquoted word immediately follows a $ and contains a
character other than an alphanumeric, underscore, or *, a ^ is inserted
before the first such character.
[...]

But rc, I suppose, skip the first char next to $ in the search of a not 
alphanumeric, not * ... character.
If this is not a bug, but a feature, then it must be explained in rc(1), and 
for me, all the contiguous
characters of the same type (c>' ' && 
!strchr("!\"#$%&'()+,-./:;<=>?@[\\]^`{|}~", c)) should be skipped too,
so $--fu would be also correct.

For me the best is making $-fu a syntax error, and let the programmer decide if 
such an awkward name is
worthy of typing quotes everywhere.

trebol



Re: [9fans] equality sign in Rc

2017-05-15 Thread trebol
> This is not sh, use $'--fu'.
> Any way, is this a bug?

I mean, following the man page, $-fu must be equivalent to $^-fu, and give a 
syntax error. The first of those
characters (not alphanumeric, or * ...) is skiping the trap!

Anyway, I'm out of this conversation: I haven't study the code, so I'm talking 
rubbish.

trebol.



Re: [9fans] equality sign in Rc

2017-05-15 Thread trebol
On Mon, 15 May 2017 16:59:45 +0100
Charles Forsyth <charles.fors...@gmail.com> wrote:

> It would be better then to leave things as they are.
> = is part of rc syntax, like {} and (), and it interprets it, not the
> commands, unless quoted.

I suppose this is the perfect answer to my silly question: why not permit =
after the start of a command?

As I said, = in command arguments should be prohibited!

trebol.



Re: [9fans] equality sign in Rc

2017-05-15 Thread trebol
> Actually a --fu variable is not that useful in Plan 9:
> 
> % --fu=bar
> % echo $--fu
> rc: null list in concatenation
> % echo "$--fu"
> rc: null list in concatenation
> % ls /env
> '/env/*'
> /env/--fu
> ...
> 
> So rc can create a variable starting with more than one '-', but can't use it.

This is not sh, use $'--fu'.
Any way, is this a bug?



Re: [9fans] equality sign in Rc

2017-05-15 Thread trebol
Why? the assignment is after the start of the command, so is not an assignment,
and with the correction of Erik, now rc admit the use of = after the first word
(in the first would be an assignment), so two=2 is just an argument to echo,
exactly 'two='2.

I like this behavior.

trebol

> Given
> 
>> broken! one=1 two=2 echo $one $two
>>
>> 1 2
> 
> What should the following do?
> 
> one=1 echo two=2 $one $two
> 
> Disregarding a UNIX historical mistake, I'd expect
> 1 2



Re: [9fans] equality sign in Rc

2017-05-15 Thread trebol
"c is a counter example"
I think he means the opposite.



Re: [9fans] equality sign in Rc

2017-05-14 Thread trebol
> I see. It seems that you know the code very well. If the variable assignments 
> are only before a command, why not permit =
> after the command? Do you know if is there a thought reason for that?

More precisely, "after the start of the command".



Re: [9fans] equality sign in Rc

2017-05-14 Thread trebol
 > That isn't sh's rule. x=y is fine as an assignment without spaces.

Yes, sorry, in fact I was thinking on the contrary I wrote: don't set a 
variable like in sh.

I like the use of spaces permitted in rc, as I said.

> [...] Shell/environment variable assignments appear only before a command, as 
> in rc,
> and otherwise the text gets passed to the command.[...] 
> In rc, the unquoted = causes a syntax error because nothing in syn.y allows 
> '=' after the start of 

I see. It seems that you know the code very well. If the variable assignments 
are only before a command, why not permit =
after the command? Do you know if is there a thought reason for that?

> Perhaps instead of passing it to the command as in Unix, rc could do what sh 
> originally intended, and lift named parameters
> into the environment wherever they appear in a command.

I think that the cleanest approach is to work with whatever you want to pass to 
a command, and then pass the result in a
not confusing way.
Variables are just fine, and with rc's lists of strings there is not need for 
more. The use of = in command arguments
should be prohibited (by law!).

By the way, do you know how this was designed in the original rc for v10 
research unix?

I looked some time ago in

   http://www.tuhs.org/Archive/Distributions/Research/

but there is no source of rc, only documentation.

trebol.



Re: [9fans] equality sign in Rc

2017-05-13 Thread trebol
No with hyphenation, my friend!



[9fans] equality sign in Rc

2017-05-13 Thread trebol
> does anybody have a version of Rc that allows unquoted equality sign?
> 
> having to quote the character get a bit annoying on POSIX systems (plan9port)

You can change the code, I suppose the key file is

rc/lex.c

You can force rc to setting a variable only if = is surrounded by spaces, like 
in sh, but then you'll have a lot of problems in plan9/p9p.

I know what you are talking about.

I like the use of = in rc, but there is too much unix in plan9, and a lot of 
programs are straightforwardly ported. An example is gs, making tests with 
options in rc is a nightmare.

People say that the problem of Plan9's popularity is the differences with unix, 
but for me is the opposite. It try to be different being too much similar.

I remember when I discovered it 4 or 5 years ago. I was so happy with the use 
of utf8 as the system own character coding, I was learning C and I was sick 
with wchars, multibyte, locales and so on in unix. Then I used troff to write a 
paper, and surprise!, there is no utf8 support. And the same with spell and 
other utilities. They were pieces of unix, sewed to the corpse... instead of 
"Plan 9 from Outer Space", some times It feels more like "Frankenstein".

trebol.



Re: [9fans] Compiling ken-cc on Linux

2015-11-27 Thread trebol
Ryan Gonzalez  wrote:

> See
> https://bitbucket.org/plan9-from-bell-labs/9-cc/issues/1/problems-building-under-x64-linux
> for some tips on fixing various errors you may encounter, including this
> one. (I opened that issue like 8 months ago...)
>
> On Wed, Nov 25, 2015 at 11:10 AM, Vasudev Kamath 
> wrote:
>
> >
> > Hi,
> >
> > I'm trying to compile ken-cc from ¹. Its giving me following error
> >
> > cc -c -m32 -g -O
> > -I/home/vasudev/Documents/C_programming/compilers/9-cc/Linux/386/include
> > -I/home/vasudev/Documents/C_programming/compilers/9-cc/include -DLINUX_386
> > -I../cmd/ 9obj.c
> > In file included from
> > /home/vasudev/Documents/C_programming/compilers/9-cc/Linux/386/include/lib9.h:9:0,
> >  from 9obj.c:5:
> > /usr/include/features.h:148:3: warning: #warning "_BSD_SOURCE and
> > _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp]
> >  # warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use
> > _DEFAULT_SOURCE"
> >^
> > 9obj.c:8:22: fatal error: 9c/9.out.h: No such file or directory
> > compilation terminated.
> > mk: cc -c -m32 ...  : exit status=exit(1)
> > mk: for j in ...  : exit status=exit(1)
> >
> > I can't find 9c under src/cmd folder. Any hints on how to get it
> > compiled?.
> >
> > Cheers,
> >
> > ¹ https://bitbucket.org/plan9-from-bell-labs/9-cc/overview
> >
> >
>
>
> -- 
> Ryan
> [ERROR]: Your autotools build scripts are 200 lines longer than your
> program. Something’s wrong.
> http://kirbyfan64.github.io/
h+
h+



Re: [9fans] rc: null list in concatenation

2014-11-25 Thread trebol
 Also, when the '^' is omitted, like in
 
   $dir(1)^$dir(2)

 Also, when the '^' is omitted, like in
 
$dir(1)$dir(2)

Sorry for the mess...




Re: [9fans] rc: null list in concatenation

2014-11-25 Thread trebol
Sorry for all that noise.  The problem was simply confusion about strings,
list of strings, list of strings and|or other list of strings... and
too much coffee.

What I needed was simply the use of $ to work around possible empty
lists in concatenations (and of course read the man page carefully
again and again), my fault, sorry again.

trebol.



[9fans] (no subject)

2014-11-24 Thread trebol
Hello everyone.

I'm curious about the behavior of rc concatenating null strings (brakes
execution on error...).  It's a feature, rationally thought-out, or a bug?

If anyone can tell me the story behind, I'll be grateful.

trebol.




[9fans] rc: null list in concatenation

2014-11-24 Thread trebol
Hello everyone.

I'm curious about the behavior of rc concatenating null strings (brakes
execution on error...).  It's a feature, rationally thought-out, or a bug?

If anyone can tell me the story behind, I'll be grateful.

trebol.

P.D.
Sorry for previous mail without subject.




Re: [9fans] rc: null list in concatenation

2014-11-24 Thread trebol
a = `{ls file}^test; echo 'this part is not executed if file doesn''t exist'


 example is required.
 
 2014/11/25 13:24、tre...@india.com のメール:
 
 Hello everyone.
 
 I'm curious about the behavior of rc concatenating null strings (brakes
 execution on error...).  It's a feature, rationally thought-out, or a bug?
 
 If anyone can tell me the story behind, I'll be grateful.
 
 trebol.
 
 P.D.
 Sorry for previous mail without subject.
 
 




[9fans] e0|e01 on regexp(3)

2014-11-14 Thread trebol
Using a little script I wrote to rename files, I encounter a funny
behavior with '|'.  If the regular expressions share a part, doesn't
matter the order of those,  The first match from the start of the input
is processed.  Now that I'm writing this, it's seems obviously the
right behavior (and I think it is), for example:


% echo '123' | sed s'/12|12/o/g' 
o3
% echo '123' | sed s'/23|12/o/g' 
o3

But in large concatenations with strange characters like in:
$ echo '__-' | sed s'/_-|_-_|-_|__+ ... and a lot of more cra* ... 
/__/g'

You could expect the output be '__', but it's '__-'

So... if you are a retard like me, don't try to be such smart and use
various sed commands.

trebol.




Re: [9fans] acme mouse wheel

2014-11-07 Thread trebol
Have you set the mouse to ps2intellimouse?




Re: [9fans] Setting up Mail in Acme on the Raspberry Pi.

2014-11-03 Thread trebol
You must set the dot to all the text (mark all the text, for example type ':,' 
in the tag line and click it with buttom 3) and then execute in the tag 
'upas/smtp -d -a  ...'  

Don't forget the '', read acme(1).

trebol.




Re: [9fans] Setting up Mail in Acme on the Raspberry Pi.

2014-10-31 Thread trebol
Mats Olsson plan9@gmail.com wrote:

 Hi all of you!

 Thanks for all the help you've given me to get this far using the Plan
 9 OS on a Raspberry Pi! I can now retrieve mail from the gmail
 accounts I've tried. It works well but, even though it doesn't make
 sense to me, I can't send e-mail to those accounts. I just get the
 error message that I posted a while ago. Now I've tried an updated
 installation (pulled the sources and compiled and installed) but the
 error message keeps coming up. Don't know what to do next. If anyone
 has a solution to this problem I would be truly grateful to receive
 it. Even if it's just a hint how to solve it.

 Sincerely Yours,
 Mats

 2014-10-30 17:14 GMT+01:00, Mats Olsson plan9@gmail.com:
  Hi Erik!
 
  FYI my middle name is Erik. I'm kind of leaning towards an ssl problem
  since gmail require ssl to receive e-mail.
 
  2014-10-30 17:11 GMT+01:00, Mats Olsson plan9@gmail.com:
  Well that is what I meant with changing configuration since the level
  of security was lowered with this action. In other words security
  configuration.
 
  2014-10-30 17:00 GMT+01:00, erik quanstrom quans...@quanstro.net:
  could it be that with recent ssl/tls bugs, and the general fix being to
  turn
  sslv3 off, plan 9 ssl isn't up to talking to gmail?
 
  - erik
 
 
 
 



[9fans] abaco in linux

2014-10-25 Thread trebol
In linux gcc cries:
io.c:23:7: error: assignment to expression with array type
  arg2 = va_arg(*arg, va_list);

I have seen other errors like that in the web, and solutions involving
va_copy().  I don't know... I'm just learning but the source seems
correct, arg2 is a va_list, and va_arg(*arg, va_list) expand to a va_list,
doesn't it?.  Anyway:


--- abaco/webfs/io.c2008-02-17 19:27:12.0 +
+++ abaco_patched/webfs/io.c2014-10-25 18:03:11.990925835 +0100
@@ -16,11 +16,11 @@
 {
int fd;
char *fmt;
-   va_list arg2;
+   void *arg2;
 
fd = va_arg(*arg, int);
fmt = va_arg(*arg, char*);
-   arg2 = va_arg(*arg, va_list);
+   arg2 = va_arg(*arg, void*);
return vfprint(fd, fmt, arg2);
 }


Re: [9fans] Setting up Mail in Acme on the Raspberry Pi.

2014-10-15 Thread trebol
For a external imap server, like gmail, you can compile heirloom's mailx
with ape.  Works nice with the plumber, and setting the pager to cat
it integrates nice within acme, a rio window or 9term.  I use it also
in p9p, until I meet a nice alternative.

trebol.



Re: [9fans] Setting up Mail in Acme on the Raspberry Pi.

2014-10-15 Thread trebol
Steffen Nurpmeso sdao...@yandex.com wrote:

 trebol tre...@india.com  wrote:
  |For a external imap server, like gmail, you can compile heirloom's mailx
  |with ape.  Works nice with the plumber, and setting the pager to cat
  |it integrates nice within acme, a rio window or 9term.  I use it also

 So you like the bad girls honey,..
 Is that true.

 --steffen

Yeah...



[9fans] Announcing The Virtual Plan 9 Server Cookbook

2014-08-28 Thread trebol
Hello David.



[9fans] Venti on NetBSD64

2014-07-24 Thread trebol



[9fans] Venti on NetBSD64

2014-07-24 Thread trebol
This mail is just in case someone is thinking on setting a venti server
or just install plan9port in NetBSD64.  I know is a p9p matter, but I've
saw a lot of people on this list using p9p to serve venti and even fossil
for their Plan9 machines.  If this is a bad behavior on the mailing list,
please let me know!

The torture begins...

install netbsd32_compat40.

Compile p9p in netbsd-4.0 i386 (needs perl), and move to the 64
machine, in the same path or change $PLAN9/lib/moveplan9.files.
I'll use /emul/netbsd32/usr/local/plan9port

cp i386's libX11.so.6.2 to /emul/netbsd32/lib and soft link to:
libX11.so.6
libX11.so

create /etc/ld.so.conf:
/lib
/usr/lib
/emul/netbsd32/lib

create ptys:
# cd /dev
# sh MAKEDEV opty

Edit .profile
export PLAN9=/emul/netbsd32/usr/local/plan9port
export PATH=$PATH:$PLAN9/bin

Edit _default in /etc/man.conf
_default
{/emul/netbsd32/usr/local/plan9port,/usr/{share,X11R7,X11R6,pkg,local}}/man/


PROBLEMS:
venti must use files:
venti/fmtarenas: can't open partition /dev/cgd2a: can't 
determine size of partition /dev/cgd2a
Don't use tcp!*!venti, errors about 0.0.0.0...  best use 
tcp!your_ip!venti.  The same for http.

Problems with rc, for example executing scripts like man:
$ man venti
rc (/emul/netbsd32/usr/local/plan9port/bin/rc): null list in 
concatenation

This is a problem of NetBSD's compatibility mode.  Works fine in i386 
4.0.

Don't use shells/rc !!, from http://tobold.org/article/rc 's man page:

INCOMPATIBILITIES
  The  Tenth  Edition  rc does not have the else keyword.  Instead, 
if is
   optionally followed by an if not clause which is executed if  the  pre-
   ceding if test does not succeed.
   [...]
   For  .   file,  the  Tenth Edition rc searches $path for file.  This rc
   does not, since it is not considered useful.
   [...]
   
   Install 9base's rc:
  $ git clone git://git.suckless.org/9base
  $ cd 9base; make
  $ mkdir $PLAN9/etc
  $ cp rc/rc $PLAN9/bin; cp rc/rcmain $PLAN9/etc

So the equation is something like:

Venti + NetBSD64 = netbsd32_compat40 + p9p from i386 4.0 + 9base's rc

I hope in the future I can add '= Plan9' to this mess.

trebol.


[9fans] NetBSD venti server

2014-07-19 Thread trebol
Hello everyone.

I'm turning my NetBSD gateway in a venti server with plan9port.  Reading
the list I have saw a lot of considerations about the configuration.
I'll appreciate any information (links to docs?) about setting venti.
The man pages and /sys/doc/venti/ are too much technical for me now!.
Maybe it's time to dig in file systems/servers and study the venti
implementation (Any introductory docs suggestion about this will be
appreciated too) to be able to make my own decisions. Or just


http://plan9.bell-labs.com/wiki/plan9/Setting_up_Venti/index.html

Index 5% of Arenas, go on with the defaults, and see the sunset on the
beach with my hands on my nape?

I plan mirror the venti disk with RAIDframe (two 250GB sata disks),
and use it to incremental backup my work with vac(1).  I was thinking
of encrypt the disks with cgd.

Also, p9p doesn't support NetBSD-amd64, and current NetBSD-i386
is broken.  I had to compile in Netbsd-i386 4.0 in Qemu, and use
emulators/netbsd32_compat40:

install netbsd32_compat40
Compile p9p in netbsd-4.0 i386 (needs perl)
cp i386's libX11.so.6.2 to /emul/netbsd32/lib and soft link to
libX11.so.6
libX11.so
create /etc/ld.so.conf:
/lib
/usr/lib
/emul/netbsd32/lib
create ptys:
# cd /dev
# sh MAKEDEV opty

For now, all is going like a charm.  I hope this will be usefull to someone.

Nice summer (Or winter).
trebol.



Re: [9fans] first questions from a lurker

2014-03-16 Thread trebol
Reading your mails, I recommend you to read carefully and patiently all
the docs in /says/doc, the man pages, starting with the intros, the great
info in cat-v.org and of course the wiki!

Don't forget searching in the mail archive, you'll see a lot of info
about the things you are asking for (including my newbie's questions through
the last year).

Enjoy the little bunny!



[9fans] print(2)'s format

2014-03-02 Thread trebol
Hello, this is the little story:
I usually write scripts needing numbers padded on the left with zeros, like in 
'%03.0f'.  In UNIX I use printf(1), but now I'm using more and more rc scripts 
with P9P, and I like to use Plan9 programs to make the scripts more portable to 
Plan9... so I tried with seq, like '9 seq -f%03.0f $i $i' or -f%03g, getting 
the desired output in P9P, but discovering that in Plan9, the floating point 
verbs doesn't include the flag '0'.
I'm really curious about this.  Anyone knows the reason of letting out this 
flag (and including it in P9P)?

Regards,
trebol. 


[9fans] rc and spaces in file names

2013-12-20 Thread trebol
Hello,
I usually edit file names with a 'for' statement, so i can replace
spaces and other problematic characters without effort.  But today
I needed to change names keeping spaces and I found something weird.
Let be two files: 'Plan 9' and 'Plan B'.  In a korn or bourne shell I
can do something like:

$ for i in Plan*; do a=`echo $i | 9 sed s'/lan/LAN/g'`; cp $i $a; 
done
without problems with spaces.  In Plan9 I've tried

term% ifs='\n' for(i in Plan*){cp $i `{echo $i | sed 's/lan/LAN/'}}
cp: can't create PLAN 9
: bad character in file name: 'PLAN 9
'
cp: can't create PLAN B
: bad character in file name: 'PLAN B
'
'

So the last newline character is added to the file name...

I tried typing a literal newline in the ifs variable and it works:

term% ifs='
' for(i in Plan*){cp $i `{echo $i | sed 's/lan/LAN/'}}
term% ls P*
'PLAN 9'
'PLAN B'
'Plan 9'
'Plan B'

With p9p is the same.  I'll appreciate If anyone can tell me why.

trebol.


[9fans] rc and spaces in file names

2013-12-20 Thread trebol
Ok, thanks to both.  I got confused with this part of rc(1):

`{command}
   rc executes the command and reads its standard output,
   splitting it into a list of arguments, using characters
   in $ifs as separators.  If $ifs is not otherwise set,
   its value is ' \t\n'.



[9fans] Spell checking with acme in p9p

2013-12-15 Thread trebol
When recently I discovered Plan9, the first things I missed were a
non-only-English spell checker, support for other languages in troff
(mostly hyphenation), and other dictionaries for dict.  I've ported
international ispell to ape and write aispell, a modified version of
aspell script that work with ispell, I've formatted GCIDE, Chambers's
Twentieth Century Dictionary, Diccionario de la Real Academia de la
Lengua Española, Moby Thesaursus and OpenThesaurus-es, and I was
hopping working in troff when I'll learn programming.  The lack of a
web browser capable of deal with today's madness and the portability
limitation of ape (at least for a ignorant like me) forcesme to deal
with other OS I have to install and maintaining, so the simplicity and
cleanness I like so much of plan9 become useless.  Thanks to Russ Cox for P9P!  

I've write a script for p9p too, you only need to install gnu
aspell (or other spell checker with ispell -a support) and compile a
slightly modified spout.c with rune support (I've called it uspout), so you can
use the script like native acme's aspell script.  This is from my README.PLAN9 
file:

[...]
In the acme directory are aispell, an equivalent script of aspell and
uspout.c, slighted modified spout.c for UTF-8 runes, needed by aispell
to support non English languages.  You can pass ispell options as
arguments to aispell, for example for use the Spanish dictionary you can put
in the tag:
aispell -despañol -Tutf8 

Or put 'aispell -despañol -Tutf8 $*' in a script and call
it aispelles, for example.  Defining a function in lib/profile didn't
work for me...  You can use it in any text selected, but for now, if
it doesn't start at the beginning of the buffer, the output's
addresses will be wrong.  This package install American and British
dictionaries.  If you are interested, look at the Spanish_ispell package I've
ported from http://www.datsi.fi.upm.es/~coes.
[...]

In P9P you don't need -Tutf8.  I was going to ask for a directory in
sources, but I haven't see any interest in those things in the list.  I hope 
that this will help you.
The script and spout's source are small, so I'm going to paste both here.
trebol.

#!/usr/local/plan9/bin/rc
# Don't forget to check the path!
# aispell_p9p

rm -f /tmp/$pid^'.'aispell

spellpgr=aspell
args=()
spellflags=()
for(x){
switch($x){
case -d*
spellflags=($spellflags $x)
case -p*
spellflags=($spellflags $x)
case -T*
spellflags=($spellflags $x)
case *
args=($args $x)
}
}

id=`{9p read acme/new/ctl}
id=$id(1)

echo 'name '^`{pwd}^/-spell | 9p write acme/$id/ctl

{
if(~ $#args 0){
cat  /tmp/$pid^'.'aispell
args=/tmp/$pid^'.'aispell
pipe=1
}
for(i in $args){
name=$i
if(~ $pipe 1){
name=`{9p read acme/$winid/tag | 9 sed 's/ 
.*//g'}
if(~ name '') name=nonamedwindow
}
for(j in `{{cat $i; echo} | uspout | 9 sort -t: -u +2 | 9 sed 
's/$/\!/g' | $spellpgr -a $spellflags | 9 grep '^[#]' | 9 sed 's/ /_/g'}){
# {cat $i; echo} is for uspout, needs \n. Also I want to make a 
list of lines, so j can't have spaces 

miss=`{ echo $j | awk -F_ '{print $2}'}
sug=`{ echo $j | 9 sed 's/^.*://g'} # Can't put 9 grep 
-v '^#' here...
{cat $i; echo} |
uspout |
9 grep '.*:'$miss'$' |
9 sed 's/$/ '$sug'/g' | # If I put 9 grep -v '^#' 
above, this 9 sed cuts output, I don't know why ...
9 sed 's/#_.*$//g' |
9 sed 's/_/ /g' |  # If I put 9 sed 's/_/ /g' above, 
variables don't work in 9 sed.  Again, I don't know why...
9 sed s',^,'$name',g' | 9p write acme/$id/body
}

}
rm -f /tmp/$pid^'.'aispell
echo clean | 9p write acme/$id/ctl
}




uspout.c's source:
#include u.h
#include libc.h
#include ctype.h
#include bio.h

voidspout(int, char*);

Biobuf bout;

void
main(int argc, char *argv[])
{
int i, fd;

Binit(bout, 1, OWRITE);
if(argc == 1)
spout(0, );
else
for(i=1; iargc; i++){
fd = open(argv[i], OREAD);
if(fd  0){
fprint(2, spell: can't open %s: %r\n, 
argv[i]);
continue;
}
spout(fd, argv[i]);
close(fd);
}
exits(nil);
}

Biobuf b;

void
spout(int fd, char *name)
{
char *s, *t, *w;
Rune r;
int inword, wordchar;
int n, wn, wid, c

[9fans] PBSR...EI

2013-06-11 Thread trebol
Hello,
The new 9atom iso fails for me the same.  But if you finish manually the
installation formatting and preparing the 9fat partition, the system boots right
(just as erik said).  Also, the annoying cpu0:spurious interrupt kernel 
message 
is gone (with the iso's 9pcf and with a 9pccpuf compiled by me), so I spouse
the problem is in 9pccd. 

This is the linux's lspci output:
00:00.0 Host bridge: VIA Technologies, Inc. K8M800 Host Bridge
00:00.1 Host bridge: VIA Technologies, Inc. K8M800 Host Bridge
00:00.2 Host bridge: VIA Technologies, Inc. K8M800 Host Bridge
00:00.3 Host bridge: VIA Technologies, Inc. K8M800 Host Bridge
00:00.4 Host bridge: VIA Technologies, Inc. K8M800 Host Bridge
00:00.7 Host bridge: VIA Technologies, Inc. K8M800 Host Bridge
00:01.0 PCI bridge: VIA Technologies, Inc. VT8237/8251 PCI bridge 
[K8M890/K8T800/K8T890 South]
00:0f.0 IDE interface: VIA Technologies, Inc. VIA VT6420 SATA RAID Controller 
(rev 80)
00:0f.1 IDE interface: VIA Technologies, Inc. 
VT82C586A/B/VT82C686/A/B/VT823x/A/C PIPC Bus Master IDE (rev 06)
00:10.0 USB Controller: VIA Technologies, Inc. VT82x UHCI USB 1.1 
Controller (rev 81)
00:10.1 USB Controller: VIA Technologies, Inc. VT82x UHCI USB 1.1 
Controller (rev 81)
00:10.2 USB Controller: VIA Technologies, Inc. VT82x UHCI USB 1.1 
Controller (rev 81)
00:10.3 USB Controller: VIA Technologies, Inc. VT82x UHCI USB 1.1 
Controller (rev 81)
00:10.4 USB Controller: VIA Technologies, Inc. USB 2.0 (rev 86)
00:11.0 ISA bridge: VIA Technologies, Inc. VT8237 ISA bridge 
[KT600/K8T800/K8T890 South]
00:11.5 Multimedia audio controller: VIA Technologies, Inc. VT8233/A/8235/8237 
AC97 Audio Controller (rev 60)
00:12.0 Ethernet controller: VIA Technologies, Inc. VT6102 [Rhine-II] (rev 78)
00:18.0 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] 
HyperTransport Technology Configuration
00:18.1 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Address 
Map
00:18.2 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] DRAM 
Controller
00:18.3 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] 
Miscellaneous Control
01:00.0 VGA compatible controller: nVidia Corporation NV34 [GeForce FX 5500] 
(rev a1) 

Maybe this can be of any use for erik and the people working in 9load and Plan 
9's kernel.
For now that is the only thing I can do, test and report... I hope in the 
future to be of more help.

When I have time I will try installing Plan 9 in the other machine that fails 
with PBSR...
(an old PentiumIII).

Regards,
trebol.



[9fans] PBSR...EI

2013-06-02 Thread trebol
Hello everyone,
maybe this can be of interest to someone.

I have downloaded from 9legacy the old 9spirit iso (the newest uses bell's 
9load, doesn't it?)
I have installed the system selecting a fat partition with bell's iso. All went 
right, and I reboot.

First thing happens:
MBR...PBS1...Bad format or I/O error

So I load the CD and disk/format the fat partition with 9load, pbslba and 9pf 
from the CD.

This board has 2 IDE ports and 2 SATA ports.  If I have one disk in SATA and 
other in master of first IDE, 9load of the official plan9
gets confused and can't load the kernel.  9load from the CD boots the kernel, 
but after 'root is from ...' the kernel crashes with

/boot/kfs does not exist

All this is about sdC0.  It's weird, because once the system is running (the 
CD) all the disk are recognized right. So first thing learned: 
let the SATA disk and remove master of primary IDE, or let IDE and remove SATA.
(The official iso doesn't boot, no matter if I dance a tango or a bossa-nova 
with my disks)

Now I can boot with the kernel and 9load from the CD.
With CD's 9load and bell's 9pf, the system halt with /boot/kfs does ...

So I have official plan9 root with 9load, pbslba and 9pf from old 9spirit iso.

I know those are patches from erik, so the best would be use his new kernel, 
but the
cpu0:spurious interrupt ... is a little intimidating to an ignorant like me. 

I will try his new iso, and thanks erik.

Regards,
trebol.



[9fans] PBSR...EI

2013-06-01 Thread trebol
 tail -f /dev/kprint
I see, when kprint is open the log isn't sent to the console.  Also simply tail 
or cat /dev/kprint works fine.
I need to read more man pages...

But now I'm in my installation nightmare!

9atom installation doesn't work, when coping the distribution setting gid and 
uid fails and files are missing.
Can you mail a check sum? I have downloaded the iso twice, but maybe my 
connection is making a mess.

I also tried using 9atom to install the official iso (the installer is the 
same, doesn't it?), all goes fine
but on boot, after selecting the fossil partition:

/boot/kfs does not exists

I have tried putting the 9atom kernel in 9fat, but things get even worst.

Any help will be very appreciated.

Regards,
trebol.




This is the 9atom installer's output:

warning: cannot set uid on /n/newfs/adm/secstore
warning: cannot set uid on /n/newfs/adm/secstore/store
warning: cannot set uid on /n/newfs/adm/secstore/who
warning: cannot set uid on /n/newfs/cron/bootes
warning: cannot set uid on /n/newfs/cron/bootes/cron
warning: cannot set gid on /n/newfs/usr/bootes
warning: cannot set uid on /n/newfs/usr/bootes
warning: cannot set gid on /n/newfs/usr/bootes/lib
warning: cannot set uid on /n/newfs/usr/bootes/lib
warning: cannot set gid on /n/newfs/usr/bootes/lib/profile
warning: cannot set uid on /n/newfs/usr/bootes/lib/profile
warning: cannot set gid on /n/newfs/usr/bootes/tmp
warning: cannot set uid on /n/newfs/usr/bootes/tmp
warning: cannot set gid on /n/newfs/usr/bootes/bin
warning: cannot set uid on /n/newfs/usr/bootes/bin
warning: cannot set gid on /n/newfs/usr/bootes/bin/386
warning: cannot set uid on /n/newfs/usr/bootes/bin/386
warning: cannot set gid on /n/newfs/usr/bootes/bin/rc
warning: cannot set uid on /n/newfs/usr/bootes/bin/rc
warning: cannot set gid on /n/newfs/usr/bootes/bin/rc/kwnvraminit
warning: cannot set uid on /n/newfs/usr/bootes/bin/rc/kwnvraminit
warning: cannot set gid on /n/newfs/usr/bootes/bin/arm
warning: cannot set uid on /n/newfs/usr/bootes/bin/arm
warning: cannot set gid on /n/newfs/usr/bootes/bin/amd64
warning: cannot set uid on /n/newfs/usr/bootes/bin/amd64
error: copying /n/newfs/68020/lib/ape: '/n/dist/68020/lib/ape' does not exist

error: copying /n/newfs/68020/lib/libc.a: '/n/dist/68020/lib/libc.a' does not 
exist

error: copying /n/newfs/adm/keys: '/n/dist/usr/quanstro' does not exist

error: copying /n/newfs/adm/keys.who: '/n/dist/usr/quanstro' does not exist

error: copying /n/newfs/adm/netkeys: '/n/dist/usr/quanstro' does not exist

error: copying /n/newfs/adm/netkeys.who: '/n/dist/usr/quanstro' does not exist

error: copying /n/newfs/adm/whois: '/n/dist/usr/quanstro' does not exist

error: copying /n/newfs/alpha/lib/ape: '/n/dist/alpha/lib/ape' does not exist

error: copying /n/newfs/alpha/lib/libc.a: '/n/dist/alpha/lib/libc.a' does not 
exist

error: copying /n/newfs/cron/lock: '/n/dist/usr/quanstro' does not exist

error: copying /n/newfs/sys/log/6in4: '/n/dist/usr/quanstro' does not exist

error: copying /n/newfs/sys/log/aan: '/n/dist/usr/quanstro' does not exist

error: copying /n/newfs/sys/log/acme: '/n/dist/usr/quanstro' does not exist

error: copying /n/newfs/sys/log/auth: '/n/dist/usr/quanstro' does not exist

error: copying /n/newfs/sys/log/cpu: '/n/dist/usr/quanstro' does not exist

error: copying /n/newfs/sys/log/cron: '/n/dist/usr/quanstro' does not exist

error: copying /n/newfs/sys/log/cs: '/n/dist/usr/quanstro' does not exist

error: copying /n/newfs/sys/log/dns: '/n/dist/usr/quanstro' does not exist

error: copying /n/newfs/sys/log/fossil: '/n/dist/usr/quanstro' does not exist

error: copying /n/newfs/sys/log/fs: '/n/dist/usr/quanstro' does not exist

error: copying /n/newfs/sys/log/ftp: '/n/dist/usr/quanstro' does not exist

error: copying /n/newfs/sys/log/httpd/clf: '/n/dist/usr/quanstro' does not exist

error: copying /n/newfs/sys/log/httpd/log: '/n/dist/usr/quanstro' does not exist

error: copying /n/newfs/sys/log/httpd/pathstat: '/n/dist/usr/quanstro' does not 
exist

error: copying /n/newfs/sys/log/httpd/url: '/n/dist/usr/quanstro' does not exist

error: copying /n/newfs/sys/log/imap4d: '/n/dist/usr/quanstro' does not exist

error: copying /n/newfs/sys/log/ipboot: '/n/dist/usr/quanstro' does not exist

error: copying /n/newfs/sys/log/ipconfig: '/n/dist/usr/quanstro' does not exist

error: copying /n/newfs/sys/log/listen: '/n/dist/usr/quanstro' does not exist

error: copying /n/newfs/sys/log/mail: '/n/dist/usr/quanstro' does not exist

error: copying /n/newfs/sys/log/nfs: '/n/dist/usr/quanstro' does not exist

error: copying /n/newfs/sys/log/nfsserver: '/n/dist/usr/quanstro' does not exist

error: copying /n/newfs/sys/log/pop3: '/n/dist/usr/quanstro' does not exist

error: copying /n/newfs/sys/log/portmapper: '/n/dist/usr/quanstro' does not 
exist

error: copying /n/newfs/sys/log/ppp: '/n/dist/usr/quanstro' does not exist

error: copying /n/newfs/sys/log/pptpd: '/n/dist/usr/quanstro' does not exist

[9fans] PBSR...EI

2013-05-29 Thread trebol
Hello everyone,

I would like to install the official Plan9 distro but the boot process
stop at PBSR...EI.  This is a amd k8 machine, but before I tried in a old
pentium III with similar error.

Is this a pbs error, or is 9load who fails?

Also, I tried erik quanstrom's 9atom and boot but:

- If I select install, rio starts but there are a lots of
cpu0:spurious interrupt 39, last 14
- If I select boot from cd, the system crashes



[9fans] PBSR...EI

2013-05-29 Thread trebol
 you can work around this (i admit it's a hack) by
 starting a new rio window, running cat /dev/kmesg,
 then hiding the window.  be sure to turn scroll on
 before hiding.

Thanks for the help erik, but that didn't work. cat finishes
and the console output keeps filling the screen making impossible the
installation. 

Can I boot the official Plan9 with your bootloader?

Regards,
trebol.



[9fans] cryptsetup

2013-05-27 Thread trebol
Hello everyone,

I have problems in a new installed system with cryptsetup and cwfs64.

checktag pc=8694 cw /dev/fs/fscachew'/dev/fs/fsworm (17cc8) tag 
/path=Tfile/49361; expected Tdir/49358

This is a fresh installation (not strange move-copy-dump-whatever) so this tags 
inconsistencies are worrying me,
because that can happen in the future again with important data.

Anyone has have similar problems with cryptsetup and cwfs64?
Can I trust cryptsetup?
Is fossil more stable than cwfs64?  I have read a lot in 9fans archive but I 
can't make any conclusion... 

Also, I don't find anything about cryptsetup outside 9front.  Is it possible to 
use it in the original Plan9?  

Thanks in advance,
trebol.



[9fans] cryptsetup

2013-05-27 Thread trebol
 did you do ream main first?  i have no idea what cryptsetup is.

cryptsetup is a command for manage encrypted partitions:
http://man.aiju.de/8/cryptsetup

I have repeated the installation, hoping I made a mistake adding my user to cwfs
or something.  I configured the system again, recovered my data from other 
computer
again, and when I was so happy starting to work in acme organizing my dirs the 
whole
window is filled with those errors of Tfile... expected Tdir...

Before installing Plan9 I tested the disk with linux's badblocks (write-mode 
test), although
I think in case of bad sectors the output would be something about I-O errors. 

I don't know what to do.  I want a stable environment to work (I'm very happy 
with the idea of
plan9 with worm, dump and mirror) and I am used to encrypt my partitions in 
openbsd and linux.
I don't like the idea of have my data exposed. 

Regards,
trebol.



[9fans] cwfs64x+cryptsetup+mirror?

2013-05-23 Thread trebol
Hello everyone,
Anyone has used cryptsetup with cwfs64x and fs's mirror feature?
Any reliability problems?

Also, weeks ago I send a mail to cont...@plan9.bell-labs.com without response.
I would like to share some ape ports and dictionaries for dict.

Thanks in advance.

Regards,
trebol.



[9fans] International Ispell in Plan9

2013-04-13 Thread trebol
The script don't work, and has serious mistakes in its approach.  I will
fix it soon.

Regards,
trebol.



[9fans] International Ispell in Plan9

2013-04-13 Thread trebol
Hello everyone.

This script works very fine.  I will take a look at sources, and learn
the proper way to share this.

There is a lot of dictionaries you can use with ispell:

http://fmg-www.cs.ucla.edu/geoff/ispell-dictionaries.html


I will make a package with ispell and the American and British
dictionaries, and a separate package with the Spanish dictionary.
I'm starting to learn Portuguese, so I will try to make a package for
this language too, but I think it would be great if a native speaker
of each language makes and tests the dictionaries.  The work is easy,
just make a utf8 formatter like that I showed you in the first mail I
send with this subject.

With the dot's address I can fix the output to make it work with
arbitrarily selections.  I'm still looking for some way to get the
dot's address of a window within a rc script, but I think that the
proper way it's going to be keep learning C (just 3th chapter of KR
for now...) and make a simple C program to make the work and put it in
/acme/bin for future use in scripts, and maybe substitute the script
with a faster program.

Regards, 
trebol.

//
//

#!/bin/rc

rm -f /tmp/$pid^'.'aispell

args=()
spellflags=()
for(x){
switch($x){
case -d*
spellflags=($spellflags $x)
case -p*
spellflags=($spellflags $x)
case -T*
spellflags=($spellflags $x)
case *
args = ($args $x)
}
}

dir = /mnt/wsys
if(! test -f $dir/cons)
dir = /mnt/term/$dir
id=`{cat $dir/new/ctl}
id=$id(1)

#if(~ $#args 1  ~ $args /*){
#   adir = `{basename -d $args}
#   args = `{basename $args}
#   echo 'name '^$adir^/-spell  $dir/$id/ctl
#   cd $adir
#}
#if not {
echo 'name '^`{pwd}^/-spell  $dir/$id/ctl
#}

{
echo noscroll
if(~ $#args 0){
cat  /tmp/$pid^'.'aispell
args = /tmp/$pid^'.'aispell
pipe = 1
}
for(i in $args){
name = $i
if(~ $pipe 1){
name = `{sed 's/ .*//g'  /mnt/acme/$winid/tag}
if(~ name '') name = nonamedwindow
}
for(j in `{{cat $i; echo} | $home/local/bin/acme/spout | sort 
-t: -u +2 | sed 's/$/\!/g' | $home/local/bin/ispell -a $spellflags | grep 
'^[#]' | sed 's/ /_/g'}){
# {cat $i; echo} is for spout, needs \n. I want make a list of 
lines, so j can't have spaces 
miss = `{ echo $j | awk -F_ '{print $2}'}
sugg = `{ echo $j | sed 's/^.*://g'} # I can't put grep 
-v '^#' here...
{cat $i; echo} |
$home/local/bin/acme/spout |
grep '.*:'$miss'$' |
sed 's/$/ '$sugg'/g' | # If I put grep -v '^#' above, 
this sed cuts output, I don't know why ...
sed 's/#_.*$//g' |
sed 's/_/ /g' |  # If I put sed 's/_/ /g' above, 
variables don't work in sed.  Again, I don't know why...
sed s',^,'$name',g'  $dir/$id/body
}

}
rm -f /tmp/$pid^'.'aispell
echo clean
} $dir/$id/ctl



[9fans] International Ispell in Plan9

2013-04-12 Thread trebol
On Thu, Apr 11, 2013 at 07:57:13PM +0200, Nemo wrote:
 you could put it in sources, if not yet there.


I want to put order in this mess before put it in sources.

I change the for loop to work in the output of ispell instead, and now
ispell works only one time in terse mode. The script is now much faster
thanks to the good design of awk and grep.

#!/bin/rc

rm -f /tmp/$pid^'.'aispell*

args=()
spellflags=()
for(x){
switch($x){
case -d*
spellflags=($spellflags $x)
case -p*
spellflags=($spellflags $x)
case -T*
spellflags=($spellflags $x)
case *
args = ($args $x)
}
}

dir = /mnt/wsys
if(! test -f $dir/cons)
dir = /mnt/term/$dir
id=`{cat $dir/new/ctl}
id=$id(1)

if(~ $#args 1  ~ $args /*){
adir = `{basename -d $args}
args = `{basename $args}
echo 'name '^$adir^/-spell  $dir/$id/ctl
cd $adir
}
if not {
echo 'name '^`{pwd}^/-spell  $dir/$id/ctl
}

{
echo noscroll
if(~ $#args 0){
cat  /tmp/$pid^'.'aispell0; i = /tmp/$pid^'.'aispell0; winname 
= `{cat /mnt/acme/$winid/tag | awk '{print $1}'}; for(j in `{cat $i | 
$home/local/bin/ispell -a $spellflags | awk '/^[#]/{gsub(/ /,_); 
print}'}){$home/local/bin/acme/spout $i | grep `{echo $j | awk -F_ '{print 
$2}'} | awk -F: '{OFS=:;$1 = '$winname'; print}'  /tmp/$pid^'.'aispell } 
; sort -u /tmp/$pid^'.'aispell  $dir/$id/body; rm -f /tmp/$pid^'.'aispell*
}
if not for(i in $args){
for(j in `{cat $i | $home/local/bin/ispell -a $spellflags | awk 
'/^[#]/{gsub(/ /,_); print}'}){$home/local/bin/acme/spout $i | grep `{echo 
$j | awk -F_ '{print $2}'}  /tmp/$pid^'.'aispell } ; sort -u 
/tmp/$pid^'.'aispell  $dir/$id/body; rm -f /tmp/$pid^'.'aispell
}
echo clean
} $dir/$id/ctl


Now you can use it in the tag line to spell check the dot, and the
output begins with the name of the window, so if you select all the
window's body, you can spell check it without save it with the same
commodity. Of course the addresses of the misspelled words don't works
with a common selection.

To make this work, I need to know how to get the dot address within
the script.  Also the functions don't work in acme, but a similar script
works. Why?

fn aispellen {$home/local/bin/acme/aispell -p$home/lib/pdict_en -damerican $*}

Any help?



[9fans] International Ispell in Plan9

2013-04-12 Thread trebol
Thanks for the help erik!

This is the best I made for now...

/
/

#!/bin/rc

rm -f /tmp/$pid^'.'aispell*

args=()
spellflags=()
for(x){
switch($x){
case -d*
spellflags=($spellflags $x)
case -p*
spellflags=($spellflags $x)
case -T*
spellflags=($spellflags $x)
case *
args = ($args $x)
}
}

dir = /mnt/wsys
if(! test -f $dir/cons)
dir = /mnt/term/$dir
id=`{cat $dir/new/ctl}
id=$id(1)

if(~ $#args 1  ~ $args /*){
adir = `{basename -d $args}
args = `{basename $args}
echo 'name '^$adir^/-spell  $dir/$id/ctl
cd $adir
}
if not {
echo 'name '^`{pwd}^/-spell  $dir/$id/ctl
}

{
echo noscroll
if(~ $#args 0){
cat  /tmp/$pid^'.'aispell0
i = /tmp/$pid^'.'aispell0
winname = `{sed 's/ .*//g'  /mnt/acme/$winid/tag}
if(~ $winname '') winname = nonamedwindow
for(j in `{$home/local/bin/ispell -a $spellflags  $i | grep 
'^[#]' | sed 's/ /_/g'}){
{cat $i; echo} | $home/local/bin/acme/spout | # spout 
needs \n
grep `{echo $j |
awk -F_ '{print $2}'} |
awk -F: '{OFS=:;$1 = '$i'; print}'  
/tmp/$pid^'.'aispell 
} 
sort -u /tmp/$pid^'.'aispell  $dir/$id/body
rm -f /tmp/$pid^'.'aispell*
}
if not for(i in $args){
for(j in `{ $home/local/bin/ispell -a $spellflags  $i | grep 
'^[#]' | sed 's/ /_/g'}){
{cat $i; echo} | $home/local/bin/acme/spout |
grep `{echo $j | awk -F_ '{print $2}'} |
awk -F: '{OFS=:;$1 = '$i'; print}' /tmp/$pid^'.'aispell
}
sort -u /tmp/$pid^'.'aispell  $dir/$id/body
rm -f /tmp/$pid^'.'aispell
}
echo clean
} $dir/$id/ctl


/
/

Is 
grep '^[#]' | sed 's/ /_/g' 

better than

awk '/^[#]/{gsub(/ /,_); print}'
?

I can use sed instead of awk in 
awk -F: '{OFS=:;$1 = '$i'; print}'

but if the tag name contains the character used in sed as '/' it will
cause errors.  I discovered working in this script that acme has problems
with file names containing whitespaces (I only can open it at startup
and if you click in the tag strange things happens...) so a solution would
be:

sed 's ^[^:]*: '$winname': g'

 and i think further simplification is possible by using
 {} instead of the temporary file dance.

I don't have the knowledge to make a better redirection work with the
standard input sent to the script.  Specially with the output of the
statements inside the for loop.  The file funky dance was the only way I
found to make the work. 

 and i'd imagine that that's where the bug is.

The script works fine, 'aispell /some/file', 'aispell  /some/file' and
executing  ' aispell' in a acme's window with some text selected works as
expected.  But executing ' aispelles' in a acme's window, where aispelles
is a function:

'fn aispelles {/aispell/path -despañol -Tutf8 
-p/personal/dictionary/path $*}' 

doesn't works.  But this function in win or outside acme works fine
('aispelles  /some/file' and 'aispelles /some/file'), so I
don't know what is the problem.

Also, I corrected a bug related with spout, it needs \n previous to EOF, so
the last line in a input without \n now doesn't stay out of the check.

I have looked in the acme scripts a lot and I can't find any example of
getting the dot address, only in c code.  If anyone knows how to make it
in rc, I will be very grateful.  I think with the feature of selecting a address
in the output of the script executed to any selected text in a window,
and pointing the cursor in the right position, the work will
be finish.

I'm learning a lot about Plan9, acme, rc, awk, sed ... perhaps I should have to 
wait
until I have the skills and knowledge about programming and Plan9 before
posting anything like this in the list, but I thought this could be useful
for someone.

Regards,
trebol.



[9fans] International Ispell in Plan9

2013-04-11 Thread trebol
 And you can have ' /personal/dictionary/path' [...]

Sorry, this must be 'echo  /personal/dictionary/path' and make a 2-1 mouse
chord.

Regards,
trebol.



[9fans] International Ispell in Plan9

2013-04-10 Thread trebol
Hello everyone,

First of all, I'm just starting to learn programming, and I'm a complete
newbie in Plan9, so please, be patient...  I was sad with the English
only spell checker, so I compiled international ispell with ape:

-Installed pdcurses.
-Patched term.c for termios.h, I used a linux patch (I don't have idea)
-Modified correct.c:827 (I had type conflicts).
(void) fputs ((const char*)tok, logfile); 
-Edited local.h.generic for local.h:

#define MINIMENU/* Display a mini-menu at the bottom of the 
screen */
#define USG /* Define on System V or if term.c won't 
compile */
#undef NO_FCNTL_H   /* Define if you get compile errors on fcntl.h 
*/
#define NO_MKSTEMP  /* Define if you get compile or link errors */
#define CFLAGS  -O -D_POSIX_SOURCE -D_BSD_EXTENSION
#define TERMLIB -lcurses
#define REGLIB  
#undef NO8BIT
#define WORDS   /usr/trebol/local/share/dict/words

#define LANGUAGES 
{american,MASTERDICTS=american.med,HASHFILES=americanmed.hash,EXTRADICT=} 
{español}
/*
 * Important directory paths.  If you change MAN45DIR from man5 to
 * something else, you probably also want to set MAN45SECT and
 * MAN45EXT (but not if you keep the man pages in section 5 and just
 * store them in a different place).
 */
#define BINDIR  /usr/trebol/local/bin
#define LIBDIR  /usr/trebol/local/lib
#define MAN1DIR /usr/trebol/local/man/man1
#define MAN45DIR /usr/trebol/local/man/man5

I used http://www.datsi.fi.upm.es/~coes/espa~nol-1.7.tar.gz for Spanish
spell checking, untar it in ispell-3.3.02/languages/español and made
some changes:

-Changed all files and directories names to utf8 (acme don't work fine with the 
~)
-Added a utf8 formatter to the aff file:

altstringtype utf8 tex .txt

altstringchar   á\'a
altstringchar   Á\'A
altstringchar   é\'e
altstringchar   É\'E
altstringchar   í\'i
altstringchar   Í\'I
altstringchar   ñ\'n
altstringchar   Ñ\'N
altstringchar   ó\'o
altstringchar   Ó\'O
altstringchar   ú\'u
altstringchar   Ú\'U
altstringchar   ü\u
altstringchar   Ü\U

-Edited Makefile, changed LANGUAGE to español and corrected paths:

...
PATHADDER   =   ../../
BUILDHASH   =   ../../buildhash
UNSQ=   ../../unsq
FIX8BIT =   ../../fix8bit
...
LANGUAGE=   español
...
eñe:
sh eñes
...
../../munchlist -v -l ...

'make' works fine, but the deformatters must be compiled, 'make install'
expects executables but 'make all' creates .o files.  After 'make install'
the Spanish .aff and .hash files must be moved to the correct directory.

Well, ispell's normal mode works, but the suggestions and the line of the
misspelled word aren't showed (curses's problems?). Interactive and -a,
-l modes works fine.

The next problem was acme.  I had to change spout.c:63 for no ASCII characters:
if(isalpharune(c))

Then aspell.  I made a version for ispell...  well this was for me a
nightmare, but I've learned a lot about rc.

#!/bin/rc

args=()
spellflags=()
for(x){
switch($x){
case -d*
spellflags=($spellflags $x)
case -p*
spellflags=($spellflags $x)
case -T*
spellflags=($spellflags $x)
case *
args = ($args $x)
}
}

dir = /mnt/wsys
if(! test -f $dir/cons)
dir = /mnt/term/$dir
id=`{cat $dir/new/ctl}
id=$id(1)

if(~ $#args 1  ~ $args /*){
adir = `{basename -d $args}
args = `{basename $args}
echo 'name '^$adir^/-spell  $dir/$id/ctl
cd $adir
}
if not {
echo 'name '^`{pwd}^/-spell  $dir/$id/ctl
}

{
echo noscroll
if(~ $#args 0)
for(j in `{$home/local/bin/acme/spout | sort -t: -u +2 | sort 
-t: +1.1n}){if(test `{echo -n $j | $home/local/bin/ispell -l $spellflags}){echo 
-n $j; echo -n $j | $home/local/bin/ispell -a $spellflags | awk -F: 
'/^/{ORS=; print $2}'; echo}}  $dir/$id/body
if not for(i in $args)
cat $i | for(j in `{$home/local/bin/acme/spout | sort -t: -u +2 
| sort -t: +1.1n}){if(test `{echo -n $j | $home/local/bin/ispell -l 
$spellflags}){echo -n $i; echo -n $j; echo -n $j | $home/local/bin/ispell -a 
$spellflags | awk -F: '/^/{ORS=; print $2}'; echo}}  $dir/$id/body
echo clean
} $dir/$id/ctl


This works, and the output is like this:

test:#0,#7:centeya centena
test:#8,#14:camiño camilo, camino, cariño
test:#15,#21:camion camino, camión

So you can click to visit the file in the word misspelled

[9fans] Spanish spell

2013-04-07 Thread trebol
I see, sprog is based on unix's spell, so no Spanish spell checking
for me...  Anyone has ported international ispell to plan9?  I don't see
anything in contrib neither 9fans's archives.



[9fans] Spanish spell

2013-04-06 Thread trebol
Hello everyone, 

Anyone have a Spanish dict for sprog, or can tell me what is the best
way to make one using a spell|aspell|hunspell one?  Is this possible or is
sprog designed only for ASCII?

Regards,
trebol.



[9fans] documentation suggestion

2013-04-01 Thread trebol
On Mon, Apr 01, 2013 at 08:08:18AM +0200, Peter A. Cejchan wrote:
 to save my time, could you, please, share that trick? Thanks,
 
 ++pac

Hello Peter, I suppose my English is too bad.  The trick I was talking
about is the dragging feature itself, sorry.



[9fans] documentation suggestion

2013-03-31 Thread trebol
Hello everyone, 
I've had problems discovering the feature of dragging button 1 to scroll
the tag line.  I have used first the p9p's acme, which has a more natural
way to manage the tag line, so I thought I was missing something.
I have been looking in the 9fans archives and I found the trick.
Then in abaco, when a text box was full and a strange picture appeared
(again) on the left, I said Why not? and voilà! this works here too,
and the picture turned out to be a scroll bar.

Yes, for you this could be a silly question, but for a newbie like me is
not.  IMHO, those things must be in the man pages.

Regards,
trebol.



[9fans] Disk backup?

2013-03-26 Thread trebol
I see a lot of interesting things on this thread, but all of those are
beyond my knowledge.  I'm just starting to learn programming (KR),
the internal structure of the file system is too much for me now. I'm
thinking about mount dump, and copy the /n/dump directory to other system
(linux). So my questions are:

- Is there a way to simulate the incremental backup feature of gnu tar?
- Is possible to restore the system in a new disk with this copy of dump?
- What do you recommend me for send the tar file, ssh, nfs or other thing?

thanks,
trebol.



[9fans] Disk backup?

2013-03-24 Thread trebol
Hi everyone,

What is the more efficient backup procedure in Plan 9 do you recommend?

I'm using cwfs and I think 9fs dump is incredible - I can recover
that thing I dropped a month ago and now I am regret for doing that -
but the disk failure nightmare is always present.

thanks in advance,
trebol.



[9fans] Disk backup?

2013-03-24 Thread trebol
 if you can afford it, i'd make a periodic copy of the dump device to
 another disk in the same machine.  i might even consider just copying
 the whole disk.

I've had bad experiences with CDs and DVDs, so I'm going to follow
your advise and just copy the whole dump device; and keep reading the
documentation, but I think in the future I'll ask the list about the
correct restoration of the dump.

Thanks a lot!

trebol.



[9fans] chess?

2013-02-10 Thread trebol
Hello all,

How do you play chess with plan9? I saw a gnuchess version in the games's
man page of the first edition:

doc.cat-v.org/plan_9/1st_edition/manual.pdf

Any board also?

Thanks in advance,
trebol.



[9fans] Spanish hyphenation in troff

2013-01-18 Thread trebol
Hello all,
Anyone know how to get spanish hyphenation in troff?

Thanks in advance,
trebol.



[9fans] Spanish hyphenation in troff

2013-01-18 Thread trebol
Thanks Gorka, but I've tried that with
ftp.ctan.org/pub/tex/language/hyphenation/eshyph.tex 
and all I've is:

assertion failed: file n8.c:543

I'm new to plan9, so I'm a little lost.  Sorry if this is an
obvious/common task.

trebol.



[9fans] Spanish hyphenation in troff

2013-01-18 Thread trebol
 In other words, forget my previous recommendation, hyphenation only seems
 to work for ascii.

This is a shame... I was very happy with the multilingual point in the OS's 
design.

 Or, alternatively, this is an opportunity for you to reimplement n8.c
 for UTF8 support.

I'm just starting to learn C (In fact to learn programming!), but this
could be my first mission.

 Or alternatively, to use the TeX hyphen stuff with TeX since TeX is
 available for Plan9:
 
 http://www.kergis.com/en/kertex.html

I'm familiar with kerTeX, but I would like to work with troff.

Anyone has compiled heirloom troff with APE?
And thanks for your responses,
trebol.