[Top][All Lists]

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

Re: table.el

From: Robert J. Chassell
Subject: Re: table.el
Date: Sun, 2 Dec 2001 14:23:35 +0000 (UTC)

   The reason why I needed wrapper mechanism ....

   When `kill-region' is executed, if beg and end are in a same table
   cell it is natural to treat that region as a cell local region instead
   of a buffer wide region.  

This is a good explanation of why you need the feature.  

However, it is misleading to call it a `wrapper mechanism'.  A
`wrapper' is something added *after* you have created what is wrapped.

Yes, this is what you are doing _as_a_developer_; you are adding a new
feature to `kill-region', but this is not what a newbie code reader
should see when reading the source.  The newbie should see how the
various parts fit together, without being misled into thinking that
parts are *fundamentally* an `add-on', rather than being added-on,
coherently, later.

Incidentally, this is why `hooks' are a nice feature (but not for this
problem):  you as a programmer can add a new feature by using a hook,
but the person reading the code is not confused into thinking that
this new feature is a fundamental change; the writing and use of a
hook is perceived as an incremental addition.

In this case, you are defining a way to determine what is the
appropriate boundary of the region when the region is not the whole
buffer.  Many functions already do this:  for example, `kill-word' and

But you are planning to do this in a somewhat different manner:
developing code to handle a region of the buffer, a cell of a table,
whose display may be contiguous
as it is perceived by humans, but whose Emacs representation is
*not* necessarily contiguous.  So the change is fairly big.

Thus, in this four column table:

    foo            bar            baz            bish

    It is at the   It is the      It is the      It is
    far left of a  second of a    third of a     the fourth of
    four column    four column    four column    a four column
    table.         table.         table.         table.

The text that a human reads as;

    It is at the far left of a four column table.

is not contiguous from the point of view of Emacs; it starts out in
the display as:

    It is at the   It is the      It is the      It is

You have good ideas on what to do.  I am looking forward to the result.

Thank you.
    Robert J. Chassell                  address@hidden
    Rattlesnake Enterprises             http://www.rattlesnake.com

reply via email to

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