]> code.delx.au - gnu-emacs/blobdiff - lisp/net/net-utils.el
Merged from emacs@sv.gnu.org
[gnu-emacs] / lisp / net / net-utils.el
index 9f98b7f809180a98aa1d5b3d462f34a8c16909f7..f6a8c2c2157637de14aa2d33ef41341b5204d7cc 100644 (file)
@@ -1,9 +1,11 @@
-;;; net-utils.el --- Network functions
+;;; net-utils.el --- network functions
+
+;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+;;   2005, 2006 Free Software Foundation, Inc.
 
 ;; Author:  Peter Breton <pbreton@cs.umb.edu>
 ;; Created: Sun Mar 16 1997
-;; Keywords: network communications
-;; Time-stamp: <2000-10-04 22:39:05 pbreton>
+;; Keywords: network comm
 
 ;; This file is part of GNU Emacs.
 
 
 ;; You should have received a copy of the GNU General Public License
 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
 
 ;;; Commentary:
+
 ;;
 ;; There are three main areas of functionality:
 ;;
   "Network utility functions."
   :prefix "net-utils-"
   :group 'comm
-  :version "20.3"
-  )
+  :version "20.3")
 
 (defcustom net-utils-remove-ctl-m
   (member system-type (list 'windows-nt 'msdos))
   "If non-nil, remove control-Ms from output."
   :group 'net-utils
-  :type  'boolean
-  )
+  :type  'boolean)
 
 (defcustom traceroute-program
   (if (eq system-type 'windows-nt)
     "traceroute")
   "Program to trace network hops to a destination."
   :group 'net-utils
-  :type  'string
-  )
+  :type  'string)
 
 (defcustom traceroute-program-options nil
   "Options for the traceroute program."
   :group 'net-utils
-  :type  '(repeat string)
-  )
+  :type  '(repeat string))
 
 (defcustom ping-program "ping"
   "Program to send network test packets to a host."
   :group 'net-utils
-  :type  'string
-  )
+  :type  'string)
 
-;; On Linux and Irix, the system's ping program seems to send packets
+;; On GNU/Linux and Irix, the system's ping program seems to send packets
 ;; indefinitely unless told otherwise
 (defcustom ping-program-options
   (and (memq system-type (list 'linux 'gnu/linux 'irix))
@@ -93,8 +91,7 @@
   "Options for the ping program.
 These options can be used to limit how many ICMP packets are emitted."
   :group 'net-utils
-  :type  '(repeat string)
-  )
+  :type  '(repeat string))
 
 (defcustom ipconfig-program
   (if (eq system-type 'windows-nt)
@@ -102,43 +99,37 @@ These options can be used to limit how many ICMP packets are emitted."
     "ifconfig")
   "Program to print network configuration information."
   :group 'net-utils
-  :type  'string
-  )
+  :type  'string)
 
 (defcustom ipconfig-program-options
-   (list
-    (if (eq system-type 'windows-nt)
-       "/all" "-a"))
+  (list
+   (if (eq system-type 'windows-nt)
+       "/all" "-a"))
   "Options for ipconfig-program."
   :group 'net-utils
-  :type  '(repeat string)
-  )
+  :type  '(repeat string))
 
 (defcustom netstat-program  "netstat"
   "Program to print network statistics."
   :group 'net-utils
-  :type  'string
-  )
+  :type  'string)
 
 (defcustom netstat-program-options
   (list "-a")
   "Options for netstat-program."
   :group 'net-utils
-  :type  '(repeat string)
-  )
+  :type  '(repeat string))
 
 (defcustom arp-program  "arp"
   "Program to print IP to address translation tables."
   :group 'net-utils
-  :type  'string
-  )
+  :type  'string)
 
 (defcustom arp-program-options
   (list "-a")
   "Options for arp-program."
   :group 'net-utils
-  :type  '(repeat string)
-  )
+  :type  '(repeat string))
 
 (defcustom route-program
   (if (eq system-type 'windows-nt)
@@ -146,8 +137,7 @@ These options can be used to limit how many ICMP packets are emitted."
     "netstat")
   "Program to print routing tables."
   :group 'net-utils
-  :type  'string
-  )
+  :type  'string)
 
 (defcustom route-program-options
   (if (eq system-type 'windows-nt)
@@ -155,67 +145,77 @@ These options can be used to limit how many ICMP packets are emitted."
     (list "-r"))
   "Options for route-program."
   :group 'net-utils
-  :type  '(repeat string)
-  )
+  :type  '(repeat string))
 
 (defcustom nslookup-program  "nslookup"
   "Program to interactively query DNS information."
   :group 'net-utils
-  :type  'string
-  )
+  :type  'string)
 
 (defcustom nslookup-program-options  nil
   "List of options to pass to the nslookup program."
   :group 'net-utils
-  :type  '(repeat string)
-  )
+  :type  '(repeat string))
 
 (defcustom nslookup-prompt-regexp "^> "
-  "Regexp to match the nslookup prompt."
+  "Regexp to match the nslookup prompt.
+
+This variable is only used if the variable
+`comint-use-prompt-regexp' is non-nil."
   :group 'net-utils
-  :type  'regexp
-  )
+  :type  'regexp)
 
 (defcustom dig-program  "dig"
   "Program to query DNS information."
   :group 'net-utils
-  :type  'string
-  )
+  :type  'string)
 
 (defcustom ftp-program "ftp"
   "Progam to run to do FTP transfers."
   :group 'net-utils
-  :type  'string
-  )
+  :type  'string)
 
 (defcustom ftp-program-options nil
   "List of options to pass to the FTP program."
   :group 'net-utils
-  :type  '(repeat string)
-  )
+  :type  '(repeat string))
 
 (defcustom ftp-prompt-regexp "^ftp>"
-  "Regexp which matches the FTP program's prompt."
+  "Regexp which matches the FTP program's prompt.
+
+This variable is only used if the variable
+`comint-use-prompt-regexp' is non-nil."
   :group 'net-utils
-  :type  'regexp
-  )
+  :type  'regexp)
 
 (defcustom smbclient-program "smbclient"
   "Smbclient program."
   :group 'net-utils
-  :type  'string
-  )
+  :type  'string)
 
 (defcustom smbclient-program-options nil
   "List of options to pass to the smbclient program."
   :group 'net-utils
-  :type  '(repeat string)
-  )
+  :type  '(repeat string))
 
 (defcustom smbclient-prompt-regexp "^smb: \>"
-  "Regexp which matches the smbclient program's prompt."
+  "Regexp which matches the smbclient program's prompt.
+
+This variable is only used if the variable
+`comint-use-prompt-regexp' is non-nil."
+  :group 'net-utils
+  :type  'regexp)
+
+(defcustom dns-lookup-program  "host"
+  "Program to interactively query DNS information."
   :group 'net-utils
-  :type  'regexp
+  :type  'string
+  )
+
+(defcustom dns-lookup-program-options  nil
+  "List of options to pass to the dns-lookup program."
+  :group 'net-utils
+  :type  '(repeat string)
   )
 
 ;; Internal variables
@@ -228,9 +228,11 @@ These options can be used to limit how many ICMP packets are emitted."
 
 (defconst nslookup-font-lock-keywords
   (progn
+    (defvar font-lock-type-face)
+    (defvar font-lock-keyword-face)
+    (defvar font-lock-variable-name-face)
     (require 'font-lock)
     (list
-     (list nslookup-prompt-regexp 0 font-lock-reference-face)
      (list "^[A-Za-z0-9 _]+:"     0 font-lock-type-face)
      (list "\\<\\(SOA\\|NS\\|MX\\|A\\|CNAME\\)\\>"
           1 font-lock-keyword-face)
@@ -247,32 +249,10 @@ These options can be used to limit how many ICMP packets are emitted."
         (mapconcat 'identity
                    (make-list 2 host-expression)
                    "\\.")
-        "\\(\\." host-expression "\\)*")
-       )
-      0 font-lock-variable-name-face)
-     ))
+        "\\(\\." host-expression "\\)*"))
+      0 font-lock-variable-name-face)))
   "Expressions to font-lock for nslookup.")
 
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; FTP goodies
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-(defconst ftp-font-lock-keywords
-  (progn
-    (require 'font-lock)
-    (list
-     (list ftp-prompt-regexp 0 font-lock-reference-face))))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; smbclient goodies
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-(defconst smbclient-font-lock-keywords
-  (progn
-    (require 'font-lock)
-    (list
-     (list smbclient-prompt-regexp 0 font-lock-reference-face))))
-
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Utility functions
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -352,8 +332,7 @@ These options can be used to limit how many ICMP packets are emitted."
      (concat "Traceroute" " " target)
      (concat "** Traceroute ** " traceroute-program " ** " target)
      traceroute-program
-     options
-     )))
+     options)))
 
 ;;;###autoload
 (defun ping (host)
@@ -370,8 +349,7 @@ If your system's ping continues until interrupted, you can try setting
      (concat "Ping" " " host)
      (concat "** Ping ** " ping-program " ** " host)
      ping-program
-     options
-     )))
+     options)))
 
 ;;;###autoload
 (defun ipconfig ()
@@ -381,8 +359,7 @@ If your system's ping continues until interrupted, you can try setting
    "Ipconfig"
    (concat "** Ipconfig ** " ipconfig-program " ** ")
    ipconfig-program
-   ipconfig-program-options
-   ))
+   ipconfig-program-options))
 
 ;; This is the normal name on most Unixes.
 ;;;###autoload
@@ -396,8 +373,7 @@ If your system's ping continues until interrupted, you can try setting
    "Netstat"
    (concat "** Netstat ** " netstat-program " ** ")
    netstat-program
-   netstat-program-options
-   ))
+   netstat-program-options))
 
 ;;;###autoload
 (defun arp ()
@@ -407,8 +383,7 @@ If your system's ping continues until interrupted, you can try setting
    "Arp"
    (concat "** Arp ** " arp-program " ** ")
    arp-program
-   arp-program-options
-   ))
+   arp-program-options))
 
 ;;;###autoload
 (defun route ()
@@ -418,8 +393,7 @@ If your system's ping continues until interrupted, you can try setting
    "Route"
    (concat "** Route ** " route-program " ** ")
    route-program
-   route-program-options
-   ))
+   route-program-options))
 
 ;; FIXME -- Needs to be a process filter
 ;; (defun netstat-with-filter (filter)
@@ -428,8 +402,7 @@ If your system's ping continues until interrupted, you can try setting
 ;;   (netstat)
 ;;   (set-buffer (get-buffer "*Netstat*"))
 ;;   (goto-char (point-min))
-;;   (delete-matching-lines filter)
-;;   )
+;;   (delete-matching-lines filter))
 
 ;;;###autoload
 (defun nslookup-host (host)
@@ -447,9 +420,7 @@ If your system's ping continues until interrupted, you can try setting
                (list "Nslookup" host nslookup-program)
                " ** "))
      nslookup-program
-     options
-     )))
-
+     options)))
 
 ;;;###autoload
 (defun nslookup ()
@@ -457,40 +428,40 @@ If your system's ping continues until interrupted, you can try setting
   (interactive)
   (require 'comint)
   (comint-run nslookup-program)
-  (set-process-filter (get-buffer-process "*nslookup*")
-   'net-utils-remove-ctrl-m-filter)
-  (nslookup-mode)
-  )
+  (nslookup-mode))
 
 ;; Using a derived mode gives us keymaps, hooks, etc.
-(define-derived-mode
-  nslookup-mode comint-mode "Nslookup"
+(define-derived-mode nslookup-mode comint-mode "Nslookup"
   "Major mode for interacting with the nslookup program."
   (set
    (make-local-variable 'font-lock-defaults)
    '((nslookup-font-lock-keywords)))
-  (setq local-abbrev-table nslookup-mode-abbrev-table)
-  (abbrev-mode t)
-  (make-local-variable 'comint-prompt-regexp)
   (setq comint-prompt-regexp nslookup-prompt-regexp)
-  (make-local-variable 'comint-input-autoexpand)
-  (setq comint-input-autoexpand t)
-  )
+  (setq comint-input-autoexpand t))
 
 (define-key nslookup-mode-map "\t" 'comint-dynamic-complete)
 
-(define-abbrev nslookup-mode-abbrev-table "e"   "exit")
-(define-abbrev nslookup-mode-abbrev-table "f"   "finger")
-(define-abbrev nslookup-mode-abbrev-table "h"   "help")
-(define-abbrev nslookup-mode-abbrev-table "lse" "lserver")
-(define-abbrev nslookup-mode-abbrev-table "q"   "exit")
-(define-abbrev nslookup-mode-abbrev-table "r"   "root")
-(define-abbrev nslookup-mode-abbrev-table "s"   "set")
-(define-abbrev nslookup-mode-abbrev-table "se"  "server")
-(define-abbrev nslookup-mode-abbrev-table "v"   "viewer")
+;;;###autoload
+(defun dns-lookup-host (host)
+  "Lookup the DNS information for HOST (name or IP address)."
+  (interactive
+   (list (read-from-minibuffer "Lookup host: " (net-utils-machine-at-point))))
+  (let ((options
+        (if dns-lookup-program-options
+            (append dns-lookup-program-options (list host))
+          (list host))))
+    (net-utils-run-program
+     (concat "DNS Lookup [" host "]")
+     (concat "** "
+      (mapconcat 'identity
+               (list "DNS Lookup" host dns-lookup-program)
+               " ** "))
+     dns-lookup-program
+     options
+     )))
 
 ;;;###autoload
-(defun dig (host)
+(defun run-dig (host)
   "Run dig program."
   (interactive
    (list
@@ -498,7 +469,8 @@ If your system's ping continues until interrupted, you can try setting
       (require 'ffap)
       (read-from-minibuffer
        "Lookup host: "
-       (or (ffap-string-at-point 'machine) "")))))
+       (with-no-warnings
+        (or (ffap-string-at-point 'machine) ""))))))
   (net-utils-run-program
    "Dig"
    (concat "** "
@@ -506,8 +478,7 @@ If your system's ping continues until interrupted, you can try setting
                      (list "Dig" host dig-program)
                      " ** "))
    dig-program
-   (list host)
-   ))
+   (list host)))
 
 ;; This is a lot less than ange-ftp, but much simpler.
 ;;;###autoload
@@ -520,41 +491,27 @@ If your system's ping continues until interrupted, you can try setting
   (require 'comint)
   (let ((buf (get-buffer-create (concat "*ftp [" host "]*"))))
     (set-buffer buf)
-    (comint-mode)
+    (ftp-mode)
     (comint-exec buf (concat "ftp-" host) ftp-program nil
                 (if ftp-program-options
                     (append (list host) ftp-program-options)
                   (list host)))
-    (ftp-mode)
-    (switch-to-buffer-other-window buf)
-    ))
+    (pop-to-buffer buf)))
 
-(define-derived-mode
-  ftp-mode comint-mode "FTP"
+(define-derived-mode ftp-mode comint-mode "FTP"
   "Major mode for interacting with the ftp program."
-
-  (set
-   (make-local-variable 'font-lock-defaults)
-   '((ftp-font-lock-keywords)))
-
-  (make-local-variable 'comint-prompt-regexp)
   (setq comint-prompt-regexp ftp-prompt-regexp)
-
-  (make-local-variable 'comint-input-autoexpand)
   (setq comint-input-autoexpand t)
-
-  ;; Already buffer local!
-  (setq comint-output-filter-functions
-       (list 'comint-watch-for-password-prompt))
-
-  (setq local-abbrev-table ftp-mode-abbrev-table)
-  (abbrev-mode t)
-  )
-
-(define-abbrev ftp-mode-abbrev-table "q"    "quit")
-(define-abbrev ftp-mode-abbrev-table "g"    "get")
-(define-abbrev ftp-mode-abbrev-table "p"    "prompt")
-(define-abbrev ftp-mode-abbrev-table "anon" "anonymous")
+  ;; Only add the password-prompting hook if it's not already in the
+  ;; global hook list.  This stands a small chance of losing, if it's
+  ;; later removed from the global list (very small, since any
+  ;; password prompts will probably immediately follow the initial
+  ;; connection), but it's better than getting prompted twice for the
+  ;; same password.
+  (unless (memq 'comint-watch-for-password-prompt
+               (default-value 'comint-output-filter-functions))
+    (add-hook 'comint-output-filter-functions 'comint-watch-for-password-prompt
+             nil t)))
 
 ;; Occasionally useful
 (define-key ftp-mode-map "\t" 'comint-dynamic-complete)
@@ -571,58 +528,40 @@ If your system's ping continues until interrupted, you can try setting
         (buf (get-buffer-create (concat "*" name "*")))
         (service-name (concat "\\\\" host "\\" service)))
     (set-buffer buf)
-    (comint-mode)
+    (smbclient-mode)
     (comint-exec buf name smbclient-program nil
                 (if smbclient-program-options
                     (append (list service-name) smbclient-program-options)
                   (list service-name)))
-    (smbclient-mode)
-    (switch-to-buffer-other-window buf)
-    ))
+    (pop-to-buffer buf)))
 
 (defun smbclient-list-shares (host)
   "List services on HOST."
   (interactive
    (list
     (read-from-minibuffer
-     "Connect to Host: " (net-utils-machine-at-point))
-    ))
+     "Connect to Host: " (net-utils-machine-at-point))))
   (let ((buf (get-buffer-create (format "*SMB Shares on %s*" host))))
     (set-buffer buf)
-    (comint-mode)
-    (comint-exec
-     buf
-     "smbclient-list-shares"
-     smbclient-program
-     nil
-     (list "-L" host)
-     )
     (smbclient-mode)
-    (switch-to-buffer-other-window buf)))
+    (comint-exec buf "smbclient-list-shares"
+                smbclient-program nil (list "-L" host))
+    (pop-to-buffer buf)))
 
-(define-derived-mode
-  smbclient-mode comint-mode "smbclient"
+(define-derived-mode smbclient-mode comint-mode "smbclient"
   "Major mode for interacting with the smbclient program."
-
-  (set
-   (make-local-variable 'font-lock-defaults)
-   '((smbclient-font-lock-keywords)))
-
-  (make-local-variable 'comint-prompt-regexp)
   (setq comint-prompt-regexp smbclient-prompt-regexp)
-
-  (make-local-variable 'comint-input-autoexpand)
   (setq comint-input-autoexpand t)
-
-  ;; Already buffer local!
-  (setq comint-output-filter-functions
-       (list 'comint-watch-for-password-prompt))
-
-  (setq local-abbrev-table smbclient-mode-abbrev-table)
-  (abbrev-mode t)
-  )
-
-(define-abbrev smbclient-mode-abbrev-table "q"    "quit")
+  ;; Only add the password-prompting hook if it's not already in the
+  ;; global hook list.  This stands a small chance of losing, if it's
+  ;; later removed from the global list (very small, since any
+  ;; password prompts will probably immediately follow the initial
+  ;; connection), but it's better than getting prompted twice for the
+  ;; same password.
+  (unless (memq 'comint-watch-for-password-prompt
+               (default-value 'comint-output-filter-functions))
+    (add-hook 'comint-output-filter-functions 'comint-watch-for-password-prompt
+             nil t)))
 
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -630,7 +569,7 @@ If your system's ping continues until interrupted, you can try setting
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 ;; Full list is available at:
-;; ftp://ftp.isi.edu/in-notes/iana/assignments/port-numbers
+;; http://www.iana.org/assignments/port-numbers
 (defvar network-connection-service-alist
   (list
     (cons 'echo          7)
@@ -654,18 +593,15 @@ If your system's ping continues until interrupted, you can try setting
     (cons 'netbios-data 139)
     (cons 'irc         194)
     (cons 'https       443)
-    (cons 'rlogin      513)
-    )
+    (cons 'rlogin      513))
   "Alist of services and associated TCP port numbers.
-This list in not complete.")
+This list is not complete.")
 
 ;; Workhorse macro
 (defmacro run-network-program (process-name host port
                                            &optional initial-string)
-  `
-   (let ((tcp-connection)
-        (buf)
-        )
+  `(let ((tcp-connection)
+        (buf))
     (setq buf (get-buffer-create (concat "*" ,process-name "*")))
     (set-buffer buf)
     (or
@@ -674,8 +610,7 @@ This list in not complete.")
            ,process-name
            buf
            ,host
-           ,port
-           ))
+           ,port))
      (error "Could not open connection to %s" ,host))
     (erase-buffer)
     (set-marker (process-mark tcp-connection) (point-min))
@@ -720,10 +655,11 @@ queries of the form USER@HOST, and wants a query containing USER only."
         (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))
+    (and regexps
+        (while (not (string-match (car regexps) host))
+          (setq regexps (cdr regexps)))
+        (when regexps
+          (setq user-and-host user)))
     (run-network-program
      process-name
      host
@@ -733,8 +669,7 @@ queries of the form USER@HOST, and wants a query containing USER only."
 (defcustom whois-server-name "rs.internic.net"
   "Default host name for the whois service."
   :group 'net-utils
-  :type  'string
-  )
+  :type  'string)
 
 (defcustom whois-server-list
   '(("whois.arin.net")     ; Networks, ASN's, and related POC's (numbers)
@@ -809,14 +744,12 @@ from SEARCH-STRING.  With argument, prompt for whois server."
      "Whois"
      host
      (cdr (assoc 'whois network-connection-service-alist))
-     search-string
-     )))
+     search-string)))
 
 (defcustom whois-reverse-lookup-server "whois.arin.net"
   "Server which provides inverse DNS mapping."
   :group 'net-utils
-  :type  'string
-  )
+  :type  'string)
 
 ;;;###autoload
 (defun whois-reverse-lookup ()
@@ -831,25 +764,13 @@ from SEARCH-STRING.  With argument, prompt for whois server."
 ;; Using a derived mode gives us keymaps, hooks, etc.
 (define-derived-mode
   network-connection-mode comint-mode "Network-Connection"
-  "Major mode for interacting with the network-connection program."
-  )
+  "Major mode for interacting with the network-connection program.")
 
 (defun network-connection-mode-setup (host service)
-  (let ((network-abbrev-table
-        (or
-         (assoc service network-connection-service-abbrev-alist)
-        (and (rassoc service network-connection-service-alist)
-             (assoc
-              (elt (rassoc service network-connection-service-alist) 0)
-              network-connection-service-abbrev-alist)))))
-    (make-local-variable 'network-connection-host)
-    (setq network-connection-host host)
-    (make-local-variable 'network-connection-service)
-    (setq network-connection-service service)
-    (and network-abbrev-table
-        (setq local-abbrev-table (cdr network-abbrev-table))
-        (abbrev-mode t)
-        )))
+  (make-local-variable 'network-connection-host)
+  (setq network-connection-host host)
+  (make-local-variable 'network-connection-service)
+  (setq network-connection-service service))
 
 ;;;###autoload
 (defun network-connection-to-service (host service)
@@ -865,8 +786,7 @@ from SEARCH-STRING.  With argument, prompt for whois server."
                      network-connection-service-alist))))
   (network-connection
    host
-   (cdr (assoc (intern service) network-connection-service-alist)))
-  )
+   (cdr (assoc (intern service) network-connection-service-alist))))
 
 ;;;###autoload
 (defun network-connection (host port)
@@ -877,11 +797,9 @@ from SEARCH-STRING.  With argument, prompt for whois server."
 (defun network-service-connection (host service)
   "Open a network connection to SERVICE on HOST."
   (require 'comint)
-  (let* (
-       (process-name (concat "Network Connection [" host " " service "]"))
-       (portnum (string-to-number service))
-       (buf (get-buffer-create (concat "*" process-name "*")))
-       )
+  (let* ((process-name (concat "Network Connection [" host " " service "]"))
+        (portnum (string-to-number service))
+        (buf (get-buffer-create (concat "*" process-name "*"))))
     (or (zerop portnum) (setq service portnum))
     (make-comint
      process-name
@@ -889,8 +807,7 @@ from SEARCH-STRING.  With argument, prompt for whois server."
     (set-buffer buf)
     (network-connection-mode)
     (network-connection-mode-setup host service)
-    (pop-to-buffer buf)
-    ))
+    (pop-to-buffer buf)))
 
 (defun network-connection-reconnect  ()
   "Reconnect a network connection, preserving the old input ring."
@@ -898,21 +815,20 @@ from SEARCH-STRING.  With argument, prompt for whois server."
   (let ((proc (get-buffer-process (current-buffer)))
        (old-comint-input-ring comint-input-ring)
        (host network-connection-host)
-       (service network-connection-service)
-       )
+       (service network-connection-service))
     (if (not (or (not proc)
                 (eq (process-status proc) 'closed)))
        (message "Still connected")
       (goto-char (point-max))
       (insert (format "Reopening connection to %s\n" host))
       (network-connection host
-       (if (numberp service)
-          service
-        (cdr (assoc service network-connection-service-alist))))
+                         (if (numberp service)
+                             service
+                           (cdr (assoc service network-connection-service-alist))))
       (and old-comint-input-ring
-          (setq comint-input-ring old-comint-input-ring))
-      )))
+          (setq comint-input-ring old-comint-input-ring)))))
 
 (provide 'net-utils)
 
+;;; arch-tag: 97119e91-9edb-4376-838b-bf7058fa1314
 ;;; net-utils.el ends here