Mercurial > emacs
changeset 9510:f03544494d1c
(add-to-list): New function.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Thu, 13 Oct 1994 06:34:09 +0000 |
parents | d4e74a66a357 |
children | 3b5dbd9c44f5 |
files | lisp/subr.el |
diffstat | 1 files changed, 5 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- 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.