Re: [9fans] ed regular expressions in sam

2021-07-20 Thread Silas
In sam, g has two uses - either as a guard or after an s command where all substitutions are made Quoting sam(1) (available at ) after an s command: > If the command is followed by a g, as in >    s/x/y/g, all matches in the range are substituted. as

Re: [9fans] Autoexpand in sam

2021-09-25 Thread Silas
Your error mean spell's  output is too large to fit within sam's command window. I don't have much experience with spell but I'd suggest correcting some of the typos found and running again or opening via B /tmp/sam.err and examining the

[9fans] Re: Making multiple changes to dot using sam -d

2022-05-11 Thread Silas
Hi, Yep, seems you can combine changes with ,x { x/sam/c/sam -d/ x/teh/c/the/ } Adding an optional guard before the opening brace. Note the changes must be correct way round otherwise you get the error "?changes not in sequence" Silas -- 9f

Re: [9fans] p9f mention of 9front

2021-06-24 Thread silas poulson
What’s Dorren continent referencing? Silas On 24 Jun 2021, at 22:25, Wes Kussmaul mailto:w...@reliableid.com>> wrote: All versions of Plan9, Inferno, derivatives, forks, et al are welcome on the Glenda continent. 9fans<https://9fans.topicbox.com/latest> / 9fans / see

[9fans] Sam arena allocators

2021-06-28 Thread silas poulson
Hi, Recently discovered a blog post[1] stating Sam used to have arena based allocators. Having difficulty finding more about this - does anyone know what the allocator looked like and why the source returned to using the standard allocators. Silas [1]https://jeremywsherman.com/2012/02/28

Re: [9fans] Sam arena allocators

2021-06-28 Thread silas poulson
n seems to imply custom allocator, ran on both terminal and host to efficiently hold strings in memory via variable length arrays. > As always, though, my memory may be faulty; it compacts too often. Ha Silas -- 9fans: 9fans Permalink: https://9fans

Re: [9fans] Sam arena allocators

2021-06-29 Thread silas poulson
s. Right, thank you for that - forgot sources were available via list. Will examine closely Silas -- 9fans: 9fans Permalink: https://9fans.topicbox.com/groups/9fans/Tf83e4250af593565-M282bbf82ea9329be71eff119 Delivery options: https://9fans.topicbox.

Re: [9fans] Sam tricks (was: Alternative to fine-grained mouse usage?)

2021-07-01 Thread Silas McCroskey
> often switching files, Sam's menus are practically worse than Acme > The weakest point in sam -d is still switching files, you have to type > whole filenames X/pathregex/b sam will dump a warning about an expected blank, but it'll otherwise do what you hope for (switch to the open file matching

Re: [9fans] Alternative to fine-grained mouse usage?

2021-07-02 Thread silas poulson
On 1 Jul 2021, at 18:48, Ethan Gardener mailto:eeke...@fastmail.fm>> wrote: sam -d can't display line numbers You can sort of display them via ,x { p } Though it’s ugly and annoyingly can’t apply sam’s regex to remove the character locati

Re: [9fans] Alternative to fine-grained mouse usage?

2021-07-02 Thread Silas McCroskey
> In any case, Plan 9's ed has a nice "browse" command which sam can't match. I > used to issue "0bn", then just "b" once per page. Or, if you don't want line > numbers, leave out the "n". "+,+20p" does it. Doesn't work near the end of the file, though; not sure if that can be improved within th

Re: [9fans] Alternative to fine-grained mouse usage?

2021-07-03 Thread silas poulson
On 2 Jul 2021, at 19:06, Ethan Gardener mailto:eeke...@fastmail.fm>> wrote: This reminds me why I switched to Forth: I can program my editor properly Could you expand on this point? Vaguely aware of Forth, but no experience with forth editors

Re: [9fans] ed regular expressions in sam

2021-07-20 Thread Silas McCroskey
> I have yet gotten to this usage of "g" after "s". The key difference here is not in the behavior of suffixed 'g', but in how selections are made and operated on in the first place. Ed's "selection" (aka dot, as you can reference it with '.') is always a full, single line. It can *iterate* over

Re: [9fans] Help with a sam cleanup script

2021-07-21 Thread Silas McCroskey
llowing as another sam command (even if it's one that would never be run). - Silas -- 9fans: 9fans Permalink: https://9fans.topicbox.com/groups/9fans/T10b1d559ae7d981e-Mafc9e9d330eaec6c6ad1fe81 Delivery options: https://9fans.topicbox.com/groups/9fans/subscription

Re: [9fans] Help with a sam cleanup script

2021-07-21 Thread Silas McCroskey
> #!/bin/sed '/^#/d' apologies. quotes do not belong there. #!/bin/sed /^#/d -- 9fans: 9fans Permalink: https://9fans.topicbox.com/groups/9fans/T10b1d559ae7d981e-Mfff65af821d77519fd6c8034 Delivery options: https://9fans.topicbox.com/groups/9fans/subscript

Re: [9fans] A few questions about sam

2021-07-22 Thread Silas McCroskey
. 'b' can be combined with X to good effect, in spite of that clearly not being an anticipated case: X/pathregex/b will print "?blank expected" but still switch to the file matching pathregex, so you don't need to type (or copy+paste) the full path. - Silas --

Re: [9fans] A few questions about sam

2021-07-22 Thread Silas McCroskey
> * I did try using 'send' but it gives me a ?bad delimiter `e' error. send is a command on the middle-click menu in samterm, not part of the sam language. -- 9fans: 9fans Permalink: https://9fans.topicbox.com/groups/9fans/T60b5c1929a63b077-Ma800732a0dcfc14

Re: [9fans] Searching sam for text

2021-08-02 Thread silas poulson
ending document to grep with ,> grep -n slightly neater though does mean leaving sam’s command set. Silas -- 9fans: 9fans Permalink: https://9fans.topicbox.com/groups/9fans/T6d4564e82d943342-M74570921159ae06ff4e5c6be Delivery options: https://9fans.top