texmacs-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Texmacs-dev] Inverse paths


From: Joris van der Hoeven
Subject: [Texmacs-dev] Inverse paths
Date: Wed, 10 Apr 2002 18:03:57 +0200 (MET DST)

A note for David:

I have looked a bit in my code in order to see how the inverse path
system for tagging positions in the source trees worked in relation
with boxes.

If I am write, the DECORATION_LEFT, DECORATION_MIDDLE and
DECORATION_RIGHT are no longer essentially used.
That means that the inverse path is either the inverse of
a usual path, or a precise non-accessible position
(the inverse of a path with a -1 before).
Maybe it might be handy to allow a symbolic NULL or (-1) path too.

In order to find the logical path associated to a graphical position,
one first has to determine whether the cursor is really located
in a subbox or not. This is done using the method box_rep::find_child.
If force==TRUE, then we don't care whether the subbox is
accessible or not. If force==FALSE, then we try to find a subbox which
is accessible, when possible.

For instance, in the case of a concatenation,
it may happen that you have something like

Blah blah blah [function application] blah blah blah.

This will be transformed in something like

(concat-box
  (text-box "Blah")
  (text-box "blah")
  (text-box "blah")
  (marker)
  box1
  ...
  boxn
  (marker)
  (text-box "blah")
  (text-box "blah")
  (text-box "blah."))

where box1 ... boxn correspond to the function application.
Now assume that you point your cursor in the middle of
box1 ... boxn. Then the editor will attempt to find
an accessible cursor position associated to that location.
The concat box will first try to find a non necessarily
accessible box which corresponds to the physical location,
say box3. Next, it attempts to search the closest accessible
box to box3, which is one of the two markers,
depending on which one is closest.

In your rewriting program, in the presence of constructions
which generate non-accessible trees, you must therefore

1. Ensure that the non-accesible trees will be surrounded
   by markers (possibly at a later stage).

2. Specify a non-accessible path, which may be used as
   a "fall back" if no suitable marker could be found.
   This may also be used for accelerating certain searches.

3. Ensure that this information is conserved in
   the appropriate way when composing several rewriting steps.

I hope that this helps a bit, although it won't explain all.

Yours, Joris




reply via email to

[Prev in Thread] Current Thread [Next in Thread]