It says here "BBDB version 1.48 24-jul-93"
I often want to finger people who have mailed me, but, at least the
way things work here, mail addresses often don't correspond to real
machines. This patch lets BBDB do regexp-replacements on the address
according to the alist bbdb-finger-host-fixups. For instance mine is:
(("^cogsci.ed.*$" . "burns.cogsci.ed.ac.uk")))
which means if I get mail from [EMAIL PROTECTED] then it automatically
fingers [EMAIL PROTECTED]
I guess this should really all be done by finger itself by looking up
the MX or something but this works. Of course I have another 100k of
code to screw around with braindead UK-format addresses, so BBDB
actually doesn't try & finger some machine in Czechoslovakia when I
get mail from [EMAIL PROTECTED] I just love these UK networks.
--tim
PS Jamie, am I on this list & the announce one, if not could I be?)
diff -c -r1.48 -r1.48.1.1
*** 1.48 1993/07/26 14:30:06
--- 1.48.1.1 1993/10/28 11:26:39
***************
*** 1837,1852 ****
(defvar bbdb-finger-buffer-name "*finger*")
(defun bbdb-finger-internal (address)
(message "Fingering %s..." address)
(condition-case condition
(let* ((@ (string-match "@" address))
(stream (open-network-stream
"finger" bbdb-finger-buffer-name
! (if @ (substring address (1+ @)) "localhost")
"finger")))
(set-process-sentinel stream 'bbdb-finger-process-sentinel)
! (princ (concat "finger " address "\n"))
(process-send-string stream
(concat ;;"/W " ; cs.stanford.edu doesn't like this...
(if @ (substring address 0 @) address) "\n"))
--- 1837,1884 ----
(defvar bbdb-finger-buffer-name "*finger*")
+ (defvar bbdb-finger-host-fixups
+ ()
+ "Alist of (PATTERN . REPLACEMENT) used to work out real host names
+ from network addresses by regexp replacement. For instance
+ '((\"^cogsci\.ed.*$\" . \"burns.cogsci.ed.ac.uk\"))
+ is what I use")
+
+ (defun bbdb-finger-fixup-host (host)
+ (if bbdb-finger-host-fixups
+ (let ((buf (get-buffer-create " *bbdb finger tmp*"))
+ (map bbdb-finger-host-fixups))
+ (save-excursion
+ (set-buffer buf)
+ (erase-buffer)
+ (insert host)
+ (while map
+ (goto-char (point-min))
+ (while (re-search-forward (car (car map)) nil t)
+ (replace-match (cdr (car map)) nil nil))
+ (setq map (cdr map)))
+ (prog1
+ (buffer-string)
+ (kill-buffer buf))))
+ host))
+
(defun bbdb-finger-internal (address)
(message "Fingering %s..." address)
(condition-case condition
(let* ((@ (string-match "@" address))
+ (fixaddress (and @ (bbdb-finger-fixup-host
+ (substring address (1+ @)))))
(stream (open-network-stream
"finger" bbdb-finger-buffer-name
! (or fixaddress "localhost")
"finger")))
(set-process-sentinel stream 'bbdb-finger-process-sentinel)
! (princ (concat "finger " (if fixaddress
! (concat
! (substring address 0 @) "@"
! fixaddress " # rewrite of " address)
! address)
! "\n"))
(process-send-string stream
(concat ;;"/W " ; cs.stanford.edu doesn't like this...
(if @ (substring address 0 @) address) "\n"))