# HG changeset patch # User Richard M. Stallman # Date 782030049 0 # Node ID f03544494d1c919b972719b2e8c38f5c9f9bfb3e # Parent d4e74a66a35770a6557afe7c954faacdacdb43b4 (add-to-list): New function. diff -r d4e74a66a357 -r f03544494d1c lisp/subr.el --- a/lisp/subr.el Thu Oct 13 06:30:49 1994 +0000 +++ b/lisp/subr.el Thu Oct 13 06:34:09 1994 +0000 @@ -710,6 +710,11 @@ (if (equal hook-value function) (setq hook-value nil))) (set-default hook hook-value))))) + +(defun add-to-list (list-var element) + "Add to the value of LIST-VAR the element ELEMENT if it isn't there yet." + (or (member element (symbol-value list-var)) + (set list-var (cons element (symbol-value list-var))))) ;;;; Specifying things to do after certain files are loaded.