1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-18 10:16:51 +00:00
emacs/lisp/url/url-dired.el
Glenn Morris e1ac4066d1 Minor-mode doc fixes for ARG behavior
* lisp/completion.el (dynamic-completion-mode):
* lisp/dirtrack.el (dirtrack-debug-mode):
* lisp/electric.el (electric-layout-mode):
* lisp/epa-mail.el (epa-mail-mode, epa-global-mail-mode):
* lisp/face-remap.el (text-scale-mode, buffer-face-mode):
* lisp/iimage.el (iimage-mode):
* lisp/image-mode.el (image-transform-mode):
* lisp/minibuffer.el (completion-in-region-mode):
* lisp/scroll-lock.el (scroll-lock-mode):
* lisp/simple.el (next-error-follow-minor-mode):
* lisp/tar-mode.el (tar-subfile-mode):
* lisp/tooltip.el (tooltip-mode):
* lisp/vcursor.el (vcursor-use-vcursor-map):
* lisp/wid-browse.el (widget-minor-mode):
* lisp/emulation/tpu-edt.el (tpu-edt-mode):
* lisp/emulation/tpu-extras.el (tpu-cursor-free-mode):
* lisp/international/iso-ascii.el (iso-ascii-mode):
* lisp/language/thai-util.el (thai-word-mode):
* lisp/mail/supercite.el (sc-minor-mode):
* lisp/net/goto-addr.el (goto-address-mode):
* lisp/net/rcirc.el (rcirc-multiline-minor-mode, rcirc-track-minor-mode):
* lisp/progmodes/cwarn.el (cwarn-mode):
* lisp/progmodes/flymake.el (flymake-mode):
* lisp/progmodes/glasses.el (glasses-mode):
* lisp/progmodes/hideshow.el (hs-minor-mode):
* lisp/progmodes/pascal.el (pascal-outline-mode):
* lisp/textmodes/enriched.el (enriched-mode):
* lisp/vc/smerge-mode.el (smerge-mode):
Doc fixes (minor mode argument).

* etc/NEWS: Related markup.
2012-02-07 21:12:24 -05:00

61 lines
1.9 KiB
EmacsLisp

;;; url-dired.el --- URL Dired minor mode
;; Copyright (C) 1996-1999, 2004-2012 Free Software Foundation, Inc.
;; Keywords: comm, files
;; This file is part of GNU Emacs.
;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
;;; Code:
(autoload 'dired-get-filename "dired")
(defvar url-dired-minor-mode-map
(let ((map (make-sparse-keymap)))
(define-key map "\C-m" 'url-dired-find-file)
(define-key map [mouse-2] 'url-dired-find-file-mouse)
map)
"Keymap used when browsing directories.")
(defun url-dired-find-file ()
"In dired, visit the file or directory named on this line."
(interactive)
(let ((filename (dired-get-filename)))
(find-file filename)))
(defun url-dired-find-file-mouse (event)
"In dired, visit the file or directory name you click on."
(interactive "@e")
(mouse-set-point event)
(url-dired-find-file))
(define-minor-mode url-dired-minor-mode
"Minor mode for directory browsing.
With a prefix argument ARG, enable the mode if ARG is positive,
and disable it otherwise. If called from Lisp, enable the mode
if ARG is omitted or nil."
:lighter " URL" :keymap url-dired-minor-mode-map)
(defun url-find-file-dired (dir)
"\"Edit\" directory DIR, but with additional URL-friendly bindings."
(interactive "DURL Dired (directory): ")
(find-file dir)
(url-dired-minor-mode t))
(provide 'url-dired)
;;; url-dired.el ends here