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

Updating marks in EMACS.

I have made fixes to TECO and EMACS to implement marks which are updated
for changes before them in the buffer.  Here is a copy of my announcement
of the release locally:

    We have put up a new version of EMACS on SIERRA.  This is a test
    release and it is not yet available on the other DEC-20's.

    The new release implements marks which (1) are automatically updated
    for changes in the buffer (standard TECO marks are screwed up if you
    insert or delete characters before them in the buffer) and (2) are
    specific to one buffer (thus setting an updating mark in one buffer
    will not mess up the mark stack in other buffers).  The useful
    functions are in the library MARKER; to get them you must give the
    command M-X Load Library$MARKER .  When you load MARKER you will find
    C-@ set to the function M-X ^R Set/Pop Updating Mark$ and C-X C-X set
    to the function M-X ^R Exchange Point and Updating Mark$.  These will
    work pretty much like the old C-@ and C-X C-X.  If you kill the
    library, the old definitions will be restored.

    You will have to be aware, when you use this package, that currently
    all the other functions in the system use the old, TECO marks.  This
    is fine for functions which just read the mark because ^@ and ^X^X
    will still set the TECO mark; otherwise, use ^U^X^X to make the
    updating mark match the TECO mark.

    Other useful new functions are M-X Make Marker$ and M-X Access
    Marker$, which respectively save and access a marker stored in a
    single letter variable (which you will provide).

    Suggestions and bug reports should be sent to Ethan Bradford

(If you want to look at any of the files, SIERRA keeps its EMACS files in
the directory <EMACS162> (or use EMACS: instead of a directory name) and 
Sierra supports the anonymous FTP login (i.e. login as ANONYMOUS with
password GUEST from FTP).

The main reason I'm sending this message is that I need help in deciding
how thoroughly the changes should be integrated with the rest of EMACS.

In the current implementation, the MIDAS code for TECO just keeps a list
(in a buffer) of the changes made and the TECO code for EMACS uses that
list to update the markers when they are referenced.  I have these EMACS
functions in a seperate library which the user must load to get the
updating marks.  When this library is loaded, I bind C-X C-X and C-@.  This
has the problem that the user must keep track of whether the point he wants
is marked with a TECO mark or an updating mark and he must know which kind
of mark he needs for his next operation.

A second solution would be to integrate the changes with all the most common
functions in EMACS and leave the more obscure functions alone -- this would
cause occasional glitches for the user, so I don't recommend it.

A third solution would be to replace all calls to ^V (or to redefine ^V).
This would would be needlessly inefficient and it could lead to errors if a
function relies on the mark not being updated (for instance, it might
adjust for the changes itself).

Perhaps the best solution, and the one requiring the most work, would be to
search all EMACS libraries and replace those calls to ^V which have
external effects.  If we did this massive integration of the updating
marks, we would probably want to rewrite some of the TECO algorithms into
MIDAS for efficiency -- perhaps we could allow ^V to keep its definition
and add @^V to mean "^V on the updating mark stack."

Does anybody have any suggestions?  Should we just implement the first
option for a while and see what seems best over the long run?  Comments to

-- Ethan