1 ;;; url-dired.el --- URL Dired minor mode
3 ;; Copyright (C) 1996, 1997, 1998, 1999, 2004,
4 ;; 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
6 ;; Keywords: comm, files
8 ;; This file is part of GNU Emacs.
10 ;; GNU Emacs is free software: you can redistribute it and/or modify
11 ;; it under the terms of the GNU General Public License as published by
12 ;; the Free Software Foundation, either version 3 of the License, or
13 ;; (at your option) any later version.
15 ;; GNU Emacs is distributed in the hope that it will be useful,
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;; GNU General Public License for more details.
20 ;; You should have received a copy of the GNU General Public License
21 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
25 (autoload 'dired-get-filename
"dired")
27 (defvar url-dired-minor-mode-map
28 (let ((map (make-sparse-keymap)))
29 (define-key map
"\C-m" 'url-dired-find-file
)
30 (define-key map
[mouse-2
] 'url-dired-find-file-mouse
)
32 "Keymap used when browsing directories.")
34 (defun url-dired-find-file ()
35 "In dired, visit the file or directory named on this line."
37 (let ((filename (dired-get-filename)))
38 (find-file filename
)))
40 (defun url-dired-find-file-mouse (event)
41 "In dired, visit the file or directory name you click on."
43 (mouse-set-point event
)
44 (url-dired-find-file))
46 (define-minor-mode url-dired-minor-mode
47 "Minor mode for directory browsing."
48 :lighter
" URL" :keymap url-dired-minor-mode-map
)
50 (defun url-find-file-dired (dir)
51 "\"Edit\" directory DIR, but with additional URL-friendly bindings."
52 (interactive "DURL Dired (directory): ")
54 (url-dired-minor-mode t
))
58 ;; arch-tag: 2694f21a-43e1-4391-b3cb-cf6e5349f15f
59 ;;; url-dired.el ends here