texmacs-dev
[Top][All Lists]
Advanced

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

[Texmacs-dev] Logical cursor movement


From: Joris van der Hoeven
Subject: [Texmacs-dev] Logical cursor movement
Date: Thu, 15 Aug 2002 13:18:52 +0200 (MET DST)

I am thinking again about implementing logical cursor movement.
I do not know when I will actually do it, but I would like to
get your opinion (especially Alvaro's opinion) about it.

First of all, I think that there are basically two types of
logical cursor movement. The first one tries to reproduce
the graphical cursor movement "as good as it can" and
is the less interesting one, except for internal purposes
such as search/replace or for putting the cursor at a place
which was graphically hard to obtain.
The second kind of logical cursor movement aims at moving
around "at a given depth", like from one cell to another
in a matrix or from one argument to another in a macro expansion.

The first type of cursor movement basically only implements
'go-right' and 'go-left' in a satisfactory way.
For instance given $a + \frac{b}{c} + d$ and
moving to the right behind 'a', yields the successive positions

  $a +| \frac{b}{c} + d$
  $a + \frac{|b}{c} + d$
  $a + \frac{b|}{c} + d$
  $a + \frac{b}{|c} + d$
  $a + \frac{b}{c|} + d$
  $a + \frac{b}{c}| + d$
  $a + \frac{b}{c} +| d$
  $a + \frac{b}{c} + d|$
  $a + \frac{b}{c} + d$|

Moving up and down strongly depends on the particular kind
of markup one is in. For instance, inside normal text,
'go-down' might go to the beginning of the next paragraph.

As to the second kind of cursor movement, we first have 'go-right',
'go-left' (and 'go-up' and 'go-down' in matrix-like structures) 
which go to the next and previous argument.
However, we have some choice here, since we may move
to the end or the start of the next argument.
When inside a matrix, we have the following options
for moving right resp. left:

1. Always go to the end

   ........  ...|....  ........  ........
   ........  ........  .......|  ........
   ........  ........  ........  .......|

   ........  ...|....  ........  ........
   .......|  ........  ........  ........


2. To the end when moving right and start when moving left

   ........  ...|....  ........  ........
   ........  ........  .......|  ........
   ........  ........  ........  .......|

   ........  ...|....  ........  ........
   |.......  ........  ........  ........


3. Inverted 2

   ........  ...|....  ........  ........
   ........  ........  |.......  ........
   ........  ........  ........  |.......
   ........  ........  ........  .......| [optional]

   ........  ...|....  ........  ........
   .......|  ........  ........  ........
   |.......  ........  ........  ........ [optional]


4. Other variant

   ........  ...|....  ........  ........
   ........  .......|  ........  ........
   ........  ........  .......|  ........
   ........  ........  ........  .......|

   ........  ...|....  ........  ........
   ........  |.......  ........  ........
   |.......  ........  ........  ........


Etc. What would you prefer.

The level-wise cursor movement should also come
with natural actions to go to the last or first argument and
to leave (enter) a given level at the right hand or
left hand side.

Did I forget something? One might also wish to have bindings
to move the previous and next words and potentially mix that
with the structured movements. I am not sure whether this would
be really handy though.





reply via email to

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