Re: [dev] structural regular expression support for vis

From: Marc André Tanner <>
Date: Sun, 13 Mar 2016 13:55:06 +0100

First of all, thanks for giving it a try!

On Sun, Mar 13, 2016 at 11:07:49AM +0000, Raphaël Proust wrote:
> On 12 March 2016 at 17:44, Marc André Tanner <> wrote:
> > On Fri, Mar 11, 2016 at 08:08:38PM +0100, Marc André Tanner wrote:
> >> - There will likely be bugs, memory leaks, crashes, infinite loops etc.
> >> YOU are supposed to fix them and submit patches ;)
> When typing `:sam<enter>` the editor segfaults.

Should be fixed.

> > Hence the sam command ,x/pattern/ can be abbreviated to x/pattern
> Because of habit with sam, I started testing with `,x/pattern/` and
> got an "Unknown command" message from vis. Without the comma, it
> “worked” (i.e., did not print a message). Two things:
> - Are you trying for very high compatibility with vanilla sam?

In principle yes, unless there is a good reason to deviate. I tried
basing the implementation on the manual page and occasionally on the
source if something wasn't clear.

Does there exist a more formal standard/description of the command language?

> - The message is very confusing. (I first thought the `sam` command
> was not recognised by `vis` which lead me to triple chek I had the
> correct branch and all. I think the message means that the sam
> component of vis thinks I am using `,` as a command and that is
> wrong.)

Yes this was the case, it should be fixed now.

> > - In text entry \t inserts a literal tab character (sam only recognizes \n).
> Is it because you plan on having <tab> be bound to something like
> autocomplete on the command line?

It is mainly for convenience. In the past (before the command line was
implemented as a regular file) <Tab> was ignored because lots of vim
users would try to auto complete stuff. Also tab expansion also applies
to the command line, hence depending on your setting you might not get a
literal tab character. This can be worked around with <Ctrl-v><Tab>. The
same can also be used to enter multi line commands. But to actually
execute them one has to mark the selection to execute in visual mode and
then press <Enter>.

> There are many bugs related to addressing and such.

Please report more examples of the bugs you encountered.

> basic examples:
> `ggvG:sam y/\n/i/FOO` only inserts "FOO" at the start of the first
> line. It should do it on every line.
> Same when using `x/^.*$/` instead of `y/\n/`

Haven't really looked into it yet. The problem might be that . also
matches new lines.

However the "idomatic" way to do this seems to be `x i/FOO` which

> Something related to vis (but not to the sam component): when typing
> `:<up>` the command edition buffer opens. It might be because I'm used
> to vim, but I'd rather have that buffer start in normal mode. (Normal
> mode is what I expect new buffers to start at.)

This might be better indeed. I will see what I like more ...

 Marc André Tanner >< >< GPG key: 10C93617
Received on Sun Mar 13 2016 - 13:55:06 CET

This archive was generated by hypermail 2.3.0 : Sun Mar 13 2016 - 14:00:13 CET