comparison lisp/subr.el @ 83331:efa9e4606e7e

Merged from miles@gnu.org--gnu-2005 (patch 83-87, 449-468) Patches applied: * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-449 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-450 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-451 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-452 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-453 Update from CVS: lisp/subr.el (add-to-ordered-list): Doc fix. * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-454 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-455 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-456 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-457 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-458 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-459 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-460 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-461 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-462 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-463 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-464 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-465 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-466 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-467 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-468 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-83 Merge from emacs--cvs-trunk--0 * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-84 Merge from emacs--cvs-trunk--0 * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-85 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-86 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-87 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-371
author Karoly Lorentey <lorentey@elte.hu>
date Tue, 05 Jul 2005 22:12:55 +0000
parents ebfb2856c8e6 7f964f8f5c85
children 6c13700d1c13
comparison
equal deleted inserted replaced
83330:233c9974025b 83331:efa9e4606e7e
935 (if (equal hook-value '(t)) 935 (if (equal hook-value '(t))
936 (kill-local-variable hook) 936 (kill-local-variable hook)
937 (set hook hook-value)))))) 937 (set hook hook-value))))))
938 938
939 (defun add-to-list (list-var element &optional append) 939 (defun add-to-list (list-var element &optional append)
940 "Add to the value of LIST-VAR the element ELEMENT if it isn't there yet. 940 "Add ELEMENT to the value of LIST-VAR if it isn't there yet.
941 The test for presence of ELEMENT is done with `equal'. 941 The test for presence of ELEMENT is done with `equal'.
942 If ELEMENT is added, it is added at the beginning of the list, 942 If ELEMENT is added, it is added at the beginning of the list,
943 unless the optional argument APPEND is non-nil, in which case 943 unless the optional argument APPEND is non-nil, in which case
944 ELEMENT is added at the end. 944 ELEMENT is added at the end.
945 945
957 (append (symbol-value list-var) (list element)) 957 (append (symbol-value list-var) (list element))
958 (cons element (symbol-value list-var)))))) 958 (cons element (symbol-value list-var))))))
959 959
960 960
961 (defun add-to-ordered-list (list-var element &optional order) 961 (defun add-to-ordered-list (list-var element &optional order)
962 "Add to the value of LIST-VAR the element ELEMENT if it isn't there yet. 962 "Add ELEMENT to the value of LIST-VAR if it isn't there yet.
963 The test for presence of ELEMENT is done with `eq'. 963 The test for presence of ELEMENT is done with `eq'.
964 964
965 The resulting list is reordered so that the elements are in the 965 The resulting list is reordered so that the elements are in the
966 order given by each element's numeric list order. Elements 966 order given by each element's numeric list order. Elements
967 without a numeric list order are placed at the end of the list. 967 without a numeric list order are placed at the end of the list.
968 968
969 If the third optional argument ORDER is non-nil, set the 969 If the third optional argument ORDER is a number (integer or
970 element's list order to the given value. 970 float), set the element's list order to the given value. If
971 ORDER is nil or omitted, do not change the numeric order of
972 ELEMENT. If ORDER has any other value, remove the numeric order
973 of ELEMENT if it has one.
971 974
972 The list order for each element is stored in LIST-VAR's 975 The list order for each element is stored in LIST-VAR's
973 `list-order' property. 976 `list-order' property.
974 977
975 The return value is the new value of LIST-VAR." 978 The return value is the new value of LIST-VAR."