]> git.eshelyaron.com Git - emacs.git/commitdiff
* subr.el (add-hook): Purecopy strings.
authorDan Nicolaescu <dann@ics.uci.edu>
Wed, 11 Nov 2009 06:16:16 +0000 (06:16 +0000)
committerDan Nicolaescu <dann@ics.uci.edu>
Wed, 11 Nov 2009 06:16:16 +0000 (06:16 +0000)
(eval-after-load): Purecopy load-history-regexp and the form.

lisp/ChangeLog
lisp/subr.el

index 1f0ddc1217a35941891b04b07a9095b393611cba..3b58fe1125f71b07bf5361f9ab14e766bb4a183a 100644 (file)
@@ -1,5 +1,8 @@
 2009-11-11  Dan Nicolaescu  <dann@ics.uci.edu>
 
+       * 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.
index bb3b37ebbf0e37df34ec8f24931260bf6b94d6e7..fb832608cd47cb2699f3b099700f85151867aede 100644 (file)
@@ -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?