From 6e3af6305a07eda134fde4c61cd59e0b6f41c96d Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Thu, 13 Oct 1994 06:34:09 +0000 Subject: [PATCH] (add-to-list): New function. --- lisp/subr.el | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lisp/subr.el b/lisp/subr.el index 3c4308bf8c2..7c0ae0cb914 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -710,6 +710,11 @@ To make a hook variable buffer-local, always use (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. -- 2.39.5