>From my previous message: @defun ring-elements ring This returns a list of the objects in @var{ring}, in no particular ! order. The length of that list is always the ring size. If the ring ! length is less than the ring size, the entries of the list that do not ! correspond to ring elements are @code{nil}. @end defun
Maybe I am trying to document a bug here. Maybe it is better not to add these two sentences and instead make `ring-elements' do what the first sentence above, and its docstring, say it does. `ring-elements' is not used in the Emacs sources, so the change is not going to break anything and all it does is make the function work as documented. I can install if desired. ===File ~/ring.el-diff====================================== *** ring.el 02 Sep 2003 07:41:57 -0500 1.18 --- ring.el 18 Jun 2005 18:45:44 -0500 *************** *** 155,162 **** (aref vec (ring-index index hd ln (length vec)))))) (defun ring-elements (ring) ! "Return a list of the elements of RING." ! (mapcar #'identity (cddr ring))) ;;; provide ourself: --- 155,164 ---- (aref vec (ring-index index hd ln (length vec)))))) (defun ring-elements (ring) ! "Return a list of the elements of RING, in no particular order." ! (let (lst) ! (setq lst (delq nil (mapcar #'identity (cddr ring)))) ! (nconc lst (make-list (- (ring-length ring) (length lst)) nil)))) ;;; provide ourself: ============================================================ _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel