aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2008-02-26 04:31:30 +0000
committerGlenn Morris2008-02-26 04:31:30 +0000
commitcbbe9a375e0a3e313d53a77958ddc1f4ad98cd12 (patch)
tree896dabea1896439a6a73e9adf69a9e97c66f3796
parent320d3e682f74dbbe0d52ec7f611eae1baa0e425b (diff)
downloademacs-cbbe9a375e0a3e313d53a77958ddc1f4ad98cd12.tar.gz
emacs-cbbe9a375e0a3e313d53a77958ddc1f4ad98cd12.zip
(top-level): Don't require comint when compiling.
(nslookup-font-lock-keywords): Don't require font-lock. Use font-lock faces rather than variables. (nslookup, ftp, smbclient, network-service-connection): Don't require comint. (comint-prompt-regexp, comint-input-autoexpand) (comint-input-ring): Declare for compiler. (comint-mode, ffap-string-at-point, comint-exec): Autoload. (dns-lookup-host): Don't require ffap. Remove `with-no-warnings'.
-rw-r--r--lisp/ChangeLog15
-rw-r--r--lisp/net/net-utils.el73
2 files changed, 49 insertions, 39 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 5c90c8b98f0..6a220d33136 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,18 @@
12008-02-26 Glenn Morris <rgm@gnu.org>
2
3 * net/net-utils.el (top-level): Don't require comint when compiling.
4 (nslookup-font-lock-keywords): Don't require font-lock.
5 Use font-lock faces rather than variables.
6 (nslookup, ftp, smbclient, network-service-connection):
7 Don't require comint.
8 (comint-prompt-regexp, comint-input-autoexpand)
9 (comint-input-ring): Declare for compiler.
10 (comint-mode, ffap-string-at-point, comint-exec): Autoload.
11 (dns-lookup-host): Don't require ffap. Remove `with-no-warnings'.
12
13 * ibuffer.el (ibuffer-do-toggle-read-only): Don't use `iff' in
14 doc-string.
15
12008-02-26 Stefan Monnier <monnier@iro.umontreal.ca> 162008-02-26 Stefan Monnier <monnier@iro.umontreal.ca>
2 17
3 * doc-view.el (doc-view-current-page): Add a `win' argument. 18 * doc-view.el (doc-view-current-page): Add a `win' argument.
diff --git a/lisp/net/net-utils.el b/lisp/net/net-utils.el
index c01da4fd50b..8492fa2912d 100644
--- a/lisp/net/net-utils.el
+++ b/lisp/net/net-utils.el
@@ -46,8 +46,6 @@
46 46
47 47
48;;; Code: 48;;; Code:
49(eval-when-compile
50 (require 'comint))
51 49
52;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 50;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
53;; Customization Variables 51;; Customization Variables
@@ -244,30 +242,25 @@ This variable is only used if the variable
244;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 242;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
245 243
246(defconst nslookup-font-lock-keywords 244(defconst nslookup-font-lock-keywords
247 (progn 245 (list
248 (defvar font-lock-type-face) 246 (list "^[A-Za-z0-9 _]+:" 0 'font-lock-type-face)
249 (defvar font-lock-keyword-face) 247 (list "\\<\\(SOA\\|NS\\|MX\\|A\\|CNAME\\)\\>"
250 (defvar font-lock-variable-name-face) 248 1 'font-lock-keyword-face)
251 (require 'font-lock) 249 ;; Dotted quads
252 (list 250 (list
253 (list "^[A-Za-z0-9 _]+:" 0 font-lock-type-face) 251 (mapconcat 'identity
254 (list "\\<\\(SOA\\|NS\\|MX\\|A\\|CNAME\\)\\>" 252 (make-list 4 "[0-9]+")
255 1 font-lock-keyword-face) 253 "\\.")
256 ;; Dotted quads 254 0 'font-lock-variable-name-face)
257 (list 255 ;; Host names
258 (mapconcat 'identity 256 (list
259 (make-list 4 "[0-9]+") 257 (let ((host-expression "[-A-Za-z0-9]+"))
260 "\\.") 258 (concat
261 0 font-lock-variable-name-face) 259 (mapconcat 'identity
262 ;; Host names 260 (make-list 2 host-expression)
263 (list 261 "\\.")
264 (let ((host-expression "[-A-Za-z0-9]+")) 262 "\\(\\." host-expression "\\)*"))
265 (concat 263 0 'font-lock-variable-name-face))
266 (mapconcat 'identity
267 (make-list 2 host-expression)
268 "\\.")
269 "\\(\\." host-expression "\\)*"))
270 0 font-lock-variable-name-face)))
271 "Expressions to font-lock for nslookup.") 264 "Expressions to font-lock for nslookup.")
272 265
273;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 266;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -323,7 +316,7 @@ This variable is only used if the variable
323 316
324(defmacro net-utils-run-program (name header program &rest args) 317(defmacro net-utils-run-program (name header program &rest args)
325 "Run a network information program." 318 "Run a network information program."
326 ` (let ((buf (get-buffer-create (concat "*" ,name "*")))) 319 ` (let ((buf (get-buffer-create (concat "*" ,name "*"))))
327 (set-buffer buf) 320 (set-buffer buf)
328 (erase-buffer) 321 (erase-buffer)
329 (insert ,header "\n") 322 (insert ,header "\n")
@@ -453,10 +446,14 @@ If your system's ping continues until interrupted, you can try setting
453(defun nslookup () 446(defun nslookup ()
454 "Run nslookup program." 447 "Run nslookup program."
455 (interactive) 448 (interactive)
456 (require 'comint)
457 (comint-run nslookup-program) 449 (comint-run nslookup-program)
458 (nslookup-mode)) 450 (nslookup-mode))
459 451
452(defvar comint-prompt-regexp)
453(defvar comint-input-autoexpand)
454
455(autoload 'comint-mode "comint" nil t)
456
460;; Using a derived mode gives us keymaps, hooks, etc. 457;; Using a derived mode gives us keymaps, hooks, etc.
461(define-derived-mode nslookup-mode comint-mode "Nslookup" 458(define-derived-mode nslookup-mode comint-mode "Nslookup"
462 "Major mode for interacting with the nslookup program." 459 "Major mode for interacting with the nslookup program."
@@ -484,20 +481,17 @@ If your system's ping continues until interrupted, you can try setting
484 (list "DNS Lookup" host dns-lookup-program) 481 (list "DNS Lookup" host dns-lookup-program)
485 " ** ")) 482 " ** "))
486 dns-lookup-program 483 dns-lookup-program
487 options 484 options)))
488 ))) 485
486(autoload 'ffap-string-at-point "ffap")
489 487
490;;;###autoload 488;;;###autoload
491(defun run-dig (host) 489(defun run-dig (host)
492 "Run dig program." 490 "Run dig program."
493 (interactive 491 (interactive
494 (list 492 (list
495 (progn 493 (read-from-minibuffer "Lookup host: "
496 (require 'ffap) 494 (or (ffap-string-at-point 'machine) ""))))
497 (read-from-minibuffer
498 "Lookup host: "
499 (with-no-warnings
500 (or (ffap-string-at-point 'machine) ""))))))
501 (net-utils-run-program 495 (net-utils-run-program
502 "Dig" 496 "Dig"
503 (concat "** " 497 (concat "** "
@@ -507,6 +501,8 @@ If your system's ping continues until interrupted, you can try setting
507 dig-program 501 dig-program
508 (list host))) 502 (list host)))
509 503
504(autoload 'comint-exec "comint")
505
510;; This is a lot less than ange-ftp, but much simpler. 506;; This is a lot less than ange-ftp, but much simpler.
511;;;###autoload 507;;;###autoload
512(defun ftp (host) 508(defun ftp (host)
@@ -515,7 +511,6 @@ If your system's ping continues until interrupted, you can try setting
515 (list 511 (list
516 (read-from-minibuffer 512 (read-from-minibuffer
517 "Ftp to Host: " (net-utils-machine-at-point)))) 513 "Ftp to Host: " (net-utils-machine-at-point))))
518 (require 'comint)
519 (let ((buf (get-buffer-create (concat "*ftp [" host "]*")))) 514 (let ((buf (get-buffer-create (concat "*ftp [" host "]*"))))
520 (set-buffer buf) 515 (set-buffer buf)
521 (ftp-mode) 516 (ftp-mode)
@@ -550,7 +545,6 @@ If your system's ping continues until interrupted, you can try setting
550 (read-from-minibuffer 545 (read-from-minibuffer
551 "Connect to Host: " (net-utils-machine-at-point)) 546 "Connect to Host: " (net-utils-machine-at-point))
552 (read-from-minibuffer "SMB Service: "))) 547 (read-from-minibuffer "SMB Service: ")))
553 (require 'comint)
554 (let* ((name (format "smbclient [%s\\%s]" host service)) 548 (let* ((name (format "smbclient [%s\\%s]" host service))
555 (buf (get-buffer-create (concat "*" name "*"))) 549 (buf (get-buffer-create (concat "*" name "*")))
556 (service-name (concat "\\\\" host "\\" service))) 550 (service-name (concat "\\\\" host "\\" service)))
@@ -827,7 +821,6 @@ from SEARCH-STRING. With argument, prompt for whois server."
827 821
828(defun network-service-connection (host service) 822(defun network-service-connection (host service)
829 "Open a network connection to SERVICE on HOST." 823 "Open a network connection to SERVICE on HOST."
830 (require 'comint)
831 (let* ((process-name (concat "Network Connection [" host " " service "]")) 824 (let* ((process-name (concat "Network Connection [" host " " service "]"))
832 (portnum (string-to-number service)) 825 (portnum (string-to-number service))
833 (buf (get-buffer-create (concat "*" process-name "*")))) 826 (buf (get-buffer-create (concat "*" process-name "*"))))
@@ -840,6 +833,8 @@ from SEARCH-STRING. With argument, prompt for whois server."
840 (network-connection-mode-setup host service) 833 (network-connection-mode-setup host service)
841 (pop-to-buffer buf))) 834 (pop-to-buffer buf)))
842 835
836(defvar comint-input-ring)
837
843(defun network-connection-reconnect () 838(defun network-connection-reconnect ()
844 "Reconnect a network connection, preserving the old input ring." 839 "Reconnect a network connection, preserving the old input ring."
845 (interactive) 840 (interactive)