aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1999-08-30 23:58:18 +0000
committerRichard M. Stallman1999-08-30 23:58:18 +0000
commitb27c699564ae0510a626b742dc33181c8b8430ff (patch)
tree18716e00803484944ff91cf770269af9220b121b
parent7263dc568d8ff89d638d40c1d69158ba2a247c2a (diff)
downloademacs-b27c699564ae0510a626b742dc33181c8b8430ff.tar.gz
emacs-b27c699564ae0510a626b742dc33181c8b8430ff.zip
Fix previous change.
-rw-r--r--lisp/emacs-lisp/ring.el19
1 files changed, 4 insertions, 15 deletions
diff --git a/lisp/emacs-lisp/ring.el b/lisp/emacs-lisp/ring.el
index f871526a296..27100d84c77 100644
--- a/lisp/emacs-lisp/ring.el
+++ b/lisp/emacs-lisp/ring.el
@@ -42,16 +42,6 @@
42;; These functions are used by the input history mechanism, but they can 42;; These functions are used by the input history mechanism, but they can
43;; be used for other purposes as well. 43;; be used for other purposes as well.
44 44
45;;; Change Log:
46
47;; Sun Aug 22 12:58:54 1999 Kevin Blake <kblake@ticnet.com>
48;; * Added the `ring-size' and `ring-copy' functions. Added documentation
49to
50;; the `ring-empty-p' and `ring-index' functions. Enhanced the
51documentation
52;; of several functions. Added comments to the layout of this module to
53;; make things more obvious.
54
55;;; Code: 45;;; Code:
56 46
57;;; User Functions: 47;;; User Functions:
@@ -112,10 +102,9 @@ VECLEN is the size of the vector in the ring."
112 102
113(defun ring-copy (ring) 103(defun ring-copy (ring)
114 "Returns a copy of RING." 104 "Returns a copy of RING."
115 (let* 105 (let* ((vec (cdr (cdr ring)))
116 ((vec (cdr (cdr ring))) 106 (hd (car ring))
117 (hd (car ring)) 107 (ln (car (cdr ring))))
118 (ln (car (cdr ring))))
119 (cons hd (cons ln (copy-sequence vec))))) 108 (cons hd (cons ln (copy-sequence vec)))))
120 109
121(defun ring-insert (ring item) 110(defun ring-insert (ring item)
@@ -158,7 +147,7 @@ numeric, remove the element indexed."
158 "Returns RING's INDEX element. 147 "Returns RING's INDEX element.
159INDEX = 0 is the most recently inserted; higher indices 148INDEX = 0 is the most recently inserted; higher indices
160correspond to older elements. 149correspond to older elements.
161INDEX need not be <= the ring length, the appropriate modulo operation 150INDEX need not be <= the ring length; the appropriate modulo operation
162will be performed." 151will be performed."
163 (if (ring-empty-p ring) 152 (if (ring-empty-p ring)
164 (error "Accessing an empty ring") 153 (error "Accessing an empty ring")