Subject: 24.0.94; ring-insert+extend does not grow ring properly

From: Chong Yidong <[email-masked]>
Date: Thu, 15 Mar 2012 14:31:42 +0800

Looks like ring-insert+extend with a non-nil GROW-P argument does not
grow the ring properly if the ring is already "wrapped around":

(require 'ring)

(setq ring (make-ring 4))
(ring-insert ring 0)
(ring-insert ring 1)
(ring-insert ring 2)
(ring-insert ring 3)
(ring-insert ring 4)

(setq foo (ring-elements ring))
;; ==> (4 3 2 1)

(ring-insert+extend ring 5 t)

(setq bar (ring-elements ring))
;; ==> (1 4 5 3 2)
;; expected: (5 4 3 2 1)

I will write up a fix for this soon.