From 086d5b876589f4942d45eec3d167c31f10fd6f95 Mon Sep 17 00:00:00 2001 From: Gerd Moellmann Date: Tue, 30 May 2000 20:02:22 +0000 Subject: [PATCH] (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. --- lisp/ChangeLog | 4 ++++ lisp/net/net-utils.el | 36 +++++++++++++++++++++++------------- 2 files changed, 27 insertions(+), 13 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 58c1e41128b..d2c83bb2046 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,9 @@ 2000-05-30 Gerd Moellmann + * net/net-utils.el (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. + * mail/rmail.el (rmail-widen-to-current-msgbeg): Use rmail-msgbeg and rmail-msgend to compute the restriction at the end, instead of computing it. 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." -- 2.39.5