There are various purposes in an editor for which a ring of values can be used, so Hemlock provides a general ring buffer type. It is used for maintaining a ring of killed regions (see section 4.3), a ring of marks (see section 3.1), or a ring of command strings which various modes and commands maintain as a history mechanism. [annotate]
Makes an empty ring object capable of holding up to length Lisp objects. Delete-function is a function that each object is passed to before it falls off the end. Length must be greater than zero. [annotate] |
Returns t if ring is a ring object, otherwise nil. [annotate] |
Returns as multiple-values the number of elements which ring currently holds and the maximum number of elements which it may hold. [annotate] |
Returns the index'th item in the ring, where zero is the index of the most recently pushed. This may be set with setf. [annotate] |
Pushes object into ring, possibly causing the oldest item to go away. [annotate] |
Removes the most recently pushed object from ring and returns it. If the ring contains no elements then an error is signalled. [annotate] |
With a positive offset, rotates ring forward that many times. In a forward rotation the index of each element is reduced by one, except the one which initially had a zero index, which is made the last element. A negative offset rotates the ring the other way. [annotate] |