On 03/02/2016 11:22 AM, Connor Lane Smith wrote:
> On 2 March 2016 at 16:06, Greg Reagle <greg.rea...@umbc.edu> wrote:
>> Well sam has ISRE, but it lacks a nano/vi/emacs-like (full screen 
>> interactive) TUI.
> 
> I think the key to *interactive* structural regular expressions is
> that it must be possible to position oneself 'within' an expression.
> Suppose you write x/re/, then sam will simply print all of the
> matching substrings, just as though you'd written x/re/p. So dot does
> not reflect the fact that if you added further commands then they
> would be performed on each of those matches. In order to be
> interactive, it must be possible to write the command interactively,
> rather than composing the whole expression in one go and sending it to
> the editor to evaluate. That's why multiple cursors are crucial: they
> allow you to collect all the matches, then to decide how to *interact*
> with them. So I don't agree that sam's structural regular expressions
> are interactive in that sense. That's my main complaint.
I see your point.  If you do `, x/echo/` samterm highlights only the last match 
because its paradigm is that there is only one dot/selection.  It would be nice 
if sam had the ability to highlight all matches.

But there are tricks to use it more interactively.  If you already know these, 
please excuse me.

`, x/echo/ =` prints the location, line number(s) and column number(s), of 
every match.  You can double click on these results (albeit one at a time) and 
"send" to highlight each match.

You can undo any change in case it's not what you want.


Reply via email to