Mercurial > emacs
annotate lisp/url/url-dired.el @ 111057:097fe1170a9a
shr.el (shr-find-fill-point): Don't leave blanks at the start of some lines.
author | Katsumi Yamaoka <yamaoka@jpl.org> |
---|---|
date | Tue, 19 Oct 2010 23:26:28 +0000 |
parents | 0b37f86b040e |
children | 417b1e4d63cd |
rev | line source |
---|---|
54695 | 1 ;;; url-dired.el --- URL Dired minor mode |
57612 | 2 |
64748
875dcc490074
Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
64084
diff
changeset
|
3 ;; Copyright (C) 1996, 1997, 1998, 1999, 2004, |
106815 | 4 ;; 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. |
57612 | 5 |
54695 | 6 ;; Keywords: comm, files |
7 | |
57612 | 8 ;; This file is part of GNU Emacs. |
9 | |
94668
8259d0d8e107
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93975
diff
changeset
|
10 ;; GNU Emacs is free software: you can redistribute it and/or modify |
57612 | 11 ;; it under the terms of the GNU General Public License as published by |
94668
8259d0d8e107
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93975
diff
changeset
|
12 ;; the Free Software Foundation, either version 3 of the License, or |
8259d0d8e107
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93975
diff
changeset
|
13 ;; (at your option) any later version. |
57612 | 14 |
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. | |
19 | |
20 ;; You should have received a copy of the GNU General Public License | |
94668
8259d0d8e107
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93975
diff
changeset
|
21 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
57612 | 22 |
23 ;;; Code: | |
54695 | 24 |
25 (autoload 'dired-get-filename "dired") | |
26 | |
27 (defvar url-dired-minor-mode-map | |
28 (let ((map (make-sparse-keymap))) | |
29 (define-key map "\C-m" 'url-dired-find-file) | |
66225 | 30 (define-key map [mouse-2] 'url-dired-find-file-mouse) |
54695 | 31 map) |
32 "Keymap used when browsing directories.") | |
33 | |
34 (defun url-dired-find-file () | |
79499
0f9cdf179b3f
Diane Murray <disumu at x3y2z1.net>
Glenn Morris <rgm@gnu.org>
parents:
78222
diff
changeset
|
35 "In dired, visit the file or directory named on this line." |
54695 | 36 (interactive) |
37 (let ((filename (dired-get-filename))) | |
79499
0f9cdf179b3f
Diane Murray <disumu at x3y2z1.net>
Glenn Morris <rgm@gnu.org>
parents:
78222
diff
changeset
|
38 (find-file filename))) |
54695 | 39 |
40 (defun url-dired-find-file-mouse (event) | |
79499
0f9cdf179b3f
Diane Murray <disumu at x3y2z1.net>
Glenn Morris <rgm@gnu.org>
parents:
78222
diff
changeset
|
41 "In dired, visit the file or directory name you click on." |
54695 | 42 (interactive "@e") |
43 (mouse-set-point event) | |
44 (url-dired-find-file)) | |
45 | |
108220
0b37f86b040e
Use define-minor-mode where applicable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
106815
diff
changeset
|
46 (define-minor-mode url-dired-minor-mode |
79499
0f9cdf179b3f
Diane Murray <disumu at x3y2z1.net>
Glenn Morris <rgm@gnu.org>
parents:
78222
diff
changeset
|
47 "Minor mode for directory browsing." |
108220
0b37f86b040e
Use define-minor-mode where applicable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
106815
diff
changeset
|
48 :lighter " URL" :keymap url-dired-minor-mode-map) |
54695 | 49 |
50 (defun url-find-file-dired (dir) | |
51 "\"Edit\" directory DIR, but with additional URL-friendly bindings." | |
52 (interactive "DURL Dired (directory): ") | |
53 (find-file dir) | |
54 (url-dired-minor-mode t)) | |
55 | |
56 (provide 'url-dired) | |
54699 | 57 |
93975
1e3a407766b9
Fix up comment convention on the arch-tag lines.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
79720
diff
changeset
|
58 ;; arch-tag: 2694f21a-43e1-4391-b3cb-cf6e5349f15f |
57612 | 59 ;;; url-dired.el ends here |