# HG changeset patch # User Richard M. Stallman # Date 757801887 0 # Node ID 856ecdc5228a987b581ba6d35bcbdda58360b218 # Parent 77798fccc85c101d24a5943bba67398da4491665 (eval-after-load): Do nothing if FORM is already on the list. diff -r 77798fccc85c -r 856ecdc5228a lisp/subr.el --- a/lisp/subr.el Tue Jan 04 23:30:37 1994 +0000 +++ b/lisp/subr.el Wed Jan 05 20:31:27 1994 +0000 @@ -513,10 +513,13 @@ (defun eval-after-load (file form) "Arrange that, if FILE is ever loaded, FORM will be run at that time. This makes or adds to an entry on `after-load-alist'. +It does nothing if FORM is already on the list for FILE. FILE should be the name of a library, with no directory name." (or (assoc file after-load-alist) (setq after-load-alist (cons (list file) after-load-alist))) - (nconc (assoc file after-load-alist) (list form)) + (let ((elt (assoc file after-load-alist))) + (or (member form (cdr elt)) + (nconc elt (list form)))) form) (defun eval-next-after-load (file)