# HG changeset patch # User Gerd Moellmann # Date 959716899 0 # Node ID a3541330de52bf91f11a2240f9741e4ae82d5d5d # Parent b1d66cb970758a385bef71928d3c8afeb1c49814 (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. diff -r b1d66cb97075 -r a3541330de52 lisp/net/net-utils.el --- a/lisp/net/net-utils.el Tue May 30 18:45:45 2000 +0000 +++ b/lisp/net/net-utils.el Tue May 30 20:01:39 2000 +0000 @@ -691,6 +691,15 @@ ;; Simple protocols ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +(defcustom finger-X.500-host-regexps nil + "A list of regular expressions matching host names. +If a host name passed to `finger' matches one of these regular +expressions, it is assumed to be a host that doesn't accept +queries of the form USER@HOST, and wants a query containing USER only." + :group 'net-utils + :type '(repeat regexp) + :version "21.1") + ;; Finger protocol ;;;###autoload (defun finger (user host) @@ -704,23 +713,24 @@ (net-utils-url-at-point))) (index (string-match (regexp-quote "@") answer))) (if index - (list - (substring answer 0 index) - (substring answer (1+ index))) - (list - answer - (read-from-minibuffer "At Host: " (net-utils-machine-at-point)))))) - (let* ( - (user-and-host (concat user "@" host)) - (process-name - (concat "Finger [" user-and-host "]")) - ) + (list (substring answer 0 index) + (substring answer (1+ index))) + (list answer + (read-from-minibuffer "At Host: " + (net-utils-machine-at-point)))))) + (let* ((user-and-host (concat user "@" host)) + (process-name (concat "Finger [" user-and-host "]")) + (regexps finger-X.500-host-regexps) + found) + (while (not (string-match (car regexps) host)) + (setq regexps (cdr regexps))) + (when regexps + (setq user-and-host user)) (run-network-program process-name host (cdr (assoc 'finger network-connection-service-alist)) - user-and-host - ))) + user-and-host))) (defcustom whois-server-name "rs.internic.net" "Default host name for the whois service."