On Tuesday, September 11, 2007 at 08:55:22, Tom Tromey wrote:
> >>>>> "Leo" == Leo  <[EMAIL PROTECTED]> writes:
> 
> Leo> Which version are you using? I haven't seen this bug in '2.36
> Leo> devo'.
> 
> 2.35.  But you probably wouldn't see the bug unless one of those
> variables gets set, and you happen to have an entry that overflows
> the print length.  I don't know how print-length gets set -- this is
> probably a bug in some other package -- but the point is that BBDB
> should be robust against it.

I will change that, it should not do any harm ..

Robert

=== modified file 'lisp/bbdb-com.el'
--- lisp/bbdb-com.el    2007-06-26 21:52:34 +0000
+++ lisp/bbdb-com.el    2007-11-02 22:21:43 +0000
@@ -3168,7 +3168,7 @@
                               (if (cdr (cdr condition)) ": ")
                               (mapconcat '(lambda (x)
                                             (if (stringp x) x
-                                              (prin1-to-string x)))
+                                              (bbdb-prin1-to-string x)))
                                          (cdr (cdr condition)) ", ")))))
      (bbdb-finger-process-sentinel nil nil)))) ; hackaroonie
 

=== modified file 'lisp/bbdb.el'
--- lisp/bbdb.el        2007-06-26 21:53:10 +0000
+++ lisp/bbdb.el        2007-11-02 22:21:43 +0000
@@ -142,6 +142,16 @@
     (defun bbdb-replace-in-string (string regexp newtext &optional literal)
       (bbdb-replace-regexp-in-string regexp newtext string nil literal))))
 
+(defun bbdb-prin1-to-string (object &optional noescape)
+  (let ((print-length nil)
+        (print-level nil))
+    (prin1-to-string object noescape)))
+
+(defun bbdb-prin1 (object &optional stream)
+  (let ((print-length nil)
+        (print-level nil))
+    (prin1 object stream)))
+
 ;; this should really be in bbdb-com
 ;;;###autoload
 (defun bbdb-submit-bug-report ()
@@ -2621,7 +2631,7 @@
                       point)))
           (bbdb-record-set-cache record nil)
           (if unmigrated (bbdb-record-set-cache unmigrated nil))
-          (insert-before-markers (prin1-to-string (or unmigrated record)) "\n")
+          (insert-before-markers (bbdb-prin1-to-string (or unmigrated record)) 
"\n")
           (set-marker (bbdb-cache-marker cache) point)
           (bbdb-record-set-cache record cache)
 ;;        (if (bbdb-record-name record)
@@ -2667,7 +2677,7 @@
         (bbdb-record-set-cache record nil)
         (if unmigrated (bbdb-record-set-cache unmigrated nil))
 
-        (insert (prin1-to-string (or unmigrated record)) "\n")
+        (insert (bbdb-prin1-to-string (or unmigrated record)) "\n")
         (delete-region (point)
                        (if (cdr tail)
                            (bbdb-record-marker (car (cdr tail)))
@@ -2784,7 +2794,7 @@
       ;; record in the database!
       (insert-before-markers ";;; user-fields: \n")
       (forward-char -1))
-    (prin1 (mapcar (lambda (x) (intern (car x)))
+    (bbdb-prin1 (mapcar (lambda (x) (intern (car x)))
                    bbdb-propnames)
            (current-buffer))
     bbdb-propnames))
@@ -3657,7 +3667,7 @@
            (setq record (car records)
                  cache (bbdb-record-cache record))
            (bbdb-record-set-cache record nil)
-           (prin1 (car records))
+           (bbdb-prin1 (car records))
            (bbdb-record-set-cache record cache)
            (insert ?\n)
            (setq records (cdr records))))



-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
bbdb-info@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/

Reply via email to