Subject: bug#11019: closed (Re: bug#11019: 24.0.94; ring-insert+extend does not grow ring properly)

From: [email-masked] (GNU bug Tracking System)
Date: Thu, 15 Mar 2012 08:44:02 +0000

Your bug report

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

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
11019: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11019
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#11019: 24.0.94; ring-insert+extend does not grow ring properly
From: Chong Yidong <[email-masked]>
To: [email-masked]
Date: Thu, 15 Mar 2012 16:13:27 +0800
List-Id: <debbugs-submit.debbugs.gnu.org>

Chong Yidong <[email-masked]> writes:

> I will write up a fix for this soon.

Fixed in revno 107606.

Subject: 24.0.94; ring-insert+extend does not grow ring properly
From: Chong Yidong <[email-masked]>
To: [email-masked]
Date: Thu, 15 Mar 2012 14:31:42 +0800
List-Id: <debbugs-submit.debbugs.gnu.org>

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.