Re: [dev] another text user interface for sam

2016-03-01 Thread Connor Lane Smith
On 1 March 2016 at 20:35, Marc André Tanner wrote: > As an example, swapping two words with > > ,x[a-zA-Z]+/{ > g/fred/ v/./ c/jim/ > g/jim/ v// c/fred/ > } > > which is mentioned in both the sam tutorial and the cheatsheet would > no longer work. That's true; I suppose it depends h

Re: [dev] another text user interface for sam

2016-03-01 Thread Marc André Tanner
On Tue, Mar 01, 2016 at 06:12:32PM +, Connor Lane Smith wrote: > We agree for pretty much the same reasoning. (I'm not sure > why you assumed otherwise.) Misunderstanding on my part I guess. These are just limitations of the regex(3) API but have no particular relevance for *structural* regula

Re: [dev] another text user interface for sam

2016-03-01 Thread Marc André Tanner
On Tue, Mar 01, 2016 at 05:41:00PM +, Connor Lane Smith wrote: > On 1 March 2016 at 17:12, Marc André Tanner wrote: > > All commands of a group should operate on the original state of the text. > > Is that strictly necessary? I know that's how sam and acme behave, but I haven't yet made my m

Re: [dev] another text user interface for sam

2016-03-01 Thread Connor Lane Smith
On 1 March 2016 at 17:44, Marc André Tanner wrote: > Why do you think that? For pretty much the reasons you list. Only support for NUL-terminated strings, no support for passing successive blocks, poor performance for repeated searches of particularly nondeterministic expressions, and so on. We a

Re: [dev] another text user interface for sam

2016-03-01 Thread Marc André Tanner
On Tue, Mar 01, 2016 at 04:46:19PM +, Connor Lane Smith wrote: > On 29 February 2016 at 18:51, Greg Reagle wrote: > > Another approach would be to write a structural regexp library. Then > > structural regexp's could be available to other programs. > > I've been thinking about this, actually

Re: [dev] another text user interface for sam

2016-03-01 Thread Connor Lane Smith
On 1 March 2016 at 17:12, Marc André Tanner wrote: > All commands of a group should operate on the original state of the text. Is that strictly necessary? I know that's how sam and acme behave, but series of commands outside those {} blocks occur in sequence (not all performing on the original te

Re: [dev] quirks with sam's structured regexps

2016-03-01 Thread Connor Lane Smith
On 1 March 2016 at 17:00, Connor Lane Smith wrote: > acme/regx.c certainly was derived from sam/regexp.c. See attached diff. I forgot to also check the other files necessary for sam's command language, but they too seem similarly derived: * sam/cmd.c -> acme/edit.c * sam/parse.h -> acme/edit.h *

Re: [dev] another text user interface for sam

2016-03-01 Thread Connor Lane Smith
On 1 March 2016 at 17:12, Marc André Tanner wrote: > I think structural regexp will integrate nicely with multiple selections. > > Basically if you omit the command of a structural regexp the editor > would switch to visual mode and add a selection for every match. If you > are already in visual m

Re: [dev] quirks with sam's structured regexps

2016-03-01 Thread Marc André Tanner
On Tue, Mar 01, 2016 at 07:59:41AM +, Raphaël Proust wrote: > On 28 February 2016 at 17:20, Greg Reagle wrote: > > But I don't see a big problem here, only a minor inconvenience. Do your > > insert before your append when using a braced compound command, and it > > works fine. > > Yes, it's

Re: [dev] another text user interface for sam

2016-03-01 Thread Marc André Tanner
Hi, I too like the concept of structural regular expressions and would like to experiment with ways to integrate them into vis. That is the reason why I didn't bother implementing an ex mode and instead referred to ssam(1) in the README. I think structural regexp will integrate nicely with multip

Re: [dev] quirks with sam's structured regexps

2016-03-01 Thread Greg Reagle
On 03/01/2016 11:39 AM, Raphaël Proust wrote: On 1 March 2016 at 12:43, Greg Reagle wrote: That's interesting. It's funny that sam does a better job since acme is a successor to sam. I wonder if/how they share code. I don't know if they do. The man page for acme references sam directly (and

Re: [dev] quirks with sam's structured regexps

2016-03-01 Thread Connor Lane Smith
On 1 March 2016 at 12:43, Greg Reagle wrote: > That's interesting. It's funny that sam does a better job since acme is a > successor to sam. I wonder if/how they share code. acme/regx.c certainly was derived from sam/regexp.c. See attached diff. cls --- sam/regexp.c2016-03-01 16:52:35.

Re: [dev] another text user interface for sam

2016-03-01 Thread Connor Lane Smith
On 29 February 2016 at 18:51, Greg Reagle wrote: > Another approach would be to write a structural regexp library. Then > structural regexp's could be available to other programs. I've been thinking about this, actually. What might be even better is a regular expression library which just makes

Re: [dev] quirks with sam's structured regexps

2016-03-01 Thread Raphaël Proust
On 1 March 2016 at 12:43, Greg Reagle wrote: > On Tue, Mar 01, 2016 at 07:59:41AM +, Raphaël Proust wrote: >> On 28 February 2016 at 17:20, Greg Reagle wrote: > That's interesting. It's funny that sam does a better job since acme is a > successor to sam. I wonder if/how they share code. I

Re: [dev] quirks with sam's structured regexps

2016-03-01 Thread Greg Reagle
On Tue, Mar 01, 2016 at 07:59:41AM +, Raphaël Proust wrote: > On 28 February 2016 at 17:20, Greg Reagle wrote: > > I get these results: The first version works fine. The second version > > shows error "?changes not in sequence" and does nothing. > > There is a difference between acme's handl

Re: [dev] [sbase][bug] cat -u is not unbuffered

2016-03-01 Thread quinq
> > So I was studying sbase and found a bug in cat > Thanks for the report, this has been fixed on HEAD. Thanks Ryan!

Re: [dev] [sbase][bug] cat -u is not unbuffered

2016-03-01 Thread Dimitris Papastamos
On Tue, Mar 01, 2016 at 12:23:52AM -0600, Ryan Wilson wrote: > So I was studying sbase and found a bug in cat. POSIX says that cat -u should > "Write bytes from the input file to the standard output without delay as each > is read." But if you try feeding cat input slowly you can see this is not

Re: [dev] quirks with sam's structured regexps

2016-03-01 Thread Raphaël Proust
On 28 February 2016 at 17:20, Greg Reagle wrote: > On Sun, Feb 28, 2016 at 11:34:37AM +, Raphaël Proust wrote: >> I managed to reconstruct an example that I am dissatisfied about. >> The following works: >> Edit ,x/test/{ >> i/< >> a/> >> } >> But not the following: >> Edit ,x/test/{ >> a/> >>