Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!lll-winken!uunet!zephyr.ens.tek.com!tekcrl!trost From: trost@crl.labs.tek.com (Bill Trost) Newsgroups: gnu.emacs Subject: finger.el Message-ID: <4408@tekcrl.LABS.TEK.COM> Date: 31 Jul 89 22:59:32 GMT Sender: ftp@tekcrl.LABS.TEK.COM Lines: 73 Auughhh, all these version of finger! Oof, what confusion. I'm surprised someone hasn't written an interface to the quote service yet (gee, I think Mondays should be backquote days). In any case, cramer@sun.com posted some mods dealing with the way with-output-to-temp-buffer was dealing with window sizes, and somehow hacked around the way this was being done. Actually, tale@pawl.rpi.edu had chastized me sometime before for using with-output-to-temp buffer as I had. Its use was totally inappropriate and did not belong there at all, so I made the appropriate replacements. (Hazards of using someone else's code as a skeleton for you own.) As a side effect, the buffer is not cleared between fingerings -- I consider this a feature. Cramer also moved carriage-return replacement from the process filter to the process sentinel -- a good idea, assuming the network connection's fast enough. I have put that in here. Gee, if people start hacking at these things like this, someone ought to sort of try to consolidate it all -- any volunteers? (Hey, wait, you're going to blame this on me?? Hold on a minute...) [Warning -- there is probably a .signature at the bottom of this. Sorry about that, but our postnews software is sort of strange.] ; ; finger.el ; Bill Trost (trost@crl.labs.tek.com) ; MCMLXXXIX ; ; This software is not officially a part of GNU emacs, but it should be, ; so consider it to be under the same licensing and warranty as GNU ; software. ; ; Questions or comments to trost@reed.bitnet or ; uunet!tektronix!reed!trost after 15 August 1989. ; ; Invoke a finger daemon through a network connection and stuff the reply ; in a buffer. ; ; Contains a clever mod made by Sam Cramer (cramer@sun.com) to remove ; carriage returns in the process sentinel instead of in a process ; filter. Also, thanks to David Lawrence (tale@pawl.rpi.edu) for ; helpful suggestions. (defun finger (who) "Display information about users." (interactive "sFinger: ") (cond ((null who) (setq who "@localhost")) ((not (string-match "@" who)) (setq who (concat who "@localhost")))) (display-buffer (get-buffer-create "*finger*")) (let ((stream (open-network-stream "finger" "*finger*" (substring who (1+ (string-match "@" who))) "finger"))) (set-process-sentinel stream 'finger-process-sentinel) (process-send-string stream (concat (substring who 0 (string-match "@" who)) "\n")))) (defun finger-process-sentinel (process s) (accept-process-output) (save-excursion (set-buffer (process-buffer process)) (goto-char (point-min)) (replace-string "\C-m" "") (message ""))) Bill Trost, Computer Research Labs, Tektronix trost@crl.labs.tek.com / tektronix!crl.labs!trost (trost@reed.bitnet, but probably tektronix!reed!trost)