diff options
author | Gerd Moellmann <gerd@gnu.org> | 2000-05-30 20:02:22 +0000 |
---|---|---|
committer | Gerd Moellmann <gerd@gnu.org> | 2000-05-30 20:02:22 +0000 |
commit | 086d5b876589f4942d45eec3d167c31f10fd6f95 (patch) | |
tree | 7a1c3a65fc11a8295561f3f43216595f63824535 /lisp/net/net-utils.el | |
parent | 10fc3187637f785c7dd5e81a00fd65d1a995d1c0 (diff) | |
download | emacs-086d5b876589f4942d45eec3d167c31f10fd6f95.tar.gz |
(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.
Diffstat (limited to 'lisp/net/net-utils.el')
-rw-r--r-- | lisp/net/net-utils.el | 36 |
1 files changed, 23 insertions, 13 deletions
diff --git a/lisp/net/net-utils.el b/lisp/net/net-utils.el index 480a6163a2e..9a349f7637d 100644 --- a/lisp/net/net-utils.el +++ b/lisp/net/net-utils.el @@ -691,6 +691,15 @@ This list in not complete.") ;; 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 @@ This list in not complete.") (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." |