I made two additions to the entry of net addresses:
1) to make it easier to add mail addresses for people from your own
company, i added bbdb-default-domain. if it is set, it will be
appended to a net address that does not have a domain specified.
(nothing will be altered if the var is unset, or if you edit existing
addresses, or if you give a prefix arg to bbdb-insert-new-field.)
2) to make it easier to cut and paste from mail addresses expressed as
URLs, the leading "mailto:" will be removed from the address when it is
entered.
would others find these useful? if so, how can i roll it into the current
codebase? i have a sourceforge account but no cvs access.
diffs are below (added variable to bbdb.el, added comments and code to
bbdb-com.el).
- jfw
p.s. is there a way for email to this list not to get bounced by sourceforge?
i get this error when sending from my usual machine:
Deferred: 451 rejected: temporarily unable to verify sender address (try
again later)
Message could not be delivered for 5 days
Message will be deleted from queue
it's probably happening since my machine is not visible outside the firewall.
any workarounds? thanks.
----------------------------------------------------------------------
*** /tmp/bbdb-2.32/lisp/bbdb.el Sun Mar 4 12:30:09 2001
--- bbdb.el Wed Mar 28 16:48:20 2001
***************
*** 337,342 ****
--- 337,354 ----
:type '(choice (const :tag "none" nil)
(integer :tag "Area code" :value "312")))
+ (defcustom bbdb-default-domain nil
+ "*The default domain to append when prompting for a new net address.
+ If the address entered does not contain `[@%!]', `@bbdb-default-domain'
+ will be appended to it.
+
+ The address will not be altered if bbdb-default-domain remains at its
+ default value of nil, or if one provides a prefix argument to the
+ bbdb-insert-new-field command."
+ :group 'bbdb-record-creation
+ :type '(choice (const :tag "none" nil)
+ (string :tag "Domain" :value nil)))
+
(defcustom bbdb-north-american-phone-numbers-p t
"*Set this to nil if you want to enter phone numbers that aren't the same
syntax as those in North America (that is, [[1] nnn] nnn nnnn ['x' n*]).
***************
*** 2291,2296 ****
--- 2303,2309 ----
\t bbdb-case-fold-search
\t bbdb-completion-type
\t bbdb-default-area-code
+ \t bbdb-default-domain
\t bbdb-electric-p
\t bbdb-elided-display
\t bbdb-file
----------------------------------------------------------------------
*** /tmp/bbdb-2.32/lisp/bbdb-com.el Sun Feb 18 00:00:39 2001
--- bbdb-com.el Thu Mar 29 11:16:17 2001
***************
*** 709,715 ****
argument. A prefix arg of ^U means it's to be a euronumber, and any
other prefix arg means it's to be a a structured north american number.
Otherwise, which style is used is controlled by the variable
! `bbdb-north-american-phone-numbers-p'."
(interactive (let ((name "")
(completion-ignore-case t))
(while (string= name "")
--- 709,723 ----
argument. A prefix arg of ^U means it's to be a euronumber, and any
other prefix arg means it's to be a a structured north american number.
Otherwise, which style is used is controlled by the variable
! `bbdb-north-american-phone-numbers-p'.
!
! If you are inserting a new net address, you can have BBDB append a
! default domain to any net address that does not contain one. Set
! `bbdb-default-domain' to a string such as \"mycompany.com\" (or,
! depending on your environment, (getenv \"DOMAINNAME\")), and
! \"@mycompany.com\" will be appended to an address that is entered as
! just a username. A prefix arg of ^U (or a `bbdb-default-domain'
! value of \"\", the default) means do not alter the address."
(interactive (let ((name "")
(completion-ignore-case t))
(while (string= name "")
***************
*** 793,799 ****
(bbdb-redisplay-one-record record))))
(defun bbdb-prompt-for-new-field-value (name)
! (cond ((eq name 'net) (bbdb-read-string "Net: "))
((eq name 'aka) (bbdb-read-string "Alternate Names: "))
((eq name 'phone)
(let ((p (make-vector
--- 801,816 ----
(bbdb-redisplay-one-record record))))
(defun bbdb-prompt-for-new-field-value (name)
! (cond ((eq name 'net)
! (let
! ((n (bbdb-read-string "Net: ")))
! (if (string-match "^mailto:" n)
! (setq n (substring n (match-end 0))))
! (if (or (eq nil bbdb-default-domain)
! current-prefix-arg
! (string-match "[@%!]" n))
! n
! (concat n "@" bbdb-default-domain))))
((eq name 'aka) (bbdb-read-string "Alternate Names: "))
((eq name 'phone)
(let ((p (make-vector
----------------------------------------------------------------------
_______________________________________________
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/