[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/subr.el
From: |
Kim F . Storm |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/subr.el |
Date: |
Mon, 20 Jun 2005 17:41:34 -0400 |
Index: emacs/lisp/subr.el
diff -c emacs/lisp/subr.el:1.465 emacs/lisp/subr.el:1.466
*** emacs/lisp/subr.el:1.465 Wed Jun 15 20:58:20 2005
--- emacs/lisp/subr.el Mon Jun 20 21:41:34 2005
***************
*** 960,971 ****
(defun add-to-ordered-list (list-var element &optional order)
"Add to the value of LIST-VAR the element ELEMENT if it isn't there yet.
! The test for presence of ELEMENT is done with `equal'.
The resulting list is reordered so that the elements are in the
! order given by each element's numeric list order.
! Elements without a numeric list order are placed at the end of
! the list.
If the third optional argument ORDER is non-nil, set the
element's list order to the given value.
--- 960,970 ----
(defun add-to-ordered-list (list-var element &optional order)
"Add to the value of LIST-VAR the element ELEMENT if it isn't there yet.
! The test for presence of ELEMENT is done with `eq'.
The resulting list is reordered so that the elements are in the
! order given by each element's numeric list order. Elements
! without a numeric list order are placed at the end of the list.
If the third optional argument ORDER is non-nil, set the
element's list order to the given value.
***************
*** 979,994 ****
(put list-var 'list-order
(setq ordering (make-hash-table :weakness 'key :test 'eq))))
(when order
! (puthash element order ordering))
! (add-to-list list-var element)
(set list-var (sort (symbol-value list-var)
(lambda (a b)
(let ((oa (gethash a ordering))
(ob (gethash b ordering)))
! (cond
! ((not oa) nil)
! ((not ob) t)
! (t (< oa ob)))))))))
;;; Load history
--- 978,993 ----
(put list-var 'list-order
(setq ordering (make-hash-table :weakness 'key :test 'eq))))
(when order
! (puthash element (and (numberp order) order) ordering))
! (unless (memq element (symbol-value list-var))
! (set list-var (cons element (symbol-value list-var))))
(set list-var (sort (symbol-value list-var)
(lambda (a b)
(let ((oa (gethash a ordering))
(ob (gethash b ordering)))
! (if (and oa ob)
! (< oa ob)
! oa)))))))
;;; Load history
- [Emacs-diffs] Changes to emacs/lisp/subr.el, Kim F . Storm, 2005/06/08
- [Emacs-diffs] Changes to emacs/lisp/subr.el, Juanma Barranquero, 2005/06/10
- [Emacs-diffs] Changes to emacs/lisp/subr.el, Stefan Monnier, 2005/06/13
- [Emacs-diffs] Changes to emacs/lisp/subr.el, Kim F . Storm, 2005/06/13
- [Emacs-diffs] Changes to emacs/lisp/subr.el, Kim F . Storm, 2005/06/14
- [Emacs-diffs] Changes to emacs/lisp/subr.el, Stefan Monnier, 2005/06/15
- [Emacs-diffs] Changes to emacs/lisp/subr.el,
Kim F . Storm <=
- [Emacs-diffs] Changes to emacs/lisp/subr.el, Juanma Barranquero, 2005/06/21
- [Emacs-diffs] Changes to emacs/lisp/subr.el, Kim F . Storm, 2005/06/22
- [Emacs-diffs] Changes to emacs/lisp/subr.el, Richard M . Stallman, 2005/06/25
- [Emacs-diffs] Changes to emacs/lisp/subr.el, Luc Teirlinck, 2005/06/27