aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1994-01-05 20:31:27 +0000
committerRichard M. Stallman1994-01-05 20:31:27 +0000
commit12c7071c31ee37d908f4e3f2b104332e3b543784 (patch)
tree997937e204699a047581bf41ceeab4df70283e81
parentd06752db2d8f4f15250624031574f7719a0b3df8 (diff)
downloademacs-12c7071c31ee37d908f4e3f2b104332e3b543784.tar.gz
emacs-12c7071c31ee37d908f4e3f2b104332e3b543784.zip
(eval-after-load): Do nothing if FORM is already on the list.
-rw-r--r--lisp/subr.el5
1 files changed, 4 insertions, 1 deletions
diff --git a/lisp/subr.el b/lisp/subr.el
index 943c82f4941..b4f43ff9867 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -513,10 +513,13 @@ list of hooks to run in HOOK, then nothing is done. See `add-hook'."
513(defun eval-after-load (file form) 513(defun eval-after-load (file form)
514 "Arrange that, if FILE is ever loaded, FORM will be run at that time. 514 "Arrange that, if FILE is ever loaded, FORM will be run at that time.
515This makes or adds to an entry on `after-load-alist'. 515This makes or adds to an entry on `after-load-alist'.
516It does nothing if FORM is already on the list for FILE.
516FILE should be the name of a library, with no directory name." 517FILE should be the name of a library, with no directory name."
517 (or (assoc file after-load-alist) 518 (or (assoc file after-load-alist)
518 (setq after-load-alist (cons (list file) after-load-alist))) 519 (setq after-load-alist (cons (list file) after-load-alist)))
519 (nconc (assoc file after-load-alist) (list form)) 520 (let ((elt (assoc file after-load-alist)))
521 (or (member form (cdr elt))
522 (nconc elt (list form))))
520 form) 523 form)
521 524
522(defun eval-next-after-load (file) 525(defun eval-next-after-load (file)