diff options
| author | Pavel Janík | 2002-01-06 15:11:24 +0000 |
|---|---|---|
| committer | Pavel Janík | 2002-01-06 15:11:24 +0000 |
| commit | c2e6c8d1c3ce1667527b3805584c810b93aec1b9 (patch) | |
| tree | 2cf8d1765f6b655423501f1db91a9fa8175a4625 | |
| parent | aed3fbc3874448cbc20d0d0b884174ace026564e (diff) | |
| download | emacs-c2e6c8d1c3ce1667527b3805584c810b93aec1b9.tar.gz emacs-c2e6c8d1c3ce1667527b3805584c810b93aec1b9.zip | |
(nslookup-font-lock-keywords): Defvar font-lock variables to prevent
warning from byte-compiler.
Add Keyword to actually get listed in finder.
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/net/net-utils.el | 183 |
2 files changed, 72 insertions, 117 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7b55a7eb46b..7742823155e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,11 @@ | |||
| 1 | 2002-01-06 Pavel Jan,Bm(Bk <Pavel@Janik.cz> | 1 | 2002-01-06 Pavel Jan,Bm(Bk <Pavel@Janik.cz> |
| 2 | 2 | ||
| 3 | * net/net-utils.el (nslookup-font-lock-keywords): Defvar font-lock | ||
| 4 | variables to prevent warning from byte-compiler. | ||
| 5 | |||
| 6 | * net/eudc.el (top-level): Use eudc-xemacs-p instead of | ||
| 7 | string-match on emacs-version again. | ||
| 8 | |||
| 3 | * enriched.el (enriched-make-annotation): Fix the change from | 9 | * enriched.el (enriched-make-annotation): Fix the change from |
| 4 | 2002-01-05. | 10 | 2002-01-05. |
| 5 | (enriched-handle-display-prop): Return proper values. | 11 | (enriched-handle-display-prop): Return proper values. |
diff --git a/lisp/net/net-utils.el b/lisp/net/net-utils.el index 497b74df32a..baff8283928 100644 --- a/lisp/net/net-utils.el +++ b/lisp/net/net-utils.el | |||
| @@ -4,8 +4,7 @@ | |||
| 4 | 4 | ||
| 5 | ;; Author: Peter Breton <pbreton@cs.umb.edu> | 5 | ;; Author: Peter Breton <pbreton@cs.umb.edu> |
| 6 | ;; Created: Sun Mar 16 1997 | 6 | ;; Created: Sun Mar 16 1997 |
| 7 | ;; Keywords: network communications | 7 | ;; Keywords: network comm |
| 8 | ;; Time-stamp: <2001-12-25 11:44:47 pavel> | ||
| 9 | 8 | ||
| 10 | ;; This file is part of GNU Emacs. | 9 | ;; This file is part of GNU Emacs. |
| 11 | 10 | ||
| @@ -25,6 +24,7 @@ | |||
| 25 | ;; Boston, MA 02111-1307, USA. | 24 | ;; Boston, MA 02111-1307, USA. |
| 26 | 25 | ||
| 27 | ;;; Commentary: | 26 | ;;; Commentary: |
| 27 | |||
| 28 | ;; | 28 | ;; |
| 29 | ;; There are three main areas of functionality: | 29 | ;; There are three main areas of functionality: |
| 30 | ;; | 30 | ;; |
| @@ -56,15 +56,13 @@ | |||
| 56 | "Network utility functions." | 56 | "Network utility functions." |
| 57 | :prefix "net-utils-" | 57 | :prefix "net-utils-" |
| 58 | :group 'comm | 58 | :group 'comm |
| 59 | :version "20.3" | 59 | :version "20.3") |
| 60 | ) | ||
| 61 | 60 | ||
| 62 | (defcustom net-utils-remove-ctl-m | 61 | (defcustom net-utils-remove-ctl-m |
| 63 | (member system-type (list 'windows-nt 'msdos)) | 62 | (member system-type (list 'windows-nt 'msdos)) |
| 64 | "If non-nil, remove control-Ms from output." | 63 | "If non-nil, remove control-Ms from output." |
| 65 | :group 'net-utils | 64 | :group 'net-utils |
| 66 | :type 'boolean | 65 | :type 'boolean) |
| 67 | ) | ||
| 68 | 66 | ||
| 69 | (defcustom traceroute-program | 67 | (defcustom traceroute-program |
| 70 | (if (eq system-type 'windows-nt) | 68 | (if (eq system-type 'windows-nt) |
| @@ -72,22 +70,19 @@ | |||
| 72 | "traceroute") | 70 | "traceroute") |
| 73 | "Program to trace network hops to a destination." | 71 | "Program to trace network hops to a destination." |
| 74 | :group 'net-utils | 72 | :group 'net-utils |
| 75 | :type 'string | 73 | :type 'string) |
| 76 | ) | ||
| 77 | 74 | ||
| 78 | (defcustom traceroute-program-options nil | 75 | (defcustom traceroute-program-options nil |
| 79 | "Options for the traceroute program." | 76 | "Options for the traceroute program." |
| 80 | :group 'net-utils | 77 | :group 'net-utils |
| 81 | :type '(repeat string) | 78 | :type '(repeat string)) |
| 82 | ) | ||
| 83 | 79 | ||
| 84 | (defcustom ping-program "ping" | 80 | (defcustom ping-program "ping" |
| 85 | "Program to send network test packets to a host." | 81 | "Program to send network test packets to a host." |
| 86 | :group 'net-utils | 82 | :group 'net-utils |
| 87 | :type 'string | 83 | :type 'string) |
| 88 | ) | ||
| 89 | 84 | ||
| 90 | ;; On Linux and Irix, the system's ping program seems to send packets | 85 | ;; On GNU/Linux and Irix, the system's ping program seems to send packets |
| 91 | ;; indefinitely unless told otherwise | 86 | ;; indefinitely unless told otherwise |
| 92 | (defcustom ping-program-options | 87 | (defcustom ping-program-options |
| 93 | (and (memq system-type (list 'linux 'gnu/linux 'irix)) | 88 | (and (memq system-type (list 'linux 'gnu/linux 'irix)) |
| @@ -95,8 +90,7 @@ | |||
| 95 | "Options for the ping program. | 90 | "Options for the ping program. |
| 96 | These options can be used to limit how many ICMP packets are emitted." | 91 | These options can be used to limit how many ICMP packets are emitted." |
| 97 | :group 'net-utils | 92 | :group 'net-utils |
| 98 | :type '(repeat string) | 93 | :type '(repeat string)) |
| 99 | ) | ||
| 100 | 94 | ||
| 101 | (defcustom ipconfig-program | 95 | (defcustom ipconfig-program |
| 102 | (if (eq system-type 'windows-nt) | 96 | (if (eq system-type 'windows-nt) |
| @@ -104,43 +98,37 @@ These options can be used to limit how many ICMP packets are emitted." | |||
| 104 | "ifconfig") | 98 | "ifconfig") |
| 105 | "Program to print network configuration information." | 99 | "Program to print network configuration information." |
| 106 | :group 'net-utils | 100 | :group 'net-utils |
| 107 | :type 'string | 101 | :type 'string) |
| 108 | ) | ||
| 109 | 102 | ||
| 110 | (defcustom ipconfig-program-options | 103 | (defcustom ipconfig-program-options |
| 111 | (list | 104 | (list |
| 112 | (if (eq system-type 'windows-nt) | 105 | (if (eq system-type 'windows-nt) |
| 113 | "/all" "-a")) | 106 | "/all" "-a")) |
| 114 | "Options for ipconfig-program." | 107 | "Options for ipconfig-program." |
| 115 | :group 'net-utils | 108 | :group 'net-utils |
| 116 | :type '(repeat string) | 109 | :type '(repeat string)) |
| 117 | ) | ||
| 118 | 110 | ||
| 119 | (defcustom netstat-program "netstat" | 111 | (defcustom netstat-program "netstat" |
| 120 | "Program to print network statistics." | 112 | "Program to print network statistics." |
| 121 | :group 'net-utils | 113 | :group 'net-utils |
| 122 | :type 'string | 114 | :type 'string) |
| 123 | ) | ||
| 124 | 115 | ||
| 125 | (defcustom netstat-program-options | 116 | (defcustom netstat-program-options |
| 126 | (list "-a") | 117 | (list "-a") |
| 127 | "Options for netstat-program." | 118 | "Options for netstat-program." |
| 128 | :group 'net-utils | 119 | :group 'net-utils |
| 129 | :type '(repeat string) | 120 | :type '(repeat string)) |
| 130 | ) | ||
| 131 | 121 | ||
| 132 | (defcustom arp-program "arp" | 122 | (defcustom arp-program "arp" |
| 133 | "Program to print IP to address translation tables." | 123 | "Program to print IP to address translation tables." |
| 134 | :group 'net-utils | 124 | :group 'net-utils |
| 135 | :type 'string | 125 | :type 'string) |
| 136 | ) | ||
| 137 | 126 | ||
| 138 | (defcustom arp-program-options | 127 | (defcustom arp-program-options |
| 139 | (list "-a") | 128 | (list "-a") |
| 140 | "Options for arp-program." | 129 | "Options for arp-program." |
| 141 | :group 'net-utils | 130 | :group 'net-utils |
| 142 | :type '(repeat string) | 131 | :type '(repeat string)) |
| 143 | ) | ||
| 144 | 132 | ||
| 145 | (defcustom route-program | 133 | (defcustom route-program |
| 146 | (if (eq system-type 'windows-nt) | 134 | (if (eq system-type 'windows-nt) |
| @@ -148,8 +136,7 @@ These options can be used to limit how many ICMP packets are emitted." | |||
| 148 | "netstat") | 136 | "netstat") |
| 149 | "Program to print routing tables." | 137 | "Program to print routing tables." |
| 150 | :group 'net-utils | 138 | :group 'net-utils |
| 151 | :type 'string | 139 | :type 'string) |
| 152 | ) | ||
| 153 | 140 | ||
| 154 | (defcustom route-program-options | 141 | (defcustom route-program-options |
| 155 | (if (eq system-type 'windows-nt) | 142 | (if (eq system-type 'windows-nt) |
| @@ -157,20 +144,17 @@ These options can be used to limit how many ICMP packets are emitted." | |||
| 157 | (list "-r")) | 144 | (list "-r")) |
| 158 | "Options for route-program." | 145 | "Options for route-program." |
| 159 | :group 'net-utils | 146 | :group 'net-utils |
| 160 | :type '(repeat string) | 147 | :type '(repeat string)) |
| 161 | ) | ||
| 162 | 148 | ||
| 163 | (defcustom nslookup-program "nslookup" | 149 | (defcustom nslookup-program "nslookup" |
| 164 | "Program to interactively query DNS information." | 150 | "Program to interactively query DNS information." |
| 165 | :group 'net-utils | 151 | :group 'net-utils |
| 166 | :type 'string | 152 | :type 'string) |
| 167 | ) | ||
| 168 | 153 | ||
| 169 | (defcustom nslookup-program-options nil | 154 | (defcustom nslookup-program-options nil |
| 170 | "List of options to pass to the nslookup program." | 155 | "List of options to pass to the nslookup program." |
| 171 | :group 'net-utils | 156 | :group 'net-utils |
| 172 | :type '(repeat string) | 157 | :type '(repeat string)) |
| 173 | ) | ||
| 174 | 158 | ||
| 175 | (defcustom nslookup-prompt-regexp "^> " | 159 | (defcustom nslookup-prompt-regexp "^> " |
| 176 | "Regexp to match the nslookup prompt. | 160 | "Regexp to match the nslookup prompt. |
| @@ -178,26 +162,22 @@ These options can be used to limit how many ICMP packets are emitted." | |||
| 178 | This variable is only used if the variable | 162 | This variable is only used if the variable |
| 179 | `comint-use-prompt-regexp-instead-of-fields' is non-nil." | 163 | `comint-use-prompt-regexp-instead-of-fields' is non-nil." |
| 180 | :group 'net-utils | 164 | :group 'net-utils |
| 181 | :type 'regexp | 165 | :type 'regexp) |
| 182 | ) | ||
| 183 | 166 | ||
| 184 | (defcustom dig-program "dig" | 167 | (defcustom dig-program "dig" |
| 185 | "Program to query DNS information." | 168 | "Program to query DNS information." |
| 186 | :group 'net-utils | 169 | :group 'net-utils |
| 187 | :type 'string | 170 | :type 'string) |
| 188 | ) | ||
| 189 | 171 | ||
| 190 | (defcustom ftp-program "ftp" | 172 | (defcustom ftp-program "ftp" |
| 191 | "Progam to run to do FTP transfers." | 173 | "Progam to run to do FTP transfers." |
| 192 | :group 'net-utils | 174 | :group 'net-utils |
| 193 | :type 'string | 175 | :type 'string) |
| 194 | ) | ||
| 195 | 176 | ||
| 196 | (defcustom ftp-program-options nil | 177 | (defcustom ftp-program-options nil |
| 197 | "List of options to pass to the FTP program." | 178 | "List of options to pass to the FTP program." |
| 198 | :group 'net-utils | 179 | :group 'net-utils |
| 199 | :type '(repeat string) | 180 | :type '(repeat string)) |
| 200 | ) | ||
| 201 | 181 | ||
| 202 | (defcustom ftp-prompt-regexp "^ftp>" | 182 | (defcustom ftp-prompt-regexp "^ftp>" |
| 203 | "Regexp which matches the FTP program's prompt. | 183 | "Regexp which matches the FTP program's prompt. |
| @@ -205,20 +185,17 @@ This variable is only used if the variable | |||
| 205 | This variable is only used if the variable | 185 | This variable is only used if the variable |
| 206 | `comint-use-prompt-regexp-instead-of-fields' is non-nil." | 186 | `comint-use-prompt-regexp-instead-of-fields' is non-nil." |
| 207 | :group 'net-utils | 187 | :group 'net-utils |
| 208 | :type 'regexp | 188 | :type 'regexp) |
| 209 | ) | ||
| 210 | 189 | ||
| 211 | (defcustom smbclient-program "smbclient" | 190 | (defcustom smbclient-program "smbclient" |
| 212 | "Smbclient program." | 191 | "Smbclient program." |
| 213 | :group 'net-utils | 192 | :group 'net-utils |
| 214 | :type 'string | 193 | :type 'string) |
| 215 | ) | ||
| 216 | 194 | ||
| 217 | (defcustom smbclient-program-options nil | 195 | (defcustom smbclient-program-options nil |
| 218 | "List of options to pass to the smbclient program." | 196 | "List of options to pass to the smbclient program." |
| 219 | :group 'net-utils | 197 | :group 'net-utils |
| 220 | :type '(repeat string) | 198 | :type '(repeat string)) |
| 221 | ) | ||
| 222 | 199 | ||
| 223 | (defcustom smbclient-prompt-regexp "^smb: \>" | 200 | (defcustom smbclient-prompt-regexp "^smb: \>" |
| 224 | "Regexp which matches the smbclient program's prompt. | 201 | "Regexp which matches the smbclient program's prompt. |
| @@ -226,8 +203,7 @@ This variable is only used if the variable | |||
| 226 | This variable is only used if the variable | 203 | This variable is only used if the variable |
| 227 | `comint-use-prompt-regexp-instead-of-fields' is non-nil." | 204 | `comint-use-prompt-regexp-instead-of-fields' is non-nil." |
| 228 | :group 'net-utils | 205 | :group 'net-utils |
| 229 | :type 'regexp | 206 | :type 'regexp) |
| 230 | ) | ||
| 231 | 207 | ||
| 232 | ;; Internal variables | 208 | ;; Internal variables |
| 233 | (defvar network-connection-service nil) | 209 | (defvar network-connection-service nil) |
| @@ -239,6 +215,9 @@ This variable is only used if the variable | |||
| 239 | 215 | ||
| 240 | (defconst nslookup-font-lock-keywords | 216 | (defconst nslookup-font-lock-keywords |
| 241 | (progn | 217 | (progn |
| 218 | (defvar font-lock-type-face) | ||
| 219 | (defvar font-lock-keyword-face) | ||
| 220 | (defvar font-lock-variable-name-face) | ||
| 242 | (require 'font-lock) | 221 | (require 'font-lock) |
| 243 | (list | 222 | (list |
| 244 | (list "^[A-Za-z0-9 _]+:" 0 font-lock-type-face) | 223 | (list "^[A-Za-z0-9 _]+:" 0 font-lock-type-face) |
| @@ -257,10 +236,8 @@ This variable is only used if the variable | |||
| 257 | (mapconcat 'identity | 236 | (mapconcat 'identity |
| 258 | (make-list 2 host-expression) | 237 | (make-list 2 host-expression) |
| 259 | "\\.") | 238 | "\\.") |
| 260 | "\\(\\." host-expression "\\)*") | 239 | "\\(\\." host-expression "\\)*")) |
| 261 | ) | 240 | 0 font-lock-variable-name-face))) |
| 262 | 0 font-lock-variable-name-face) | ||
| 263 | )) | ||
| 264 | "Expressions to font-lock for nslookup.") | 241 | "Expressions to font-lock for nslookup.") |
| 265 | 242 | ||
| 266 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 243 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| @@ -342,8 +319,7 @@ This variable is only used if the variable | |||
| 342 | (concat "Traceroute" " " target) | 319 | (concat "Traceroute" " " target) |
| 343 | (concat "** Traceroute ** " traceroute-program " ** " target) | 320 | (concat "** Traceroute ** " traceroute-program " ** " target) |
| 344 | traceroute-program | 321 | traceroute-program |
| 345 | options | 322 | options))) |
| 346 | ))) | ||
| 347 | 323 | ||
| 348 | ;;;###autoload | 324 | ;;;###autoload |
| 349 | (defun ping (host) | 325 | (defun ping (host) |
| @@ -360,8 +336,7 @@ If your system's ping continues until interrupted, you can try setting | |||
| 360 | (concat "Ping" " " host) | 336 | (concat "Ping" " " host) |
| 361 | (concat "** Ping ** " ping-program " ** " host) | 337 | (concat "** Ping ** " ping-program " ** " host) |
| 362 | ping-program | 338 | ping-program |
| 363 | options | 339 | options))) |
| 364 | ))) | ||
| 365 | 340 | ||
| 366 | ;;;###autoload | 341 | ;;;###autoload |
| 367 | (defun ipconfig () | 342 | (defun ipconfig () |
| @@ -371,8 +346,7 @@ If your system's ping continues until interrupted, you can try setting | |||
| 371 | "Ipconfig" | 346 | "Ipconfig" |
| 372 | (concat "** Ipconfig ** " ipconfig-program " ** ") | 347 | (concat "** Ipconfig ** " ipconfig-program " ** ") |
| 373 | ipconfig-program | 348 | ipconfig-program |
| 374 | ipconfig-program-options | 349 | ipconfig-program-options)) |
| 375 | )) | ||
| 376 | 350 | ||
| 377 | ;; This is the normal name on most Unixes. | 351 | ;; This is the normal name on most Unixes. |
| 378 | ;;;###autoload | 352 | ;;;###autoload |
| @@ -386,8 +360,7 @@ If your system's ping continues until interrupted, you can try setting | |||
| 386 | "Netstat" | 360 | "Netstat" |
| 387 | (concat "** Netstat ** " netstat-program " ** ") | 361 | (concat "** Netstat ** " netstat-program " ** ") |
| 388 | netstat-program | 362 | netstat-program |
| 389 | netstat-program-options | 363 | netstat-program-options)) |
| 390 | )) | ||
| 391 | 364 | ||
| 392 | ;;;###autoload | 365 | ;;;###autoload |
| 393 | (defun arp () | 366 | (defun arp () |
| @@ -397,8 +370,7 @@ If your system's ping continues until interrupted, you can try setting | |||
| 397 | "Arp" | 370 | "Arp" |
| 398 | (concat "** Arp ** " arp-program " ** ") | 371 | (concat "** Arp ** " arp-program " ** ") |
| 399 | arp-program | 372 | arp-program |
| 400 | arp-program-options | 373 | arp-program-options)) |
| 401 | )) | ||
| 402 | 374 | ||
| 403 | ;;;###autoload | 375 | ;;;###autoload |
| 404 | (defun route () | 376 | (defun route () |
| @@ -408,8 +380,7 @@ If your system's ping continues until interrupted, you can try setting | |||
| 408 | "Route" | 380 | "Route" |
| 409 | (concat "** Route ** " route-program " ** ") | 381 | (concat "** Route ** " route-program " ** ") |
| 410 | route-program | 382 | route-program |
| 411 | route-program-options | 383 | route-program-options)) |
| 412 | )) | ||
| 413 | 384 | ||
| 414 | ;; FIXME -- Needs to be a process filter | 385 | ;; FIXME -- Needs to be a process filter |
| 415 | ;; (defun netstat-with-filter (filter) | 386 | ;; (defun netstat-with-filter (filter) |
| @@ -418,8 +389,7 @@ If your system's ping continues until interrupted, you can try setting | |||
| 418 | ;; (netstat) | 389 | ;; (netstat) |
| 419 | ;; (set-buffer (get-buffer "*Netstat*")) | 390 | ;; (set-buffer (get-buffer "*Netstat*")) |
| 420 | ;; (goto-char (point-min)) | 391 | ;; (goto-char (point-min)) |
| 421 | ;; (delete-matching-lines filter) | 392 | ;; (delete-matching-lines filter)) |
| 422 | ;; ) | ||
| 423 | 393 | ||
| 424 | ;;;###autoload | 394 | ;;;###autoload |
| 425 | (defun nslookup-host (host) | 395 | (defun nslookup-host (host) |
| @@ -437,9 +407,7 @@ If your system's ping continues until interrupted, you can try setting | |||
| 437 | (list "Nslookup" host nslookup-program) | 407 | (list "Nslookup" host nslookup-program) |
| 438 | " ** ")) | 408 | " ** ")) |
| 439 | nslookup-program | 409 | nslookup-program |
| 440 | options | 410 | options))) |
| 441 | ))) | ||
| 442 | |||
| 443 | 411 | ||
| 444 | ;;;###autoload | 412 | ;;;###autoload |
| 445 | (defun nslookup () | 413 | (defun nslookup () |
| @@ -447,8 +415,7 @@ If your system's ping continues until interrupted, you can try setting | |||
| 447 | (interactive) | 415 | (interactive) |
| 448 | (require 'comint) | 416 | (require 'comint) |
| 449 | (comint-run nslookup-program) | 417 | (comint-run nslookup-program) |
| 450 | (nslookup-mode) | 418 | (nslookup-mode)) |
| 451 | ) | ||
| 452 | 419 | ||
| 453 | ;; Using a derived mode gives us keymaps, hooks, etc. | 420 | ;; Using a derived mode gives us keymaps, hooks, etc. |
| 454 | (define-derived-mode nslookup-mode comint-mode "Nslookup" | 421 | (define-derived-mode nslookup-mode comint-mode "Nslookup" |
| @@ -457,8 +424,7 @@ If your system's ping continues until interrupted, you can try setting | |||
| 457 | (make-local-variable 'font-lock-defaults) | 424 | (make-local-variable 'font-lock-defaults) |
| 458 | '((nslookup-font-lock-keywords))) | 425 | '((nslookup-font-lock-keywords))) |
| 459 | (setq comint-prompt-regexp nslookup-prompt-regexp) | 426 | (setq comint-prompt-regexp nslookup-prompt-regexp) |
| 460 | (setq comint-input-autoexpand t) | 427 | (setq comint-input-autoexpand t)) |
| 461 | ) | ||
| 462 | 428 | ||
| 463 | (define-key nslookup-mode-map "\t" 'comint-dynamic-complete) | 429 | (define-key nslookup-mode-map "\t" 'comint-dynamic-complete) |
| 464 | 430 | ||
| @@ -479,8 +445,7 @@ If your system's ping continues until interrupted, you can try setting | |||
| 479 | (list "Dig" host dig-program) | 445 | (list "Dig" host dig-program) |
| 480 | " ** ")) | 446 | " ** ")) |
| 481 | dig-program | 447 | dig-program |
| 482 | (list host) | 448 | (list host))) |
| 483 | )) | ||
| 484 | 449 | ||
| 485 | ;; This is a lot less than ange-ftp, but much simpler. | 450 | ;; This is a lot less than ange-ftp, but much simpler. |
| 486 | ;;;###autoload | 451 | ;;;###autoload |
| @@ -513,8 +478,7 @@ If your system's ping continues until interrupted, you can try setting | |||
| 513 | (unless (memq 'comint-watch-for-password-prompt | 478 | (unless (memq 'comint-watch-for-password-prompt |
| 514 | (default-value 'comint-output-filter-functions)) | 479 | (default-value 'comint-output-filter-functions)) |
| 515 | (add-hook 'comint-output-filter-functions 'comint-watch-for-password-prompt | 480 | (add-hook 'comint-output-filter-functions 'comint-watch-for-password-prompt |
| 516 | nil t)) | 481 | nil t))) |
| 517 | ) | ||
| 518 | 482 | ||
| 519 | ;; Occasionally useful | 483 | ;; Occasionally useful |
| 520 | (define-key ftp-mode-map "\t" 'comint-dynamic-complete) | 484 | (define-key ftp-mode-map "\t" 'comint-dynamic-complete) |
| @@ -543,8 +507,7 @@ If your system's ping continues until interrupted, you can try setting | |||
| 543 | (interactive | 507 | (interactive |
| 544 | (list | 508 | (list |
| 545 | (read-from-minibuffer | 509 | (read-from-minibuffer |
| 546 | "Connect to Host: " (net-utils-machine-at-point)) | 510 | "Connect to Host: " (net-utils-machine-at-point)))) |
| 547 | )) | ||
| 548 | (let ((buf (get-buffer-create (format "*SMB Shares on %s*" host)))) | 511 | (let ((buf (get-buffer-create (format "*SMB Shares on %s*" host)))) |
| 549 | (set-buffer buf) | 512 | (set-buffer buf) |
| 550 | (smbclient-mode) | 513 | (smbclient-mode) |
| @@ -565,8 +528,7 @@ If your system's ping continues until interrupted, you can try setting | |||
| 565 | (unless (memq 'comint-watch-for-password-prompt | 528 | (unless (memq 'comint-watch-for-password-prompt |
| 566 | (default-value 'comint-output-filter-functions)) | 529 | (default-value 'comint-output-filter-functions)) |
| 567 | (add-hook 'comint-output-filter-functions 'comint-watch-for-password-prompt | 530 | (add-hook 'comint-output-filter-functions 'comint-watch-for-password-prompt |
| 568 | nil t)) | 531 | nil t))) |
| 569 | ) | ||
| 570 | 532 | ||
| 571 | 533 | ||
| 572 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 534 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| @@ -598,8 +560,7 @@ If your system's ping continues until interrupted, you can try setting | |||
| 598 | (cons 'netbios-data 139) | 560 | (cons 'netbios-data 139) |
| 599 | (cons 'irc 194) | 561 | (cons 'irc 194) |
| 600 | (cons 'https 443) | 562 | (cons 'https 443) |
| 601 | (cons 'rlogin 513) | 563 | (cons 'rlogin 513)) |
| 602 | ) | ||
| 603 | "Alist of services and associated TCP port numbers. | 564 | "Alist of services and associated TCP port numbers. |
| 604 | This list is not complete.") | 565 | This list is not complete.") |
| 605 | 566 | ||
| @@ -607,8 +568,7 @@ This list is not complete.") | |||
| 607 | (defmacro run-network-program (process-name host port | 568 | (defmacro run-network-program (process-name host port |
| 608 | &optional initial-string) | 569 | &optional initial-string) |
| 609 | `(let ((tcp-connection) | 570 | `(let ((tcp-connection) |
| 610 | (buf) | 571 | (buf)) |
| 611 | ) | ||
| 612 | (setq buf (get-buffer-create (concat "*" ,process-name "*"))) | 572 | (setq buf (get-buffer-create (concat "*" ,process-name "*"))) |
| 613 | (set-buffer buf) | 573 | (set-buffer buf) |
| 614 | (or | 574 | (or |
| @@ -617,8 +577,7 @@ This list is not complete.") | |||
| 617 | ,process-name | 577 | ,process-name |
| 618 | buf | 578 | buf |
| 619 | ,host | 579 | ,host |
| 620 | ,port | 580 | ,port)) |
| 621 | )) | ||
| 622 | (error "Could not open connection to %s" ,host)) | 581 | (error "Could not open connection to %s" ,host)) |
| 623 | (erase-buffer) | 582 | (erase-buffer) |
| 624 | (set-marker (process-mark tcp-connection) (point-min)) | 583 | (set-marker (process-mark tcp-connection) (point-min)) |
| @@ -676,8 +635,7 @@ queries of the form USER@HOST, and wants a query containing USER only." | |||
| 676 | (defcustom whois-server-name "rs.internic.net" | 635 | (defcustom whois-server-name "rs.internic.net" |
| 677 | "Default host name for the whois service." | 636 | "Default host name for the whois service." |
| 678 | :group 'net-utils | 637 | :group 'net-utils |
| 679 | :type 'string | 638 | :type 'string) |
| 680 | ) | ||
| 681 | 639 | ||
| 682 | (defcustom whois-server-list | 640 | (defcustom whois-server-list |
| 683 | '(("whois.arin.net") ; Networks, ASN's, and related POC's (numbers) | 641 | '(("whois.arin.net") ; Networks, ASN's, and related POC's (numbers) |
| @@ -752,14 +710,12 @@ from SEARCH-STRING. With argument, prompt for whois server." | |||
| 752 | "Whois" | 710 | "Whois" |
| 753 | host | 711 | host |
| 754 | (cdr (assoc 'whois network-connection-service-alist)) | 712 | (cdr (assoc 'whois network-connection-service-alist)) |
| 755 | search-string | 713 | search-string))) |
| 756 | ))) | ||
| 757 | 714 | ||
| 758 | (defcustom whois-reverse-lookup-server "whois.arin.net" | 715 | (defcustom whois-reverse-lookup-server "whois.arin.net" |
| 759 | "Server which provides inverse DNS mapping." | 716 | "Server which provides inverse DNS mapping." |
| 760 | :group 'net-utils | 717 | :group 'net-utils |
| 761 | :type 'string | 718 | :type 'string) |
| 762 | ) | ||
| 763 | 719 | ||
| 764 | ;;;###autoload | 720 | ;;;###autoload |
| 765 | (defun whois-reverse-lookup () | 721 | (defun whois-reverse-lookup () |
| @@ -774,8 +730,7 @@ from SEARCH-STRING. With argument, prompt for whois server." | |||
| 774 | ;; Using a derived mode gives us keymaps, hooks, etc. | 730 | ;; Using a derived mode gives us keymaps, hooks, etc. |
| 775 | (define-derived-mode | 731 | (define-derived-mode |
| 776 | network-connection-mode comint-mode "Network-Connection" | 732 | network-connection-mode comint-mode "Network-Connection" |
| 777 | "Major mode for interacting with the network-connection program." | 733 | "Major mode for interacting with the network-connection program.") |
| 778 | ) | ||
| 779 | 734 | ||
| 780 | (defun network-connection-mode-setup (host service) | 735 | (defun network-connection-mode-setup (host service) |
| 781 | (make-local-variable 'network-connection-host) | 736 | (make-local-variable 'network-connection-host) |
| @@ -797,8 +752,7 @@ from SEARCH-STRING. With argument, prompt for whois server." | |||
| 797 | network-connection-service-alist)))) | 752 | network-connection-service-alist)))) |
| 798 | (network-connection | 753 | (network-connection |
| 799 | host | 754 | host |
| 800 | (cdr (assoc (intern service) network-connection-service-alist))) | 755 | (cdr (assoc (intern service) network-connection-service-alist)))) |
| 801 | ) | ||
| 802 | 756 | ||
| 803 | ;;;###autoload | 757 | ;;;###autoload |
| 804 | (defun network-connection (host port) | 758 | (defun network-connection (host port) |
| @@ -809,11 +763,9 @@ from SEARCH-STRING. With argument, prompt for whois server." | |||
| 809 | (defun network-service-connection (host service) | 763 | (defun network-service-connection (host service) |
| 810 | "Open a network connection to SERVICE on HOST." | 764 | "Open a network connection to SERVICE on HOST." |
| 811 | (require 'comint) | 765 | (require 'comint) |
| 812 | (let* ( | 766 | (let* ((process-name (concat "Network Connection [" host " " service "]")) |
| 813 | (process-name (concat "Network Connection [" host " " service "]")) | 767 | (portnum (string-to-number service)) |
| 814 | (portnum (string-to-number service)) | 768 | (buf (get-buffer-create (concat "*" process-name "*")))) |
| 815 | (buf (get-buffer-create (concat "*" process-name "*"))) | ||
| 816 | ) | ||
| 817 | (or (zerop portnum) (setq service portnum)) | 769 | (or (zerop portnum) (setq service portnum)) |
| 818 | (make-comint | 770 | (make-comint |
| 819 | process-name | 771 | process-name |
| @@ -821,8 +773,7 @@ from SEARCH-STRING. With argument, prompt for whois server." | |||
| 821 | (set-buffer buf) | 773 | (set-buffer buf) |
| 822 | (network-connection-mode) | 774 | (network-connection-mode) |
| 823 | (network-connection-mode-setup host service) | 775 | (network-connection-mode-setup host service) |
| 824 | (pop-to-buffer buf) | 776 | (pop-to-buffer buf))) |
| 825 | )) | ||
| 826 | 777 | ||
| 827 | (defun network-connection-reconnect () | 778 | (defun network-connection-reconnect () |
| 828 | "Reconnect a network connection, preserving the old input ring." | 779 | "Reconnect a network connection, preserving the old input ring." |
| @@ -830,20 +781,18 @@ from SEARCH-STRING. With argument, prompt for whois server." | |||
| 830 | (let ((proc (get-buffer-process (current-buffer))) | 781 | (let ((proc (get-buffer-process (current-buffer))) |
| 831 | (old-comint-input-ring comint-input-ring) | 782 | (old-comint-input-ring comint-input-ring) |
| 832 | (host network-connection-host) | 783 | (host network-connection-host) |
| 833 | (service network-connection-service) | 784 | (service network-connection-service)) |
| 834 | ) | ||
| 835 | (if (not (or (not proc) | 785 | (if (not (or (not proc) |
| 836 | (eq (process-status proc) 'closed))) | 786 | (eq (process-status proc) 'closed))) |
| 837 | (message "Still connected") | 787 | (message "Still connected") |
| 838 | (goto-char (point-max)) | 788 | (goto-char (point-max)) |
| 839 | (insert (format "Reopening connection to %s\n" host)) | 789 | (insert (format "Reopening connection to %s\n" host)) |
| 840 | (network-connection host | 790 | (network-connection host |
| 841 | (if (numberp service) | 791 | (if (numberp service) |
| 842 | service | 792 | service |
| 843 | (cdr (assoc service network-connection-service-alist)))) | 793 | (cdr (assoc service network-connection-service-alist)))) |
| 844 | (and old-comint-input-ring | 794 | (and old-comint-input-ring |
| 845 | (setq comint-input-ring old-comint-input-ring)) | 795 | (setq comint-input-ring old-comint-input-ring))))) |
| 846 | ))) | ||
| 847 | 796 | ||
| 848 | (provide 'net-utils) | 797 | (provide 'net-utils) |
| 849 | 798 | ||