Alex Schroeder <[EMAIL PROTECTED]> writes:

> Ah... sorry for not checking it.  Now I see that when I enter an
> address location without any data, the trailing empty line is "eaten"
> -- the address doesn't even contain a newline, eventhough it should.

How about something like the appended patch, then?  This seems to work.

The test could be abstracted into (bbdb-address-empty-p addr)
defined as 

(defun bbdb-address-empty-p (addr)
  "Return non-nil if the address ADDR has no data."
  (and (null (bbdb-address-streets addr))
       (string= "" (bbdb-address-city addr))
       (string= "" (bbdb-address-state addr))
       (string= "" (bbdb-address-zip addr))
       (string= "" (bbdb-address-country addr))))

And the code in the patch reduces to

(unless (bbdb-address-empty-p addr)
  (insert "*none*\n"))

This second variant untested, however.

Alex.


Index: bbdb.el
===================================================================
RCS file: /cvsroot/bbdb/bbdb/lisp/bbdb.el,v
retrieving revision 1.161
diff -c -r1.161 bbdb.el
*** bbdb.el     2001/06/10 00:28:03     1.161
--- bbdb.el     2001/06/10 22:27:54
***************
*** 1137,1142 ****
--- 1137,1148 ----
                   city, state  zip
                   country"
    (insert (format " %14s: " (bbdb-address-location addr)))
+   (unless (< 0 (length (concat (bbdb-address-streets addr)
+                              (bbdb-address-city addr)
+                              (bbdb-address-state addr)
+                              (bbdb-address-zip addr)
+                              (bbdb-address-country addr))))
+     (insert "*none*\n"))
    (bbdb-format-streets addr)
    (let ((c (bbdb-address-city addr))
      (s (bbdb-address-state addr))

-- 
http://www.geocities.com/kensanata/emacs.html
http://www.emacswiki.org/

_______________________________________________
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/

Reply via email to