| Date: Tue, 21 July 92, 11:22 GMT
  | From: Eyvind Ness
  |
  |   | Date: Tue, 21 July 92, 05:01 MDT
  |   | From: Jerry
  |   |
  |   | Enjoy.  -Jerry
  |   | 
  |   |                              Jerry Graves
  |   |                           UTEP Math Sysadmin
  |   |                        jerry@math.ep.utexas.edu
  |   | 
  |   | ;; ---------------- 8< ---- Cut Here ---- 8< ----------------
  |   | ;;; vm-finger.el
  |   | ;;;  finger a user in vm
  |   | 
  |   | ;; got this off the net -Jerry
  |   | ;; (who wrote this? I'm sorry, can't attribute everyone!)
  | 
  | I must confess, I did. But here's a cleaner version of the same function
  | that I've hacked up since the time I posted it to the vm lists:
  | 
  | (defun string-remove-chars (list-of-chars a-string)
  |   ;; Function: Returns a string with the characters in LIST-OF-CHARS
  |   ;; from A-STRING removed.
  |   (mapconcat 
  |    (function (lambda (ch)
  | 	       (or (and (memq ch list-of-chars) "")
  | 		   (char-to-string ch))))
  |    a-string ""))
  | 
  | 
  | Otherwise, I like your finger-stuff. [There is a minor problem, though,
  | with the kind of addresses used by you and me (no hostnames in
  | email-address) - maybe it could be made a little smarter by extracting
  | the hostname from 
  | 
  | 	Message-Id: <9207211101.AA12647@banach.math.ep.utexas.edu>
  | 
  | or something similar].

I couldn't resist fixing your definition of vm-finger-message-author to
be smarter about finding which host to finger:

(defun vm-finger-message-author ()
  "Run finger on the current author's address as given in message.
May fail for a number of reasons:
 host down, host unknown, connection refused, connection timed out, etc."
  (interactive)
  (vm-select-folder-buffer)
  (let ((whotofinger
	 (string-remove-chars
	  (list ?\  ?\C-i ?\C-j ?\C-m ?\( ?\))
	  ;; this a little less obscure than '(32 9 10 13 40 41), Jerry
	  ((lambda (from-str m-id)
	     (let ((omd (match-data)))
	       (prog1
		   (if (string-match "@" from-str)
		       (concat (substring from-str 0 (match-beginning 0))
			       (and (string-match "@[^>)]*" m-id)
				    (substring 
				     m-id
				     (match-beginning 0)
				     (match-end 0))))
		       from-str)
		 (store-match-data omd))))
	   (vm-su-from (car vm-message-pointer))
	   (vm-su-message-id (car vm-message-pointer))))))
    (message 
     "Fingering %s... (elisp-expression bound to %s)"
     whotofinger 
     (key-description (car (where-is-internal 'yank))))
    ;; *Almost* like copy-region-as-kill in simple.el:
    (setq kill-ring (cons (format "(finger \"%s\")" whotofinger) kill-ring))
    (if (> (length kill-ring) kill-ring-max)
	(setcdr (nthcdr (1- kill-ring-max) kill-ring) nil))
    (setq kill-ring-yank-pointer kill-ring)
    (finger whotofinger)))

I also chose to push the "(finger ..)" expression on the kill-ring
to make it easy to redo it, possibly with slightly changed params. Now,
after doing a finger from VM, you can press M-ESC (eval-expression) and
then C-y (yank) to redo the finger command.

There is still a major problem, though, which I cannot see how to fix.
Finger seems to require the LOGIN-NAME of the author, but very often the
author's login-name isn't present in the message.

E.g. I just did:

(finger "Richard.Stallman@mole.gnu.ai.mit.edu")

without much luck.

Cheers,
Eyvind.

+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
 Eyvind Ness                    Internet Email: Eyvind.Ness@HRP.No
 Research Scientist             Phone: +47 9 183100
 Control Room Systems Division  Fax: +47 9 187109
 OECD Halden Reactor Project    Surface Mail: P.O. Box 173, N-1751 Halden
 Norway
+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+


 -Applicants must also have extensive knowledge of Unix, although they
should have sufficiently good programming taste to not consider this an
achievement.

	MIT AI Lab job ad in Comm. of the ACM, vol. 35, no. 6, June 1992, pp. 160