Caerwyn Jones | 20 Mar 04:05

Re: acme-sac: analysis osx :., idiom problem

The behaviour was the same on Nt (and I expect its the same on Linux,
I'll have to confirm.)

The plumber matches a rule when you click before the comma on the
string ':.,' but not  when you click after the comma. Acme sets the
'click=' attribute so a click after the comma means the comma must be
matched by the regular expression.

By putting '^' in the plumber rule means the ':.,' fails to match,
because of the colon.
However, you are also not going to match other possible useful
plumbing, such as path names that are embedded in strings that begin
or end with non file characters, e.g., :::/appl:::.

Thanks for the fixes Axel,

Caerwyn

On Tue, Mar 18, 2008 at 9:26 AM, Axel Belinfante
<Axel.Belinfante@...> wrote:
> (ok, analysis is probably wrong wording. anyway.)
>
>  I looked at the problems I had with :, and :., on acme-sac os-x.
>
>  one of the things that happens with single-click b3 actions is that
>  the selection is expanded, using character classes allowed for
>  file name part, regular expression, or address part.
>
>  to my surprise there is a difference in the list of characters
>  allowed by isaddrc (in regx.b) in inferno acme compared with
>  corresponding isaddrc in plan9/p9p acme (in addr.c).
>
>  p9p and plan9 allow:    0123456789+-/$.#,;
>  inferno/acme-sac allow: 0123456789+-/$.#
>
>  to me this explains why acme-sac refuses to match :,
>  but I don't understand why/how it does/could work on other platforms -
>  but I did not take the time to look at what happens there.
>
>  I added ,; to the list of characters allowed.
>  that makes the :, idiom work.
>
>
>  Furthermore there is some interesting interplay with the plumber that
>  on acme-sac osx  seems to match more than the plan9/p9p plumber do.
>  I saw that since the :, problem was mentioned already some changes
>  have been made to the acme-sac plumbing rules.
>
>  I took the latest acme-sac plumber rule file as base, and on :.,
>  I no longer get acme opening a new window showing non-existent
>  file /usr/axel/whatever/:.,
>  When I click to the right of the whole :., I get the correct behaviour;
>  when I click on :., with single click between : and .
>  then the expression get handed over to the plumber by acme sac,
>  and the plumber matches :., as directory, I guess,
>  so the cursor moves to the already open pane for that directory.
>  (did not try this without pane open for that directory)
>  mac osx weirdness?
>  could : be a separator in mac os x file names?
>
>  It seems the following acme-sac plumber rule matches for :.,  :
>
>  # existing directories go to acme
>  kind is text
>  data matches '[a-zA-Z¡-0-9_./\-]+'
>  data isdir      $0
>  data set        $dir
>  [etc]
>
>  I inserted a ^ in the pattern in the 'data matches', as in
>
>  data matches '^[a-zA-Z¡-0-9_./\-]+'
>
>  and then the :., idiom works as expected.
>  No idea what the insertion of ^ might break.
>
>
>  with these two changes (,; inserted in list of isaddrc chars,
>  and ^ inserted in pattern that match directories) things seem
>  to work for me. (find wood, knock :-)
>
>  Question not studied in detail:
>  why does current code work on the other platforms?
>
>  Axel.
>


Gmane