Next: Undoing commands, Previous: String-table Functions, Up: Utilities [Contents][Index]
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 kill-ring), a ring of marks (see section mark-stack), or a ring of command strings which various modes and commands maintain as a history mechanism.
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.
Returns t if ring is a ring object, otherwise nil.
Returns as multiple-values the number of elements which ring currently holds and the maximum number of elements which it may hold.
Returns the index’th item in the ring, where zero is the index of the most recently pushed. This may be set with setf.
Pushes object into ring, possibly causing the oldest item to go away.
Removes the most recently pushed object from ring and returns it. If the ring contains no elements then an error is signalled.
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.
Next: Undoing commands, Previous: String-table Functions, Up: Utilities [Contents][Index]