[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Updating marks in EMACS.
- To: BRADFORD @ SU-SIERRA
- Subject: Updating marks in EMACS.
- From: Earl A. Killian <EAK @ MIT-MC>
- Date: Mon, 12 Mar 1984 19:55:00 -0000
- Date: 12 March 1984 14:55-EST
- Cc: BUG-EMACS @ MIT-MC
- In-reply-to: Msg of Sat 10 Mar 84 04:52:36-PST from Ethan Bradford <BRADFORD at SU-SIERRA.ARPA>
I recomend the following low-level algorithm for updating marks:
The list of marks is kept as a sorted list of real buffer offsets
(i.e. include the size of the gap when they're above it). The
position of gap in the mark list is maintained. The only mark
updating ever required is when the gap is moved, and when the gap
is widened. In both cases the work required is proportional to
the number of marks in the characters moved/deleted.
For an implementation of this algorithm in Lisp, see
MC:EAK;BUFFER >. There is also a Pascal version if you prefer.