: Hi, when I create a new entry, and enter the phone numbers, the
: area-code is the default for ALL the phones.  I think it should change
: the default to the area-code you enter for the first phone number.  
...
: Any thoughts?  Easy, difficult to do?  

Easy to do. I've included a `diff -c', suitable for patch(1), of my
changes at the end of this message. 

If you enter a new area code, it will be retained as the default until
you either enter another area code or you hit return for no more phone
numbers. 

Well, I've now taken more lines to describe the feature than it took to
implement it. Let me know if there are problems.

Mark

___________________________________________________________________________
[EMAIL PROTECTED]           Fax: 415-506-1113       RIPEM key on server
                             

-------------------->8  Cut Here 8<--------------------

*** bbdb-com.el.orig    Wed Nov 10 12:18:14 1993
--- bbdb-com.el Wed Nov 10 12:47:55 1993
***************
*** 286,306 ****
--- 286,313 ----
         (list (bbdb-string-trim string)))
        ((string-match bbdb-phone-regexp-1 string)
         ;; (415) 555-1212 x123
+        ;; maw - add these setq to modify the default area-code
+        ;; in subsequent phone numbers
+        (setq temp-area-code (bbdb-subint string 1))
         (list (bbdb-subint string 1) (bbdb-subint string 2)
               (bbdb-subint string 3) (bbdb-subint string 4)))
        ((string-match bbdb-phone-regexp-2 string)
         ;; (415) 555-1212
+        (setq temp-area-code (bbdb-subint string 1))
         (list (bbdb-subint string 1) (bbdb-subint string 2)
               (bbdb-subint string 3)))
        ((string-match bbdb-phone-regexp-3 string)
         ;; 555-1212 x123
+        (setq temp-area-code 'nil)
         (list 0 (bbdb-subint string 1) (bbdb-subint string 2)
               (bbdb-subint string 3)))
        ((string-match bbdb-phone-regexp-4 string)
         ;; 555-1212
+        (setq temp-area-code 'nil)
         (list 0 (bbdb-subint string 1) (bbdb-subint string 2)))
        ((string-match bbdb-phone-regexp-5 string)
         ;; x123
+        (setq temp-area-code 'nil)
         (list 0 0 0 (bbdb-subint string 1)))
        (t (error "phone number unparsable."))))
  
***************
*** 362,368 ****
                         (setq L (cons addr nil)
                               L-tail L)))
                   L))
!         (phones (let (L L-tail str)
                    (while (not (string= ""
                                         (setq str
                                               (bbdb-read-string "Phone Location [RET 
when no more phones]: "))))
--- 369,375 ----
                         (setq L (cons addr nil)
                               L-tail L)))
                   L))
!         (phones (let (L L-tail str (temp-area-code bbdb-default-area-code))
                    (while (not (string= ""
                                         (setq str
                                               (bbdb-read-string "Phone Location [RET 
when no more phones]: "))))
***************
*** 370,376 ****
                              (bbdb-error-retry
                                (bbdb-parse-phone-number
                                  (read-string "Phone: "
!                                              (and bbdb-default-area-code (format 
"(%03d) " bbdb-default-area-code))))))
                             (phone (apply 'vector str
                                           (if (= 3 (length phonelist))
                                               (nconc phonelist '(0))
--- 377,383 ----
                              (bbdb-error-retry
                                (bbdb-parse-phone-number
                                  (read-string "Phone: "
!                                              (and temp-area-code (format "(%03d) " 
temp-area-code))))))
                             (phone (apply 'vector str
                                           (if (= 3 (length phonelist))
                                               (nconc phonelist '(0))

Reply via email to