# HG changeset patch # User Dan Nicolaescu # Date 1257920176 0 # Node ID a465c7c7e59e67cbe0b5e6b320120afb111ef14b # Parent 39e6ad203eb0036cfee53fb6843431837e168d5e * subr.el (add-hook): Purecopy strings. (eval-after-load): Purecopy load-history-regexp and the form. diff -r 39e6ad203eb0 -r a465c7c7e59e lisp/ChangeLog --- a/lisp/ChangeLog Wed Nov 11 06:12:21 2009 +0000 +++ b/lisp/ChangeLog Wed Nov 11 06:16:16 2009 +0000 @@ -1,5 +1,8 @@ 2009-11-11 Dan Nicolaescu + * subr.el (add-hook): Purecopy strings. + (eval-after-load): Purecopy load-history-regexp and the form. + * custom.el (custom-declare-group): Purecopy load-file-name. * subr.el (menu-bar-separator): New defconst. diff -r 39e6ad203eb0 -r a465c7c7e59e lisp/subr.el --- a/lisp/subr.el Wed Nov 11 06:12:21 2009 +0000 +++ b/lisp/subr.el Wed Nov 11 06:16:16 2009 +0000 @@ -1218,6 +1218,8 @@ (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 @@ ;; 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?