comparison lisp/url/url-dired.el @ 79499:0f9cdf179b3f

Diane Murray <disumu at x3y2z1.net> Don't require w3-fetch and w3-open-local. (url-dired-find-file): Use `find-file'. Doc fix. (url-dired-find-file-mouse, url-dired-minor-mode): Doc fix.
author Glenn Morris <rgm@gnu.org>
date Wed, 28 Nov 2007 08:26:50 +0000
parents 8932997d0b62
children 9c0b3f269b92
comparison
equal deleted inserted replaced
79498:9c99c911eb43 79499:0f9cdf179b3f
22 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 22 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
23 ;; Boston, MA 02110-1301, USA. 23 ;; Boston, MA 02110-1301, USA.
24 24
25 ;;; Code: 25 ;;; Code:
26 26
27 (autoload 'w3-fetch "w3")
28 (autoload 'w3-open-local "w3")
29 (autoload 'dired-get-filename "dired") 27 (autoload 'dired-get-filename "dired")
30 28
31 (defvar url-dired-minor-mode-map 29 (defvar url-dired-minor-mode-map
32 (let ((map (make-sparse-keymap))) 30 (let ((map (make-sparse-keymap)))
33 (define-key map "\C-m" 'url-dired-find-file) 31 (define-key map "\C-m" 'url-dired-find-file)
39 "Whether we are in url-dired-minor-mode") 37 "Whether we are in url-dired-minor-mode")
40 38
41 (make-variable-buffer-local 'url-dired-minor-mode) 39 (make-variable-buffer-local 'url-dired-minor-mode)
42 40
43 (defun url-dired-find-file () 41 (defun url-dired-find-file ()
44 "In dired, visit the file or directory named on this line, using Emacs-W3." 42 "In dired, visit the file or directory named on this line."
45 (interactive) 43 (interactive)
46 (let ((filename (dired-get-filename))) 44 (let ((filename (dired-get-filename)))
47 (cond ((string-match "/\\(.*@.*\\):\\(/.*\\)" filename) 45 (find-file filename)))
48 (w3-fetch (concat "file://" (match-string 1 filename) (match-string 2 filename))))
49 (t
50 (w3-open-local filename)))))
51 46
52 (defun url-dired-find-file-mouse (event) 47 (defun url-dired-find-file-mouse (event)
53 "In dired, visit the file or directory name you click on, using Emacs-W3." 48 "In dired, visit the file or directory name you click on."
54 (interactive "@e") 49 (interactive "@e")
55 (mouse-set-point event) 50 (mouse-set-point event)
56 (url-dired-find-file)) 51 (url-dired-find-file))
57 52
58 (defun url-dired-minor-mode (&optional arg) 53 (defun url-dired-minor-mode (&optional arg)
59 "Minor mode for directory browsing with Emacs-W3." 54 "Minor mode for directory browsing."
60 (interactive "P") 55 (interactive "P")
61 (cond 56 (cond
62 ((null arg) 57 ((null arg)
63 (setq url-dired-minor-mode (not url-dired-minor-mode))) 58 (setq url-dired-minor-mode (not url-dired-minor-mode)))
64 ((equal 0 arg) 59 ((equal 0 arg)