comparison lisp/net/net-utils.el @ 29303:a3541330de52

(finger-X.500-host-regexps): New user-option. (finger): If HOST matches a regexp from finger-X.500-host-regexps, send a query containing USER only, not USER@HOST.
author Gerd Moellmann <gerd@gnu.org>
date Tue, 30 May 2000 20:01:39 +0000
parents fed834403704
children 716c9bd98063
comparison
equal deleted inserted replaced
29302:b1d66cb97075 29303:a3541330de52
689 689
690 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 690 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
691 ;; Simple protocols 691 ;; Simple protocols
692 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 692 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
693 693
694 (defcustom finger-X.500-host-regexps nil
695 "A list of regular expressions matching host names.
696 If a host name passed to `finger' matches one of these regular
697 expressions, it is assumed to be a host that doesn't accept
698 queries of the form USER@HOST, and wants a query containing USER only."
699 :group 'net-utils
700 :type '(repeat regexp)
701 :version "21.1")
702
694 ;; Finger protocol 703 ;; Finger protocol
695 ;;;###autoload 704 ;;;###autoload
696 (defun finger (user host) 705 (defun finger (user host)
697 "Finger USER on HOST." 706 "Finger USER on HOST."
698 ;; One of those great interactive statements that's actually 707 ;; One of those great interactive statements that's actually
702 (interactive 711 (interactive
703 (let* ((answer (read-from-minibuffer "Finger User: " 712 (let* ((answer (read-from-minibuffer "Finger User: "
704 (net-utils-url-at-point))) 713 (net-utils-url-at-point)))
705 (index (string-match (regexp-quote "@") answer))) 714 (index (string-match (regexp-quote "@") answer)))
706 (if index 715 (if index
707 (list 716 (list (substring answer 0 index)
708 (substring answer 0 index) 717 (substring answer (1+ index)))
709 (substring answer (1+ index))) 718 (list answer
710 (list 719 (read-from-minibuffer "At Host: "
711 answer 720 (net-utils-machine-at-point))))))
712 (read-from-minibuffer "At Host: " (net-utils-machine-at-point)))))) 721 (let* ((user-and-host (concat user "@" host))
713 (let* ( 722 (process-name (concat "Finger [" user-and-host "]"))
714 (user-and-host (concat user "@" host)) 723 (regexps finger-X.500-host-regexps)
715 (process-name 724 found)
716 (concat "Finger [" user-and-host "]")) 725 (while (not (string-match (car regexps) host))
717 ) 726 (setq regexps (cdr regexps)))
727 (when regexps
728 (setq user-and-host user))
718 (run-network-program 729 (run-network-program
719 process-name 730 process-name
720 host 731 host
721 (cdr (assoc 'finger network-connection-service-alist)) 732 (cdr (assoc 'finger network-connection-service-alist))
722 user-and-host 733 user-and-host)))
723 )))
724 734
725 (defcustom whois-server-name "rs.internic.net" 735 (defcustom whois-server-name "rs.internic.net"
726 "Default host name for the whois service." 736 "Default host name for the whois service."
727 :group 'net-utils 737 :group 'net-utils
728 :type 'string 738 :type 'string