diff options
author | Dan Nicolaescu <dann@ics.uci.edu> | 2009-11-11 06:16:16 +0000 |
---|---|---|
committer | Dan Nicolaescu <dann@ics.uci.edu> | 2009-11-11 06:16:16 +0000 |
commit | ff917d632134b76be4c764dd6cf3ac1984b371a4 (patch) | |
tree | 85777539d47bd79a282aa4974342de43426fa9ce /lisp/subr.el | |
parent | af89cf775938a950664dcfba4241f497014edf7e (diff) | |
download | emacs-ff917d632134b76be4c764dd6cf3ac1984b371a4.tar.gz |
* subr.el (add-hook): Purecopy strings.
(eval-after-load): Purecopy load-history-regexp and the form.
Diffstat (limited to 'lisp/subr.el')
-rw-r--r-- | lisp/subr.el | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lisp/subr.el b/lisp/subr.el index bb3b37ebbf0..fb832608cd4 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -1218,6 +1218,8 @@ function, it is changed to a list of functions." (setq hook-value (list hook-value))) ;; Do the actual addition if necessary (unless (member function hook-value) + (when (stringp function) + (setq function (purecopy function))) (setq hook-value (if append (append hook-value (list function)) @@ -1660,14 +1662,14 @@ This function makes or adds to an entry on `after-load-alist'." ;; Add this FORM into after-load-alist (regardless of whether we'll be ;; evaluating it now). (let* ((regexp-or-feature - (if (stringp file) (load-history-regexp file) file)) + (if (stringp file) (setq file (purecopy (load-history-regexp file))) file)) (elt (assoc regexp-or-feature after-load-alist))) (unless elt (setq elt (list regexp-or-feature)) (push elt after-load-alist)) ;; Add FORM to the element unless it's already there. (unless (member form (cdr elt)) - (nconc elt (list form))) + (nconc elt (purecopy (list form)))) ;; Is there an already loaded file whose name (or `provide' name) ;; matches FILE? |