GNU bug report logs - #11019
24.0.94; ring-insert+extend does not grow ring properly

Previous Next

Package: emacs;

Reported by: Chong Yidong <cyd <at> gnu.org>

Date: Thu, 15 Mar 2012 07:03:02 UTC

Severity: normal

Found in version 24.0.94

Done: Chong Yidong <cyd <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Chong Yidong <cyd <at> gnu.org>
To: 11019 <at> debbugs.gnu.org
Subject: bug#11019: 24.0.94; ring-insert+extend does not grow ring properly
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.




This bug report was last modified 13 years and 71 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.