[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Browsing dirs from Dired with graphical explorer
From: |
Rupert Swarbrick |
Subject: |
Re: Browsing dirs from Dired with graphical explorer |
Date: |
Mon, 22 Sep 2008 13:55:59 +0100 |
User-agent: |
Gnus/5.110011 (No Gnus v0.11) Emacs/22.2 (gnu/linux) |
Tassilo Horn <tassilo@member.fsf.org> writes:
>
> If you're inside dired, you can use `dired-current-directory'. So maybe
> this (untested) version does what you want:
>
> (defun my-browse-dir ()
> "Open the current directory in your OS's file manager."
> (interactive)
> (let ((dir-as-string (dired-current-directory))
> (file-manager
> (cond (running-ms-windows "explorer")
> (t "/usr/lib/kde4/bin/dolphin"))))
> (start-process "browse" nil file-manager dir-as-string)))
>
> In should open the directory point is on. If it's on a file, it depends
> on what the file manager does when it gets a file argument. Most will
> open it with an appropriate application.
>
> You might want to bind the function so some key in dired.
>
> (define-key dired-mode-map (kbd "e") 'my-browse-dir)
Another way, that doesn't need dired to be running is to use emacs'
directory expansion. That is,
(expand-file-name ".")
gives the full pathname of the current directory. This is a bit hacky,
to be honest, but I don't know a neater solution. Tassilo's solution now
becomes:
binFMnhVukGk1.bin
Description: application/emacs-lisp
Personally though, I wouldn't use the let form at all, and would just
write the following:
binxSH5d50p4k.bin
Description: application/emacs-lisp
Finally, since this now works outside of dired, you can use a global
keybinding if you want - how about:
(global-set-key (kbd "C-<f12>") 'my-browse-dir)
(of course, C-<f12> isn't necessarily what you want to use).
Rupert
pgpya0Kwf2c_V.pgp
Description: PGP signature
- Re: Browsing dirs from Dired with graphical explorer, (continued)
- Message not available
- Re: Browsing dirs from Dired with graphical explorer, Richard Riley, 2008/09/22
- Re: Browsing dirs from Dired with graphical explorer, Rupert Swarbrick, 2008/09/22
- Re: Browsing dirs from Dired with graphical explorer, Tassilo Horn, 2008/09/22
- Message not available
- Re: Browsing dirs from Dired with graphical explorer, Richard Riley, 2008/09/22
- Re: Browsing dirs from Dired with graphical explorer, Tassilo Horn, 2008/09/22
- Message not available
- Re: Browsing dirs from Dired with graphical explorer, Richard Riley, 2008/09/22
- Re: Browsing dirs from Dired with graphical explorer, Tassilo Horn, 2008/09/23
- Message not available
- Re: Browsing dirs from Dired with graphical explorer, Richard Riley, 2008/09/23
- Re: Browsing dirs from Dired with graphical explorer, Richard Riley, 2008/09/23
- Re: Browsing dirs from Dired with graphical explorer, Richard Riley, 2008/09/24
Message not available
- Re: Browsing dirs from Dired with graphical explorer,
Rupert Swarbrick <=
Message not available