diff lisp/bytecomp.el @ 245:51092a27c943 r20-5b21

Import from CVS: tag r20-5b21
author cvs
date Mon, 13 Aug 2007 10:17:54 +0200
parents 41ff10fd062f
children 11cf20601dec
line wrap: on
line diff
--- a/lisp/bytecomp.el	Mon Aug 13 10:17:09 2007 +0200
+++ b/lisp/bytecomp.el	Mon Aug 13 10:17:54 2007 +0200
@@ -1777,7 +1777,9 @@
 	  (print-length nil)
 	  (print-level nil)
 	  (print-readably t)	; print #[] for bytecode, 'x for (quote x)
-	  (print-gensym nil))	; this is too dangerous for now
+	  ;; Emacs 19 can't handle gensyms well.
+	  (print-gensym (if byte-compile-emacs19-compatibility nil
+			    t)))
       (princ "\n" byte-compile-outbuffer)
       (prin1 form byte-compile-outbuffer)
       nil)))
@@ -1825,7 +1827,12 @@
 	 (insert (car info))
 	 (let ((print-escape-newlines t)
 	       (print-readably t)	; print #[] for bytecode, 'x for (quote x)
-	       (print-gensym nil)	; this is too dangerous for now
+	       ;; Use a cons cell to say that we want
+	       ;; print-gensym-alist not to be cleared between calls
+	       ;; to print functions.
+	       (print-gensym (if byte-compile-emacs19-compatibility nil
+			       '(t)))
+	       print-gensym-alist
 	       (index 0))
 	   (prin1 (car form) byte-compile-outbuffer)
 	   (while (setq form (cdr form))
@@ -2042,7 +2049,11 @@
   ;; Much better than creating them and then "uncreating" them
   ;; like this.
   (read (concat "("
-		(substring (let ((print-readably t))
+		(substring (let ((print-readably t)
+				 (print-gensym
+				  (if byte-compile-emacs19-compatibility nil
+				    '(t)))
+				 (print-gensym-alist nil))
 			     (prin1-to-string obj))
 			   2 -1)
 		")")))