Re: [9fans] Plan 9 from User Space still mantained?
>warnings the compiler wrapper provided silences quite a lot of warnings (https://github.com/9fans/plan9port/blob/master/bin/9c#L42 to #L84) and the list grows over time. >acme has been rock solid for me. last hiccups were several years ago, related to some X wonkyness. >reliability a couple gotchas carried over from plan9. 9 sed quietly truncates lines to 8193 characters. the p9p is mature-ish, thus changes are slow. there's a couple forks floating around with customisations, like https://github.com/9fans/plan9port/compare/master...dexen:plan9port:dexen On Thu, 20 Jun 2024 at 14:52, Roderick wrote: > > Dear Sirs! > > I hope, I can also ask here about Plan9 port ... > > I just compiled master from on FreeBSD14.0: > https://9fans.github.io/plan9port/ > > Is this actual? I got some warnings, bellow the messages. > > I have another question, and ask first to forgive me for it ... > > You know, one trusts nvi and emacs because they are so old, > because there are so much people using it. I am sure one > can trust acme and sam on plan9. But what about sam on > FreeBSD from the port? Is it reliable or should I consider it > experimental? Could it spoil a big file? > > Thanks > Rodrigo > > > > - > > #uname -a > FreeBSD fbsd.local 14.0-RELEASE-p6 FreeBSD 14.0-RELEASE-p6 #0: > Tue Mar 26 20:26:20 UTC 2024 > r...@amd64-builder.daemonology.net: > /usr/obj/usr/src/amd64.amd64/sys/GENERIC amd64 > > # ./INSTALL > + Mailing list: https://groups.google.com/group/plan9port-dev > + Issue tracker: https://github.com/9fans/plan9port/issues/ > + Submitting changes: https://github.com/9fans/plan9port/pulls > > * Resetting /usr/opt/plan9/config > * Running on FreeBSD, adjusting linker flags > * Compiler version: > FreeBSD clang version 16.0.6 > (https://github.com/llvm/llvm-project.git > llvmorg-16.0.6-0-g7cbf1a259152) > * Building mk... > >>> pwd > >>> pwd > >>> pwd > >>> pwd > * Building everything (be patient)... > >>> cd /usr/opt/plan9/src/lib9p; mk all > 9c -pthread req.c > req.c:63:2: warning: misleading indentation; statement is not part of > the previous 'if' [-Wmisleading-indentation] > req.c:61:1: note: previous statement is here > req.c:75:2: warning: misleading indentation; statement is not part of > the previous 'if' [-Wmisleading-indentation] > req.c:72:1: note: previous statement is here > req.c:109:2: warning: misleading indentation; statement is not part of > the previous 'if' [-Wmisleading-indentation] > req.c:107:1: note: previous statement is here > >>> cd /usr/opt/plan9/src/lib9p; mk all > 9c -pthread srv.c > srv.c:104:2: warning: misleading indentation; statement is not part of > the previous 'if' [-Wmisleading-indentation] > srv.c:98:1: note: previous statement is here > srv.c:804:2: warning: misleading indentation; statement is not part of > the previous 'if' [-Wmisleading-indentation] > srv.c:801:1: note: previous statement is here > >>> cd /usr/opt/plan9/src/libmemlayer; mk all > 9c -pthread draw.c > draw.c:68:3: warning: misleading indentation; statement is not part of > the previous 'if' [-Wmisleading-indentation] > draw.c:67:1: note: previous statement is here > draw.c:79:3: warning: misleading indentation; statement is not part of > the previous 'if' [-Wmisleading-indentation] > draw.c:78:1: note: previous statement is here > >>> cd /usr/opt/plan9/src/libsunrpc; mk all > 9c -pthread server.c > server.c:95:3: warning: misleading indentation; statement is not part > of the previous 'if' [-Wmisleading-indentation] > server.c:94:1: note: previous statement is here > >>> cd /usr/opt/plan9/src/cmd/fossil; mk all > 9c -pthread check.c > check.c:298:4: warning: misleading indentation; statement is not part > of the previous 'if' [-Wmisleading-indentation] > check.c:296:1: note: previous statement is here > check.c:604:3: warning: misleading indentation; statement is not part > of the previous 'if' [-Wmisleading-indentation] > check.c:602:1: note: previous statement is here > >>> cd /usr/opt/plan9/src/cmd/rio; mk all > 9c -pthread -I/usr/local/include -DDEBUG -DSHAPE -DDEBUG_EV -DDEBUG client.c > client.c:16:1: note: conflicting prototype is here > client.c:39:1: note: conflicting prototype is here > client.c:61:1: note: conflicting prototype is here > client.c:121:1: note: conflicting prototype is here > client.c:139:1: note: conflicting prototype is here > client.c:181:1: note: conflicting prototype is here > >>> cd /usr/opt/plan9/src/cmd/rio; mk all > 9c -pthread -I/usr/local/include -DDEBUG -DSHAPE -DDEBUG_EV -DDEBUG error.c > error.c:14:1: note: conflicting prototype is here > error.c:23:1: note: conflicting prototype is here > error.c:51:1: note: conflicting prototype is here > error.c:86:1: note: conflicting prototype is here > >>> cd /usr/opt/plan9/src/cmd/rio; mk all > 9c -pthread -I/usr/local/include -DDEBUG -DSHAPE -DDEBUG_EV -DDEBUG event.c > event.c:15:1: note: conflicting prototype is here > event.c:115:1: note: conflicting prototype is here > event.c:186:1: note: conflicti
[9fans] Rc here documents in function
is there a patch for Rc out there that lets it handle here documents inside a function body? -- dx
[9fans] Upas and Message-ID?
by chance found[1] the following passage: >(...) and the Bell Labs upas mailer never creates Message-ID. out of curiosity, any particular rationale behind that? [1] https://cr.yp.to/immhf/thread.html
[9fans] pass list from Rc to awk (p9p vs plan9)
mental note, as it took me a second to put it together: #!/usr/bin/env rc flag e + myList = ( aa bb cc) awk ' BEGIN { split(ENVIRON["myList"], myList, "\001") # "\000" on plan9 proper for (n in myList) print n, myList[n] } '
Re: [9fans] What are you using Plan 9 for?
i'm using plan9port (thanks, rsc) on linux for some 8 years now, for all coding - mostly low-brow web dev primarily Acme as IDE, Rc and awk for scripting the necessary tooling back when i was stuck at a corpo and had to use Windows on workstation, i installed p9p on one of build servers and ran Acme over LAN, through Xming there was no noticeable latency; it felt snappier than the corpo blessed IDE on windows my typical setup is: slackware linux, p9p, Acme maximized on the right screen. a few years ago i've coded a minimalist IRC client for Acme, was surprisingly comfy, but never followed it up another small use case was simplistic HTTP server for game map files coded in Rc; just enough to handle HTTP GET with Range header. was maybe 50 lines of shell. On Thu, Jun 21, 2018 at 11:06 AM, Rui Carmo wrote: > I’m late to the thread, but this seems like a good point to step in. > > I’m using plan9 on a quad-core Raspberry Pi as a sort of universal > terminal to manage some of my home machines, and recently deleted the > 9front VM I had on my home KVM server because even though the programming > model and Go support were nice, most of my day-to-day work is on cloud > solutions and there was no easy way to make those co-exist with Plan9 usage. > > There were a few discussions in this thread around dev stacks, browsers, > etc., and my $0.02 on that is that I could probably work in Plan9 on a > daily basis _if_ it had a usable (i.e., all the warts including JavaScript > and fonts) web browser, but that the lack of alignment (intended or > otherwise) with Linux tools and app stacks (SSH, Node, Python, Java) would > make it very painful. > > Running a remote browser (which is what I do often in that Pi) sort of > works, but you never get the full benefits you’d get with a native process. > And lack of access to modern app stacks renders the platform unattractive > for mainstream development work. > > But what killed it for me was the need for chording (mouse or keys). Using > a modern trackpad on a MacBook or Surface device is a quantum leap beyond > using a mouse for general use, and the lack of a modernised Rio with enough > thoughtful design to overcome the differences in philosophy is the first > barrier to continued usage. > > Acme is something I miss on occasion, but modern GUI editors compensate in > other ways (at the expense of resource usage, etc., but with a massive > boost in productivity for me). Also, I’m typing this on an iMac 5K with > nearly unmatched font rendering and legibility (the only thing that comes > close is the Surface Pro alongside it). Visuals matter a great deal. > > There is an unmatchable degree of purity in Plan9, but (even though the > diehards will stick their ground and claim it’s perfect to the exclusion of > other modern comforts) to coexist successfully it has to provide more > affordances. > > Kind Regards, > > R. > > > On 14 Jun 2018, at 04:53, 刘宇宝 wrote: > > > > Compared to "not for you", "don't care", "intend to not be successful", > I like more the topic of cat-v irc channel on freenode set by aiju: "fun > fact: you can use multiple operating systems at the same time". > > > > Certainly Plan 9 can't replace Linux/macOS/BSD/Windows, I'm still > curious its upper bound for a sensible daily usage, and the best practice > from you happy experienced Plan 9 users. > > > > I checked mail headers in this mailing list, seems all use Apple Mail, > iPhone Mail, WebMail with AJAX, Gmail(a lot), ProtonMail, these emails > went through Postfix and Exim servers, probably on Linux. > > > > In great harmony, we use kinds of operating system and kinds of software > on them. > > > > Regards, > > Yubao Liu > > > >> On Jun 14, 2018, at 10:53 AM, N. S. Montanaro wrote: > >> > >> I think a lot of people discover Plan 9 and want it to be something it > isn’t, rather than stumble upon it out of necessity. As the FQA says, “Plan > 9 is not for you." > > > > >
[9fans] Acme - built in command; external command
is it possible to execute built-in command and external command with one mouse click in Acme? something like: Putall; mk
Re: [9fans] simple rc problem in p9p (on OpenBSD)
use a list. lists are created either by the parentheses: % w = ( A B C ) % # note no space before the backslash % wMultiline = (\ X\ Y\ Z\ ) % echo $w $wMultiline A B C X Y Z % for(i in $w) {echo $i; echo XXX} A XXX B XXX C XXX or by globbing: % text_files = *.txt or by expanding a whitespaced text: % text_files = `{ 9 ls *.txt } note the p9p's "ls" quotes whitespace in file names properly for Rc lists are single-level; merging two lists produces new one of single level, with all the elements in order % a = ( foo bar ) % b = ( aa $a bb ) % echo $a foo bar % echo $b aa foo bar bb side note, the ^ operator has interesting uses for lists: % a = ( foo bar baz) % b = ( aa bb cc ) % flat = ( first $a last ) % echo $a foo bar baz % echo $flat first foo bar baz last % car = $a ^ $b % echo prefix ^ $a prefixfoo prefixbar prefixbaz % echo $car fooaa barbb bazcc
[9fans] Acme: moving the cursor to tag line
i've realized i never use the Esc key in Acme. meanwhile, i often go through cycle of: - type chunk of code - grab mouse, focus tag line - type a command - grab mouse, execute the command would it make more sense to have Esc function as the "position cursor & focus at the end of tag line of the current window" shortcut? bit of a vi-like behavior; semi mode-switch, from input to execution *area*. have anything like that been tried in Acme? -- dx
[9fans] test(1) support for string length (-l) in p9p?
the man page of test(1) mentions "-l string" as string length operator for -eq, -gt, etc. but there seems to be nothing in the plan9port's src/cmd/test.c, nor in 9p.io/sources/cmd/test.c is there any implementation of this floating around?
[9fans] awk handling NUL-terminated records
i was mildly surprised that p9p awk handles NUL-terminated records just fine. either via -v 'RS=\0', or via BEGIN { RS="\0" } needed it to handle output of git status --porcelain=v2
Re: [9fans] Acme Edit to remove lines
thanks, that did the trick indeed.
[9fans] Acme Edit to remove lines
given multi-line dot, spanning only part of a file, how do i construct an Edit command to remove lines matching certain regular expression? wanted to delete lines starting with one particular character; without leaving an empty line behind, thus Edit s/X.+//d is not sufficient.
[9fans] equality sign in Rc
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)
[9fans] Slack via Acme?
was there any attempt at using Slack through Acme? the default desktop GUI, a browser AFAICT, is taking 1+ GB of RAM after a few hours
[9fans] rc expression question
given pathnames = ( foo/a.txt bar/b.txt baz/c.txt ) how do i construct arguments to test(1) that test for existence of those files in one go? wanted: test -e foo/a.txt -o -e bar/b.txt -o -e baz/c.txt assuming the pathnames may contain space characters.
Re: [9fans] linux / p9p abomination
rc is a thing of beauty. apologies for HTML in the previous message. On Wed, Mar 1, 2017 at 1:10 PM, erik quanstrom wrote: >> while (true) >> if ($watch) >> while (!$cmd) >> $watch || true > > rc allows empty conditionals, which are true. > > - erik >
[9fans] linux / p9p abomination
runs build upon file change, repeats on failure #!/usr/bin/env rc flag e + cmd = ( $* ) watch = ( inotifywait -q --recursive -e modify -e moved_to -e create -t 3 . ) while (true) if ($watch) while (!$cmd) $watch || true
[9fans] Rc redirect woes
bug in plan9port rc(1): straightforward mix of input and output redirects inside of a block (`for' loop, `if' clase) causes subsequent commands' stdout to be errorously redirected too. the trigger is one or more input redirects (<{COMMAND}). problem disappears once executions falls outside of the block. #!/usr/bin/env rc if (true) { echo bah blah blah > /dev/null echo AAA works just fine cat <{echo aaa} > /tmp/junk-if.txt echo this gets redirected errorously echo this gets redirected errorously } for (i in 1 2 3) { echo bah blah blah > /dev/null echo AAA works just fine cat <{echo aaa} > /tmp/junk-for.txt echo this gets redirected errorously echo this gets redirected errorously } echo ZZZ works just fine
Re: [9fans] Plumbing - Files with spaces
there is trfs(4), not sure if applicable to plan9port. trfs - translate spaces and other runes in file names file system http://9p.io/magic/webls?dir=/sources/contrib/nemo
Re: [9fans] Acme 2-1 chord arguments
dirty 1.) rc -c 'git '^ note the space after git idiomatic 1.) use win(1), pass 'command' argument a script which executes git for each line of input as arguments through rc(1) to evaluate the arguments in the usual way 2.) you can pass complex regular expression as argument to grep(1), without rc(1) choking on metacharacters. the argument is guaranteed not to have unforeseen side effects. example win(1) script: #!/usr/bin/env rc orig_ifs = $ifs PAGER=cat while (true) { ifs='' echo -n 'git> ' line = `{read} ifs = $orig_ifs rc -c 'git '^ $line }
Re: [9fans] make passive aggressive gcc
> > I don't know what gcc authors are smoking, but "strcpy(tmp, > "what.");" will be compiled to a few mov instructions with -O0, while > -Os still has a call to strcpy, just the way it *should* always be, > imho. not that it's any excuse, but -fno-builtin helps. On Mon, Jun 15, 2015 at 4:56 PM, Siarhei Zirukin wrote: > On Mon, Jun 15, 2015 at 3:41 PM, Ethan Grammatikidis > wrote: > > On Mon, 15 Jun 2015 09:21:56 +0100 > > Charles Forsyth wrote: > > > >> If you're using gcc 4.8.2 to compile ... anything, really ... but > certainly > >> Plan 9 or Inferno components, > >> and those use for loops with arrays, be sure to include the compilation > >> options > >> -fno-strict-aliasing\ > >> -fno-aggressive-loop-optimizations\ > >> and it will save you some time and effort. > >> It will save compilation time (not that you'll notice with that > sluggard) > >> because it won't > >> fuss even more with your program, and it will save effort, because you > >> won't have > >> to debug simple loops that have bounds changed, are removed completely, > or > >> otherwise wrecked. > >> You can find discussions of it elsewhere (which is how I found compiler > >> options to stop it). > >> I'd forgotten all about it until it surfaced again. > > > > Thanks. Reminds me I liked gcc when it applied very few optimizations. > > I guess it must have been focused on machine-specific optimizations > > back in 2007/2008. I had a cpu newer than gcc had support for, and > > compilation was actually quick. Anyone know if -O0 is a reasonable > > option these days? (I mean tested well enough to be reasonably > > bug-free.) > > I've recenetly seen a few examples where -O0 would produce a > segfaulting executable, while any other -Ox would work fine. > Also, I don't know what gcc authors are smoking, but "strcpy(tmp, > "what.");" will be compiled to a few mov instructions with -O0, while > -Os still has a call to strcpy, just the way it *should* always be, > imho. I just checked this once again (gcc-4.8.4) and it still applies. > >
[9fans] mk - how to work around environment size limit on linux
i'm using plan9port mk on linux and just hit the environment+argument length limit -- linux' execve($PLAN9/bin/rc, ... ) returns E2BIG because $newprereq gets too large. how do i work around? is there an idiomatic way of splitting up $newprereq into smaller chunks? the mkfile is: TIMESTAMP_FILE: for (i in $newprereq) do_stuff $i <|./generate-rules-for-files PATTERN where ./generate-rules-for-files outputs rules like TIMESTAMP_FILE: file_matching_pattern
[9fans] p9p Acme - how to turn off output output buffering
how do i turn off output buffering in p9p Acme for particular fd? a braindead linux application does dup(2), and proceeds using FD 3 as error output, which results in buffered output in Acme.
Re: [9fans] $ifs equivalent in mk?
On Thursday 12 of June 2014 07:59:45 erik quanstrom wrote: > > great. glad that worked. though it is always a bit sad > when one has to outwit one's tools. > still better than managing an anthill^W^W a pile of .xml `build specs' -- dexen deVries [[[↓][→]]]
Re: [9fans] $ifs equivalent in mk?
On Thursday 12 of June 2014 07:41:51 erik quanstrom wrote: > > i was demoing a technique that you might use. have you tried it? > thanks, tried and works. used sed for quoting; end result is perl-ugly: alljs=`{find -name '*.js' | 9 sed 's/''/''''/g; s/^|$/''/g' } or alljs=`{find -name '*.js' | 9 sed 's/^|$|''/&''/g' } -- dexen deVries [[[↓][→]]]
Re: [9fans] $ifs equivalent in mk?
On Thursday 12 of June 2014 07:27:18 erik quanstrom wrote: > > i have a mkfile which does: > > > > alljs=`{find -name '*.js'} > > > > my_target:Q: ... $alljs > > > > my_recipe; > > > > and it breaks for files with spaces in pathname -- each space-separated > > token of pathname is treated as separate prerequisite. > > if you rc-quote the terms, it should work. > > ; find|grep b > './a b' > ; cat mkfile > x=`{find|grep b} > > all: > echo $x|wc > for(i in $x) > echo $i > ; mk > echo ./a b|wc > for(i in ./a b) > echo $i > 1 2 6 > ./a b here the var is processed by Rc inside recipe; in my case i need it processed by Mk inside prerequisite list -- dexen deVries [[[↓][→]]]
[9fans] $ifs equivalent in mk?
i have a mkfile which does: alljs=`{find -name '*.js'} my_target:Q: ... $alljs my_recipe; and it breaks for files with spaces in pathname -- each space-separated token of pathname is treated as separate prerequisite. in Rc, i could set $ifs to bare LF and be done with it. can equivalent be done in Mk? -- dexen deVries [[[↓][→]]]
Re: [9fans] Plan9 users in Poland
On Friday 11 of April 2014 13:28:05 Szymon Olewniczak wrote: > I'm very curious about that so I would like to ask if there are any Plan > 9 users in Poland or am I the only one in my entire country? cheers, using plan9port, toying with 9front. -- dexen deVries [[[↓][→]]]
Re: [9fans] New internal command for acme proposal (with implementations)
On Wednesday 05 of February 2014 08:04:04 Bakul Shah wrote: > On Feb 5, 2014, at 3:36 AM, erik quanstrom wrote: > > once one thinks about major modifications, i think it becomes attractive > > to think about a new editor. i miss having graphics. > > If you mean mixed text and image, you will end up with some sort of > structured markup language and a "word processor"! does Abaco [1] support inline editing and HTTP PUT method (or PATCH)? > What I want is support for complex text layout rendering (for Indian > languages among others). This requires supporting OpenType fonts, not an > easy task. Mac's TextEdit seems to do a decent job of this but I don't like > it as an editor. `having all the bells and whistles' doesn't make a great editor for programmers. right now Acme is simple enough to be easily extensible and customizable for *your* needs. right now Acme is fast enough. right now Acme uses fonts simple enough to be easily converted from other fonts. ...and the list goes on... [1] http://lab-fgb.com/abaco/ -- dexen deVries [[[↓][→]]]
Re: [9fans] New internal command for acme proposal (with implementations)
On Friday 24 of January 2014 12:44:08 Uvelichitel wrote: > Hi 9fans. While working with large sources in acme I feeling some lack > of navigation capacity. So two new cmd. 1) 'Rev' , works precisely as > 'Look' but in reverse direction. It also change behavior of right mouse > button search to search reverse. You will notice change with pointer > position and little symbol near pipe in tag. Executing 'Look' instantly > change behavior back. :-/REGEX > After all navigation 2) 'Tip' , return pointer to > last typing point. It understand 2-1 chording, so you can handy insert > selection to last insert point without snarfing, including same window. Left/Right Arrow keys takes you to the position where selection (cursor) currently is. if the selection covers several lines, Left takes you to beginning, and Right to the end. this plays well with double-click on any open/close parenthesis/bracket/brace. to quickly move to the other end of code block etc. -- dexen deVries [[[↓][→]]]
Re: [9fans] devdraw memory corruption
On Tuesday 14 of January 2014 00:44:47 cinap_len...@felloff.net wrote: > when user does read of exactly 12*12 bytes on draw > ctl file, the snprint() adds one more \0 byte writing > beyond the user buffer and corrupting memory. what symptoms were you getting? i'm seeing rare, seemingly random glitches in plan9port Acme. some windows get only partially re-drawn -- any combination of borders, background and text can be missing, as per attachment. the top right window should be showing file list, but only background was drawn. i've ported this patch to p9p to see if the breakage stops. -- dexen deVries [[[↓][→]]] <>
Re: [9fans] Acme, dump, and $HOME
On Monday 13 of January 2014 08:42:22 Paul Lalonde wrote: > Can anyone explain to me the rationale of Dump dropping acme.dump in $HOME > instead of $PWD? > I know I can pass it a different filename, but it seems odd to put it in > $HOME instead of where acme is called from. > My use case is this: I'm working on two projects, and so want to maintain > two long-term "sessions". Dump does most of what I need when I move from > one to the other, but if I don't chord in the project root directory to > save the dump to, I kill my other project session. > A one line change to looking at $PWD instead of $HOME makes acme much more > useful for my case, but am I missing an important other use? from acme(1): Dump Write the state of acme to the file name, if specified, or $home/acme.dump by default. i.e., Dump takes one optional argument: file pathname. -- dexen deVries [[[↓][→]]]
Re: [9fans] [p9p] restart program on Acme Load
On Friday 10 of January 2014 17:03:07 Alexander Sychev wrote: > But Dump command doesn't save the info back to acme.dump > > > Maybe this is a bug in rowdump function? found `dump' in acme(4) echo 'dump git gui' | 9p write acme/$winid/ctl and then Dump got me close -- but the `git gui' was started in wrong dir -- in Acme's getwd() rather than window's directory. -- dexen deVries [[[↓][→]]]
Re: [9fans] 9P on FPGA?
On Friday 10 of January 2014 12:25:24 Richard Miller wrote: > Technically yes, because inferno runs hosted on microCOS on a Nios2 soft cpu > on Altera FPGAs. But I imagine you're looking for something lower level? thanks, will look into that. but i imagine this particular implementation may be somewhat coupled to inferno and/or Nios. > But I imagine you're looking for something lower level? anything goes, Verilog preferred. i'm simply trying to learn something new :^) -- dexen deVries [[[↓][→]]]
[9fans] 9P on FPGA?
is there any known 9P implementation for FPGA? or has anyone been working on communicating with FPGAs over 9P? -- dexen deVries [[[↓][→]]]
[9fans] [p9p] restart program on Acme Load
hi list, this is plan 9 port Acme question: how do i make Acme restart application upon Load? the only thing i care about is the correct working directory. i'm running `git gui' from Acme; the tag indicates it with `git' word. upon Dump, restart Acme, Load, the `git' word is recreated in tag, but the program is not started. -- dexen deVries [[[↓][→]]]
[9fans] not exactly the p9p i was searching for ;-)
http://www.spreadshirt.com/p9p-strap-C3376A4329118 oh well. -- dexen deVries [[[↓][→]]]
Re: [9fans] split(1): -e vs. -n, -f [patch]
On Monday 30 of December 2013 11:10:45 you wrote: > both behavior and code indicate that split(1)'s `-e' (split by regular > expression) doesn't play along with either `-n' (line count) or `-f' (output > file prefix). the former is somewhat understandable, but the later is > strange in lieu of `-s' (output file suffix) working just fine. > > that by accident or is there some rationale? -- dexen deVries [[[↓][→]]] >From 01ae77413e4249776124727e797b0172e7874987 Mon Sep 17 00:00:00 2001 From: dexen deVries Date: Mon, 30 Dec 2013 15:47:24 +0100 Subject: [PATCH] make stat(1)'s `-e' play along with `-f' (output file prefix) also make the file pathname buffer a bit larger. --- src/cmd/split.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/cmd/split.c b/src/cmd/split.c index e758786..4820930 100644 --- a/src/cmd/split.c +++ b/src/cmd/split.c @@ -8,7 +8,7 @@ char digit[] = "0123456789"; char *suffix = ""; char *stem = "x"; char suff[] = "aa"; -char name[200]; +char name[2048]; Biobuf bout; Biobuf *output = &bout; @@ -130,9 +130,11 @@ int matchfile(Resub *match) { if(match[1].s.sp) { - int len = match[1].e.ep - match[1].s.sp; - strncpy(name, match[1].s.sp, len); - strcpy(name+len, suffix); + int len_match = match[1].e.ep - match[1].s.sp; + int len_stem = strlen(stem); + strcpy(name, stem); + strncpy(name+len_stem, match[1].s.sp, len_match); + strcpy(name+len_stem+len_match, suffix); openf(); return 1; } -- 1.7.12.1
[9fans] split(1): -e vs. -n, -f
hi list, both behavior and code indicate that split(1)'s `-e' (split by regular expression) doesn't play along with either `-n' (line count) or `-f' (output file prefix). the former is somewhat understandable, but the later is strange in lieu of `-s' (output file suffix) working just fine. that by accident or is there some rationale? -- dexen deVries [[[↓][→]]]
Re: [9fans] mk time-check/slice issue
On Thursday 19 of December 2013 14:09:05 a...@9srv.net wrote: > > There is a reason (or set of reasons) we're using Plan 9, as > opposed to doing everything on Linux or whatnot. The > system is designed with a different set of principles in mind. as a resident contrarian, let me say: there is a reason i prefer using p9p (mk, rc, acme) when working on linux -- rather than just linux (or GNU Make, Bash, emacs/vi), with all the assorted bells and whistles. call it zen, call it time saver, i debug my projects, not the meta-projects. commit. -- dexen deVries [[[↓][→]]]
Re: [9fans] Problem with mk
the problem is not solved, merely one of the manifestation is eliminated. actual solution requires stating all the dependencies. if your list of sources and/or targets is dynamic, consider using mk include: <| GEN_DEPS where `GEN_DEPS' is your script generating deps in form TARGET: PREREQUISITE On Wed, Dec 18, 2013 at 10:14 PM, Blake McBride wrote: > Thanks. That is what I was wondering. In the interim, and having a better > understanding of what is going on, I was able to re-work my mkfile to > support parallel builds where possible. I am, however, experiencing a new > problem. I will write that up in a separate post. > > Thank for the info! > > Blake > > > > On Wed, Dec 18, 2013 at 3:04 PM, Jacob Todd wrote: >> >> You could put NPROC=1 in the mkfile. > >
Re: [9fans] Problem with mk
On Wednesday 18 of December 2013 09:23:19 Blake McBride wrote: > > Problem 1: > it seems you have an un-stated dependency/cies among your intermediate targets / prerequisites. Say, foo.o depends on foo.c and foo.h -- but foo.h also depends on generated_foo.h, which should be generated by make. in such case, explicitly state (no recipe is necessary): foo.h: generated_foo.h so mk knows the `generated_foo.h' must be completed first. > Problem 2: > > Even though I am executing mk with the "-s" option, it still seems like it > is running in parallel because a subsequent command can't find a file > created by a prior command - as if it didn't wait for the prior command to > finish. Remember this build fine, and without error codes, when executed > manually. -s won't help you there, because it regards processing of /command line/ arguments, not of prerequisites. consider: $ NPROC=1 mk my_target also investigate -d[egp] debug stuff. have fun with mk, it's a great little tool :-) -- dexen deVries [[[↓][→]]] Take care of the luxuries and the necessities will take care of themselves. -- L. Long
Re: [9fans] Can't start multiple copies of acme
i'm using two Acmes all the time, with: <<<'EOF' #!/usr/bin/env rc flag e + NAMESPACE=`{namespace}^-2 mkdir -p `{namespace} plumber || true exec acme EOF; of course plumber sends to the first copy. -- dexen deVries [[[↓][→]]] Take care of the luxuries and the necessities will take care of themselves. -- L. Long
[9fans] marking lines in Acme
hi list, i reckon the subject of multi-selections in Acme has been discussed back and forth, but please hear me out. use case: i want to indicate in Acme which lines of a file has been changed. a script executes `git show HEAD' (last commited changes) or `git diff' (uncommited changes), opens indicated files and marks what has been changed. as of now, the script marks only first changed range in file via selection. any /other/ sensible way of indicating other changes in this file? -- dexen deVries [[[↓][→]]]
[9fans] p9p mk rc help
Hi list, apologies for the keyword overload ;-) I have a plan9port mkfile using Rc (MKSHELL=$PLAN9/bin/rc), a recipe contains pipeline: FOO_COMMAND | BAR_COMMAND. What is the correct way of detecting failure exit status of FOO_COMMAND (a networked operation) and ignoring exit status of BAR_COMMAND? the best i came up with is very ugly: target: prereq FOO_COMMAND | BAR_COMMAND st = $status if (~ $st ?* ^ '|' ^ *) { echo FOO_COMMAND failed exit 3 } seems the | in pattern has to be quoted, otherwise is interpreted as pipe operator. regards, -- dx
Re: [9fans] i'm afraid we've had it wrong
On Sunday 29 of September 2013 10:39:40 Rob Pike wrote: > He appears not to understand the concept of "research". and he fails to note that every single thing he mentions has already made its way into commercial OSes (at least RedHat has 100% of it; MacOS X has some). even the /net is widespread in a bastardized form thanks to the `/dev/tcp/$IP/$PORT' hack in bash. -- dexen deVries [[[↓][→]]] I have seen the Great Pretender and he is not what he seems.
Re: [9fans] how to output NUL byte from awk?
On Tuesday 17 of September 2013 12:50:07 erik quanstrom wrote: > On Tue Sep 17 10:04:20 EDT 2013, k...@sciops.net wrote: > > Quoting dexen deVries : > > > awk(1) says, ``[s]tring constants are quoted " ", with the usual C > > > escapes > > > recognized within.'', but \0 seems to terminate internal string > > > reprezentation... > > > > > > so how do i output a real NUL byte? > > > > Does printf not do this? > > no, awk's printf does not do that: > minooka; awk 'BEGIN{printf "%c", utf(0)}' | wc > 0 0 0 > minooka; awk 'BEGIN{printf "%.5s", "12\034567890"}' | xd -1 > 000 31 32 1c 35 36 > minooka; awk 'BEGIN{printf "%.5s", "12\0\034567890"}' | xd -1 > 000 31 32 utf() is the problem, %c expect int, not string: 9 awk ' BEGIN { printf "%c", 0 } ' | 9 wc 0 1 1 9 awk ' BEGIN { printf "X%cX", 0 } ' | 9 xd 000 58005800 -- dx
Re: [9fans] how to output NUL byte from awk?
On Tuesday 17 of September 2013 12:50:07 erik quanstrom wrote: > On Tue Sep 17 10:04:20 EDT 2013, k...@sciops.net wrote: > > Quoting dexen deVries : > > > awk(1) says, ``[s]tring constants are quoted " ", with the usual C > > > escapes > > > recognized within.'', but \0 seems to terminate internal string > > > reprezentation... > > > > > > so how do i output a real NUL byte? > > > > Does printf not do this? > > no, awk's printf does not do that: > minooka; awk 'BEGIN{printf "%c", utf(0)}' | wc > 0 0 0 > minooka; awk 'BEGIN{printf "%.5s", "12\034567890"}' | xd -1 > 000 31 32 1c 35 36 > minooka; awk 'BEGIN{printf "%.5s", "12\0\034567890"}' | xd -1 > 000 31 32 printf "%c", 0 -- dexen deVries [[[↓][→]]] Take care of the luxuries and the necessities will take care of themselves. -- L. Long
Re: [9fans] how to output NUL byte from awk?
On Tuesday 17 of September 2013 14:03:11 Kurt H Maier wrote: > Quoting dexen deVries : > > awk(1) says, ``[s]tring constants are quoted " ", with the usual C escapes > > recognized within.'', but \0 seems to terminate internal string > > reprezentation... > > > > so how do i output a real NUL byte? > > Does printf not do this? thanks i feel really dumb now ;-) -- dx
[9fans] how to output NUL byte from awk?
awk(1) says, ``[s]tring constants are quoted " ", with the usual C escapes recognized within.'', but \0 seems to terminate internal string reprezentation... so how do i output a real NUL byte? -- dexen deVries [[[↓][→]]]
Re: [9fans] Look vs. Edit?
On Wednesday 11 of September 2013 12:28:16 Lee Fallat wrote: > Personally, I have replaced Look with Edit because I just highlight-B3 and > it searches. Plus I use the sam command language a lot. Look is guaranteed to be side-effect free, while B3 can end up invoking any program as defined in /usr/$user/lib/plumbing. i used to have a (now long forgotten) script perform some operation on current Git repository upon B3 on SHA1. -- dexen deVries [[[↓][→]]] Take care of the luxuries and the necessities will take care of themselves. -- L. Long
[9fans] programmable pathname completion in Acme?
currently the ^F pathname completion is handled internally by Acme. is there a way to pass the argument of ^F to a script instead? my use case: find an existing pathname by supplying /any/ substring of it and invoking completion, as opposed to current requirement of providing whole leading part. i have a script that takes part of pathname in $1 and returns all (hopefully exactly one) matching pathnames, and i want to plumb the ^F from Acme to it. -- dexen deVries [[[↓][→]]]
Re: [9fans] p9p mk(1) syntax
thanks to you both. http://github.com/dexen/plan9port-custom/commit/6a67d4d8c97bc682737ae1cf59544fb4c969a105.patch cinap's version also supports rc block statements; tested with: MKSHELL = rc foo = `{ echo aaa; { date; }; pwd; } bar = `{ echo zzz `{ date } zzz } test:VQ: echo foo $foo echo bar $bar On Sat, Sep 7, 2013 at 5:05 PM, wrote: > why not this? > > + if(term == '}' && c == '{') > + depth++; > > -- > cinap >
[9fans] p9p mk(1) syntax
in p9p mk, this works as expected: foo = `{echo bar} but the following does not -- rc(1) indicates syntax error: foo = `{echo `{echo bar}} strace indicates that mk(1) passes input to rc(1) with no closing braces at all. i'm using MKSHELL = rc. -- dexen deVries [[[↓][→]]] Take care of the luxuries and the necessities will take care of themselves. -- L. Long
[9fans] p9p mk(1) syntax
in p9p mk, this works as expected: foo = `{echo bar} but the following does not -- rc(1) indicates syntax error: foo = `{echo `{echo bar}} strace indicates that mk(1) passes input to rc(1) with no closing braces at all. i'm using MKSHELL = rc. -- dexen deVries [[[↓][→]]]
Re: [9fans] [plan9] acme noscrool feature enable
On Monday 02 of September 2013 12:58:28 Giovanni Casano wrote: > 9term windows default behaviour does not scroll when output reaches > the end of the window: this is what I am trying to do. > Few months ago I succeded in that... now I do not remember how I did :( when executed in Acme, the following scrolls by default, but will pause scrolling when you scroll up so far that the last line of output goes out of window (becomes invisible): win ANY_COMMAND for example: win rc -c 'while (true) date && sleep 1' win ssh dexen@baron -- dexen deVries [[[↓][→]]] Take care of the luxuries and the necessities will take care of themselves. -- L. Long
Re: [9fans] [plan9] acme noscrool feature enable
On Monday 02 of September 2013 14:19:17 Alexander Sychev wrote: > Hi, > As far as I know Acme doesn't have the "noscroll" feature at all. if `win' is of any help, it has the following property: > Win windows follow the > same scrolling heuristic as in 9term(1): the window scrolls > on output only if the window is displaying the end of the > buffer. -- dexen deVries [[[↓][→]]] Take care of the luxuries and the necessities will take care of themselves. -- L. Long
Re: [9fans] reading addr always returns #0,#0?
On Monday 02 of September 2013 14:13:56 Alexander Sychev wrote: > The problem is the "addr" file is closed between your calls. When you open > the "addr" file next time, an internal address is set to 0,0. > But after the writing the address is actual and if you read "data" file you > will see the text according to your address. > > I you write the code on C or Go without a closing a descriptor of "addr" > file, everything will be ok :-) or use 9p rdwr: echo -n , | 9p write acme/2/addr echo 'dot=addr' | 9p rdwr acme/2/ctl -- dexen deVries [[[↓][→]]] Take care of the luxuries and the necessities will take care of themselves. -- L. Long
Re: [9fans] cifs fails on nodes named aux
On Wednesday 28 of August 2013 10:26:01 Erik Quanstrom wrote: > the claim that the devices are in the directories and thus the file system > is still false. even if explorer has some unnecessary code. and plan 9 is > not immune from unnecessary weird bits e.g. the export protocol. a somewhat official specification confirms that -- by not listing those magic files as implied: http://msdn.microsoft.com/en-us/windows/hardware/gg463084 some more info: http://msdn.microsoft.com/en-us/library/aa365247(v=vs.85).aspx#file_and_directory_names -- dexen deVries [[[↓][→]]] Take care of the luxuries and the necessities will take care of themselves. -- L. Long
Re: [9fans] acme: send dot to the stdin of a more complicated command
On Wednesday 28 of August 2013 10:05:14 Rudolf Sykora wrote: > Hello, > > I tried to modify Russ' script below to be usable on p9p. I came up with > > #!/usr/local/plan9/bin/rc > > if(! ~ $#* 1) { > echo 'usage: Run title' >[1=2] > exit 1 > } > > id=`{awk -v 'pat='$1 '$6 ~ pat {print $1}' <{9p read acme/index}} > if(~ $#id 0) { > echo 'no match for pattern' >[1=2] > exit 2 > } > if(! ~ $#id 1) { > echo 'ambiguous pattern' >[1=2] > exit 3 > } > if(~ `{wc -w <{9p read acme/$id/rdsel}} 0) { > echo 'no command selected' >[1=2] > exit 4 > } > #exec cat <{9p read acme/$id/rdsel} > exec /usr/local/plan9/bin/rc <{9p read acme/$id/rdsel} > > > but the last line doesn't really do what I want, yielding the error: > Run: exit 1 > rc: /dev/fd/5:2: token EOF: syntax error your selection lacks the final LF to make Rc happy ;-) a quick and dirty hack would be to always append LF: exec /usr/local/plan9/bin/rc <{9p read acme/$id/rdsel;echo;} tested with: echo foo bar rc <{9p read acme/$winid/rdsel; echo; } selecting bare `echo foo bar' (without LF) gives syntax error; selecting whole line works a-OK -- dexen deVries [[[↓][→]]] Take care of the luxuries and the necessities will take care of themselves. -- L. Long
[9fans] [p9p] rc script fails silently in conditional expression calling a function
on Plan 9 Port, the following Rc script fails silently, upon calling the `foo' function in ``if (foo)''. i expected it to output `FAIL' instead. is that by design, or is it some sort of a bug? #!/usr/bin/env rc flag e + fn foo { /bin/false } if (foo) echo SUCCESS if not echo FAIL for contrast, the following script outputs `FAIL' as expected -- the difference being in calling the /bin/false directly in ``if(/bin/false)'' #!/usr/bin/env rc flag e + if (/bin/false) echo SUCCESS if not echo FAIL -- dexen deVries [[[↓][→]]] Take care of the luxuries and the necessities will take care of themselves. -- L. Long
[9fans] mk: the `D' flag
in mk(1), why is the `D' flag (if the recipe exits with a non-null status, the target is deleted) optional, rather than default? i can see why it makes little sense with together `V' flag, but for non-V rules, targeting plain files, i'd like it by default. -- dexen deVries [[[↓][→]]]
Re: [9fans] Win starting rc?
On Tuesday 11 of June 2013 13:06:15 Matthew Veety wrote: > On Jun 11, 2013, at 16:09, Brian Vito wrote: > > Is there a way to have Acme's Win command start an rc session rather > > than bash? Also, is it possible to set the bash prompt to PS1=": {\w} > > %; " if bash is started by Win? Thanks again. > > Bash was ported to plan 9? the other way around: http://swtch.com/plan9port/ also p9p mk defaults to bash , so it's good to set MKSHELL=rc on top of mkfiles. -- dexen deVries [[[↓][→]]] I have seen the Great Pretender and he is not what he seems.
Re: [9fans] btcd: A Full Alternative Bitcoin Implementation, Written In Go
On Thursday 09 of May 2013 15:04:32 erik quanstrom wrote: > On Thu May 9 15:00:26 EDT 2013, dexen.devr...@gmail.com wrote: > > do you /really/ need Yet Another Networked Filesystem in Plan9? ;-) > > yes, but what does that have to do with bitcoin? a silly joke was silly... the way i see it -- bitcoin is a distributed, append-only, content-addressable filesystem with eventual consistency. ostensibly designed for transferring coins, but can just as well house arbitrary binary data , be it a portrait and a tribute to departed people [1] or alternative DNS [2]. [1] https://bitcointalk.org/index.php?topic=33618.0 [2] http://en.wikipedia.org/wiki/Namecoin#Namecoin_DNS -- dexen deVries [[[↓][→]]]
Re: [9fans] btcd: A Full Alternative Bitcoin Implementation, Written In Go
On Thursday 09 of May 2013 21:47:48 Antonio Barrones wrote: > Hi, > I have read this article: > btcd: A Full Alternative Bitcoin Implementation, Written In Go > http://bitcoinmagazine.com/btcd-a-full-bitcoin-alternative-written-in-go > > and I wonder if this could be a way to have Bitcoin in the Plan9 > environment. do you /really/ need Yet Another Networked Filesystem in Plan9? ;-) -- dexen deVries [[[↓][→]]]
Re: [9fans] Octets regexp
please pardon the silly question, but... how about piping the binary data through xd(1) before sending it to regexp(3)? -- dexen deVries [[[↓][→]]] I have seen the Great Pretender and he is not what he seems.
[9fans] open file in awk script?
trying to create a standalone awk script (#!/usr/local/plan9/bin/awk -f). how to open a file in BEGIN pattern section and set it as next input file? not helped so far: FILENAME="foo.txt" nor ARGV[1]="foo.txt"; nextfile; -- dexen deVries [[[↓][→]]]
Re: [9fans] Acme script request (was: Acme Edit scriptlets)
On Friday 05 of April 2013 14:35:58 Martin Kühl wrote: > or using 9p(1): > > for (num in `{9p ls acme | grep '^[0-9]'}) { > if (9p read acme/$num/tag | grep -s '^'$pattern) > echo delete | 9p write acme/$num/ctl > } thanks, this version supports using two Acmes, each in separate namespace :-) -- dexen deVries [[[↓][→]]]
Re: [9fans] p9p vs. linux 9fs mount
On Thursday 04 of April 2013 11:19:53 erik quanstrom wrote: > > guess. try >> instead of >. > may try to remove the file first. ... how do i send you cookies? ;-) # strace for `>' open("/mnt/acme/2/ctl", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0666) = -1 EACCES (Permission denied) # strace for `>>' open("/mnt/acme/2/ctl", O_WRONLY|O_CREAT|O_APPEND|O_LARGEFILE, 0666) = 3 with the difference being `O_TRUNC'. cheers, -- dexen deVries [[[↓][→]]]
[9fans] p9p vs. linux 9fs mount
p9p/linux question. i can't get seem to get write access to acme's files as mounted via linux 9p driver (v9fs). read works OK, but writes are rejected. # mount -t 9p '/tmp/ns.root.localhost:13/acme' /mnt/acme -o 'trans=unix,uname=root' # ls /mnt/acme 1/ 2/ 3/ 4/ acme/ cons consctl draw/ editout index label new/ # echo delete > /mnt/acme/1/ctl -bash: /mnt/acme/1/ctl: Permission denied when mounted with debug=0x04, i see in dmesg that TRSTAT gets passed `uname=root', but TWSTAT gets `uname=(null)'. what am i doing wrong? tested with linux kernel version 3.9.0-rc3 and 3.5.0 and with recent p9p version. -- dexen deVries [[[↓][→]]]
[9fans] Acme script request (was: Acme Edit scriptlets)
an Edit script, or an Rc script for Acme, to close all windows which names start with given (literal) prefix. use case: several files and directories of two projects open in one Acme instance. want to close all windows related to one of the projects, and leave the other project's windows open. -- dexen deVries [[[↓][→]]]
Re: [9fans] Acme Edit scriptlets
On Thursday 04 of April 2013 10:19:23 Mark van Atten wrote: > On Friday, 29 March 2013 01:38:06 UTC+1, Bence Fábián wrote: > > I did a quick writeup on little Edit scripts (p9p specific) attached is my dirty hack for automagic grepping of $% file or recursively %s dir or pipe. a funky goodie: automatically supplies `.' (dot) between arguments, so for example: $ G some token here becomes `grep some.token.here' -- dexen deVries [[[↓][→]]] ``we, the humanity'' is the greatest experiment we, the humanity, ever undertook. #!/usr/bin/env rc . 9.rc s=() arg=() fn addS { if (~ $#s 0) s=$1 if not s=$s.$1 } while (! ~ $#* 0) { if (~ $1 -*) arg=($arg $1) if not addS $1 shift } if (u test -p /dev/stdin) { grep -n $arg $s exit } if (test -f $%) grep -n $arg $s /dev/null `{basename $%} if not find . -type f | grep -v '[.]/share/doc/doxygen/|/[.]git/|/[.]svn/|[.](mo|pot)$' | xargs grep -n $arg $s /dev/null
[9fans] p9p acme vs. firefox
probably more of a firefox question, but hey. once in a blue moon† the www-based software i'm developing displays a backtrace. is there a sensible way to plumb it to p9p Acme? all's running on linux/x11 -- dexen deVries [[[↓][→]]] † lies, damn lies and bug metrics ;-)
Re: [9fans] 9FRONT ANNOUNCES INTEL WIFI DRIVER, WPA/WPA2 SUPPORT
On Monday 01 of April 2013 08:13:19 andrey mirtchovski wrote: > > Looking forward to a backport of this to the stock Plan 9. > > ... and plan9port! i reckon you wrote that for fun, but nonetheless i'd gladly use a small p9p- centric linux distro. basically linux kernel for the drivers + p9p + perhaps some filesystem recovery tools. this leaves open the question of providing devdraw(1) -- perhaps via fbdev -- and the usual x11 goodies of mouse, clipboard etc.? -- dexen deVries [[[↓][→]]]
Re: [9fans] Plan 9 ``propaganda server'' back on line
On Friday 29 of March 2013 06:57:55 s...@9front.org wrote: > NO STRINGS ATTACHED it made my day, too. technically those are zero-terminated arrays of Runes... ;-) -- dexen deVries [[[↓][→]]]
Re: [9fans] Acme Edit scriptlets
On Friday 29 of March 2013 09:25:47 Peter A. Cejchan wrote: > Also, could you share the plumbing rules you use (for my > inspiration/learning)? 1) re-format PHP's strange error mesages into standard FILE_PATHNAME:LINE_NUMBER # ... called in FILE_PATHNAME on line LINE_NUMBER and defined in FILE_PATHNAME on line LINE_NUMBER data matchesmultiline '.*rror.*called in ([^ ]+) on line ([0-9]+) and defined in ([^ ]+) on line ([0-9]+).*' arg isfile $1 data set $file attr add addr=$2 type is text plumb to edit #file / line in PHP format data matchesmultiline '(.+) on line ([0-9]+).*' arg isfile $1 data set $file attr add addr=$2 type is text plumb to edit 2) display php's function prototypes on right-click on a function name with an opening parenthesis. the `W' script greps a flat text file list of functions (with arguments and return types) and outputs to +Errors window. type is text data matches '[a-zA-Z_][a-zA-Z_0-9]*[(]' plumb start W --wdir $wdir $data * * * a half-hearted support for displaying SQL table schema; again, `Wtable' is a script outputting definition of indicated table. type is text data matches '.*(FROM|JOIN)[ ]+([^ ]+).*' data set $2 plumb start Wtable --wdir $wdir $data -- dexen deVries [[[↓][→]]]
Re: [9fans] Acme Edit scriptlets
On Friday 29 of March 2013 01:38:06 Bence Fábián wrote: > I did a quick writeup on little Edit scripts > (well basicly sam(1) scripts) > If anyone have more feel free to contribute. > Maybe someone could put them on the wiki even. stuff i use: # clear whole window -- usefull with +Errors Edit ,d # decrease TAB indentation of selection Edit s,^TAB,,g # increase TAB indentation of selection # the ^. part ensures we indent only lines with content # and leave empty lines undisturbed Edit s,^.,TAB&,g -- dexen deVries [[[↓][→]]]
Re: [9fans] FAT32 question
On Wednesday 27 of March 2013 08:24:57 Comeau At9Fans wrote: > I'm mounting a FAT32 flashdrive on a RPi. However, it seems that some > sort of legacy 8.3 filename situation is existing. For instance, if I > have a directory containing x.c and a23456789.c that the former is > taken as X.C and the latter is taken as shown. Therefore, to compile > x.c is not possible. So for instance, echo *.c produces a different > result than echo *.C. I tried mv'ing the problem files and then back > but same results. > > I do believe that historically there was some sort of interpretations > such as this in the evolution from FAT to FAT32, but not sure it > should be so in current version, or, at least, other operating systems > don't take this interpretation. Is there an option or something I'm > missing? How do I get to process x.c as x.c and not X.C. there's no difference between FAT12/16 and FAT32 in treatment of file names, it is entirely up to FS driver to create or skip creation of LFN (Long File Name) entry, and to use or skip reading an LFN. every file on FAT has 8.3 name, and may, but does not have to have, an LFN. the 8.3 name is of limited charset (one of DOS or WINDOWS codepages) and upcase only, at least in canonical format. to store lowercase characters, you need LFN. IIRC, some version(s?) of fat drivers on linux did not create LFN for a file when the long filename was matching case INsensitive the 8.3 file name, essentially leading to loss of character case information. perhaps something alike is at play here. -- dexen deVries [[[↓][→]]] ``we, the humanity'' is the greatest experiment we, the humanity, ever undertook.
Re: [9fans] gcc not an option for Plan9
On Tuesday 26 of March 2013 13:11:11 Rubén Berenguel wrote: > I'm starting to wonder why I decided to subscribe to yet another newsgroup, > after having unsubscribed from so many in the past for lack of content. I > guess I never learn the required lessons. as a counterport, picol...@software-lab.de has never let me down ;-) (archives at http://www.mail-archive.com/picolisp@software-lab.de/ ) cheers, -- dexen deVries [[[↓][→]]] ``we, the humanity'' is the greatest experiment we, the humanity, ever undertook.
Re: [9fans] gcc not an option for Plan9
On Monday 25 of March 2013 19:31:27 aram wrote: > > And how do you manage to browser the web? web is made with Acme and deployed with mk, at least while i am on it. when i needed a HTTP server for an FPS game files (Xonotic), i quickly scribbled a script in Rc. at a measly few dozen lines it had proper `Range' support. -- dexen deVries [[[↓][→]]]
Re: [9fans] mk and transitive dependencies (was: gcc not an option for Plan9)
On Monday 25 of March 2013 11:40:32 Bence Fábián wrote: > mk doesn't parses '#include' directives in C gnu make can use output of gcc -M as rules describing prerequisites. it's somewhat tedious and error-prone, though, as indicated by multitude of -Mx options. -- dexen deVries [[[↓][→]]]
Re: [9fans] mk and transitive dependencies (was: gcc not an option for Plan9)
On Monday 25 of March 2013 11:33:55 hiro wrote: > > It does not understand the real dependencies in your software. > > what does "understand" mean in that context? > I would think if this is all done automagically with go it would need > to follow even more general rules, no? if mk understood 8c's construct ``#pragma lib "libbio.a"'' and used it to link correct libraries, it could be said to understand the actual dependencies as expressed by code. of course, the deeper you go into this rabbit hole, the closer you get to something resembling GNU autotools. -- dexen deVries [[[↓][→]]] ``we, the humanity'' is the greatest experiment we, the humanity, ever undertook.
[9fans] mk and transitive dependencies (was: gcc not an option for Plan9)
On Saturday 23 of March 2013 12:37:17 Rob Pike wrote: > (...) and because go install does > transitive dependencies correctly, which mk does not. anybody care to explain what is the limitation of mk here? can't wrap my head around it... -- dexen deVries [[[↓][→]]]
Re: [9fans] p9p rc flag e +
On Thursday 21 of March 2013 10:22:54 erik quanstrom wrote: > the more idiomatic way to write this is if(~ 0 1); plan 9 has no > /bin/false. plan 9 rc behaves in the same way, and the usual > solution is to use ~ 0 0 to clear the status, or exit ''. > > i have seen scripts reuse the status, especially of a pipe > inside the if. (obviously the status is the same in either > branch.) thanks Erik, it makes sense to me now :-) i'd rather have if's $status visible only to the first statement following it, for example: if (foo | bar | baz) { # sets $status if (! ~ $status ) { # uses $status handle_particular_kind_of_pipeline_failure } do_other_stuff # should not be affected } do_yet_other_stuff # should not be affected either ...but guess rc's semantics are almost set in stone by now :-) cheers, -- dexen deVries [[[↓][→]]]
[9fans] p9p rc flag e +
in p9p rc, an `if (/bin/false)' statement without `if not' statement causes non-empty $status, and thus will terminate mk. for example, the attached mkfile returns error for target `breaks', but works for target `works', with the difference being that of trailing `if not'. from my point of view, the `if (/bin/false)' statement spills the non-empty $status from the conditional expression to its outern scope. perhaps this is to simplify implementation of `if not', but it irks me. is that really the expected behavior, or is it a quirk of p9p rc? is there a point to, or an use case for this behavior? -- dexen deVries [[[↓][→]]] MKSHELL=$PLAN9/bin/rc test:VQ: positive negative echo success. positive:VQ: if (test -e mkfile) echo the file exists negative:VQ: # any file or dir that is sure not to exist # if we have a file `mkfile', then for sure we don't have a dir `mkfile/' if (test -e mkfile/) echo SHOULD NOT BE REACHED
Re: [9fans] Acme hack - a week later
On Thursday 14 of March 2013 15:38:08 yy wrote: > Not that I have any problem with this but, isn't it easier to just Del the > window so that a new one is created when you need it? one week in, i've became much more cavalier about Del-ing an +Errors window, while still using the Edit ,d quite often. turns out, i was affraid of having to re-type the Edit ,d in every new window. all hail Acme, -- dexen deVries [[[↓][→]]]
Re: [9fans] Acme button 1 working like button 3
On Monday 18 of March 2013 16:56:00 Patrick Higgins wrote: > I am trying out Acme after watching rsc's tour at > http://research.swtch.com/acme > > So far I have been liking it, but I just hit an issue: mouse button 1 > now acts the same as button 3. It was working normally just a few > minutes ago. Other X windows including xev still work normally. > > I would appreciate some help in understanding/resolving this. there's been a recent commit in p9p (html) http://code.swtch.com/plan9port/commits/c1bd38a11c42d18b53ee5d6a6084eccb9728f2c2 (raw) http://code.swtch.com/plan9port/commits/c1bd38a11c42d18b53ee5d6a6084eccb9728f2c2/raw/ ...and i've been suffering from randomly stuck Ctrl or Alt in recent X.org or KDE. -- dexen deVries [[[↓][→]]]
Re: [9fans] Acme hack
On Thursday 14 of March 2013 15:38:08 yy wrote: > > Not that I have any problem with this but, isn't it easier to just Del the > window so that a new one is created when you need it? you are right. i use Edit ,d to preserve general window layout. i'm not happy with Acme's placement of +Errors window in my default workflow. in two columns, i keep one directory (project root) window, one +Errors window beneath it (syntax errors, upload progress †, scratchpad) and some 1...6 source code file windows spread 'round. btw., the patch may not apply cleanly since my p9p fork has `Look' disabled via if(0) {...} -- dexen deVries [[[↓][→]]] † i'm a LAMP webdeveloper by day.
[9fans] Acme hack
I like my +Errors window clean once in a while. Attached patch provides Edit ,d by default in +Errors window tagline. -- dexen deVries [[[↓][→]]] >From b4edef7c40de4c4a8678622e11eee8bd9aef8523 Mon Sep 17 00:00:00 2001 From: dexen deVries Date: Thu, 14 Mar 2013 14:41:22 +0100 Subject: [PATCH] acme: provide Edit ,d in +Error windows --- src/cmd/acme/wind.c | 5 + 1 file changed, 5 insertions(+) diff --git a/src/cmd/acme/wind.c b/src/cmd/acme/wind.c index d2bec16..5e952ed 100644 --- a/src/cmd/acme/wind.c +++ b/src/cmd/acme/wind.c @@ -451,6 +451,7 @@ winsettag1(Window *w) static Rune Lget[] = { ' ', 'G', 'e', 't', 0 }; static Rune Lput[] = { ' ', 'P', 'u', 't', 0 }; static Rune Llook[] = { ' ', 'L', 'o', 'o', 'k', ' ', 0 }; + static Rune Leditcomad[] = { ' ', 'E', 'd', 'i', 't', ' ', ',', 'd', 0 }; static Rune Lpipe[] = { ' ', '|', 0 }; /* there are races that get us here with stuff in the tag cache, so we take extra care to sync it */ @@ -509,6 +510,10 @@ winsettag1(Window *w) runemove(new+i, Llook, 6); i += 6; } + else if (!w->filemenu){ +runemove(new+i, Leditcomad, 8); +i += 8; + } else{ static Rune foo[] = { ' ', 0 }; runemove(new+i, foo, 1); -- 1.8.1.4
Re: [9fans] Git (Was: Acme: indicator of running process)
On Tuesday 05 of March 2013 16:49:58 lu...@proxima.alt.za wrote: > > (e.g. `git submodule update') > > You got git running under Plan 9? sorry, no. IMHO it would make more sense to implement git-like toolkit, protocol- and fast-export/fast-import compatible with git, using Venti as storage backend. would heavy use of git-rebase fill up the Venti storage too quickly? * * * is it too much noise to ask about p9p Acme on this mailing list? -- dexen deVries [[[↓][→]]]
[9fans] Acme: indicator of running process
hi list, a long running process (e.g. `git submodule update') does not give any indication as to whether it is running or dead already, save for some progress messages, if any. i would like a clear indicator in Acme's $cwd+Error window the process outputs to. i guess the state of the /dev/stdout of Acme's child process whould be a good indicator for most cases. is there any handy hack to indicate whether the /dev/stdout is open in any particular Acme window? or any other indicator whether a process is still working or dead? yes, i know names of processes are displayed in top Tag line, but in my cases, usually several gits are ran along (git gui, git submodule, etc.etc.) using p9p Acme. cheers, -- dexen deVries [[[↓][→]]]
Re: [9fans] X11
On Thursday 28 of February 2013 14:21:08 Charles Forsyth wrote: > ANSI C has a "_Noreturn" attribute that I started to implement, > but I think I might fall back to a #pragma, which would be quicker to do. another quick hack: #define exit(status) do { exit(status); return 0; } while (0) with do{}while() guarding against treating it as an expression. -- dexen deVries [[[↓][→]]]
Re: [9fans] rc script question
On Wednesday 27 of February 2013 15:41:58 Steve Simon wrote: > This i did not expect > echo a b c | rc -c 'echo @ $(2-) @' > @ @ rc -c 'shift; echo @ $* @' `{echo a b c} surprisingly, * can be assigned to. echo a b c | rc -c '*=`{read}; shift; echo @ $* @' echo a b c | rc -c '*=`{read}; echo @ $*(2-) @' -- dexen deVries [[[↓][→]]]
[9fans] fortune nomination
> Too many renames; must be X source! from output of p9p `acid -q', ran on basically any GNU software. the offending code: $PLAN9/src/cmd/acid/util.c:/must.be.X.source if(renamed > 5 && !quiet) { print("Too many renames; must be X source!\n"); -- dexen deVries [[[↓][→]]]
Re: [9fans] [RQ:] SATA HD 2+ TB native recommendations
On Wednesday 20 of February 2013 12:22:26 David du Colombier wrote: > > Thanks, David! Does it run BellLabs Plan9, or does it require Erik's > > 9atom? > > I run Plan 9 from Bell Labs. Plan 9 from Bell Labs from Bell Labs :^) -- dexen deVries [[[↓][→]]]
[9fans] Acme pathname completion UX
what is the point of the ^F pathname completion appending one space after the pathname is completed? is it only to indicate successful completion? once the space is appended, performing a right-click on the pathname often requires moving the mouse over the pathname. if there was no space appended, the (empty) selection would remain next to the last character of pathname and right-click anywhere would acquire it. -- dexen deVries [[[↓][→]]] ``One disadvantage of the Univac system is that it does not use Unix, a recently developed program which translates from one computer language to another and has a built-in editing system which identifies errors in the original program.'' - student newspaper
Re: [9fans] Why should I invest[tigate] plan9?
On Monday 28 of January 2013 09:24:37 Kurt H Maier wrote: > Let me start out by saying I love this message. I thought fakeposting > had died, but clearly there are still some practitioners out there. > Here are a few hints: > > - Nobody's ISP tells them what OS to run, even back in 1995. This > excessive detail deprives your message of the credibility it deserves. 8<8<8< boring rant 8<8<8< my isp -- a local venture in poland -- did around 2008. they request we use ms windows on the router/gateway machine, instead of `some strange os' -- linux. otherwise they won't take responsibility for the downtime we were having. turned out, they forgot to whitelist our MAC address. but hey -- it worked with their technician's ms windows notebook. 8<8<8< boring rant 8<8<8< -- dexen deVries [[[↓][→]]] ``One disadvantage of the Univac system is that it does not use Unix, a recently developed program which translates from one computer language to another and has a built-in editing system which identifies errors in the original program.'' - student newspaper
Re: [9fans] ctags or sth else with acme?
On Thursday 17 of January 2013 16:50:35 Rudolf Sykora wrote: > Hello, > > I'd like to know what you use for orientation in a code when running acme. > Is the 'g' command sufficient for you, or you use some form of ctags? a g-like script to match symbol names coupled with certain PHP, JS or SQL keywords. also a custom plumber rule & script to display function prototype upon right- click. -- dexen deVries [[[↓][→]]] I have seen the Great Pretender and he is not what he seems.
Re: [9fans] How to do this with [acme | sam | sed ] ?
On Friday 11 of January 2013 13:24:12 Peter A. Cejchan wrote: > I am now on p9p and this does not work - at least with (... )* > > > using the \1 (used to be undocumented on plan9) may be sometimes easier > > Edit s/\+\+([A-Za-z]+[A-Za-z0-9])*/\1++/> oughta be Edit s/\+\+([A-Za-z]+[A-Za-z0-9]*)/\1++/ the * moves to the left. also, probably oughta be Edit ,s/../g to work on all lines, and change multiple matches in one go. -- dexen deVries [[[↓][→]]] Reality is just a convenient measure of complexity. -- Alvy Ray Smith
Re: [9fans] Good sample GUI code (window creation, management,
On Wednesday 19 of December 2012 11:14:30 Luke Evans wrote: > I thought I had bumped into a short example on the web for creating > a window in C, but can't seem to find it again. > > I'm sure I could search all the sources for various examples of such > things, but does anybody know of a good (preferably concise) sample > that demonstrates the correct way to write GUI apps in Plan 9? $PLAN9/src/cmd/draw/*.c in particular, stats.c -- comes with a simple pop-up menu, at under 1kLOC. -- dexen deVries [[[↓][→]]] Reality is just a convenient measure of complexity. -- Alvy Ray Smith