unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: "Lennart Borgman (gmail)" <lennart.borgman@gmail.com>
To: Tassilo Horn <tassilo@member.fsf.org>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Browsing dirs from Dired with graphical explorer
Date: Mon, 22 Sep 2008 14:45:37 +0200	[thread overview]
Message-ID: <48D79371.8080406@gmail.com> (raw)
In-Reply-To: <8763oo1oq7.fsf@thinkpad.tsdh.de>

Tassilo Horn wrote:
> Sébastien Vauban <zthjwsqqafhv@spammotel.com>
> writes:
> 
> Hi Sébastien,
> 
>> I would like some help with a snippet of code I've merged from
>> different sources:
>>
>> (defun my-browse-dir (dir-as-string)
>>   "Open the current directory in your OS's file manager."
>>   (interactive)
>>   (let ((file-manager
>>          (cond (running-ms-windows "explorer")
>>                (t "/usr/lib/kde4/bin/dolphin"))))
>>                   ;; `nautilus --no-desktop' or `gnome-open'
>>     (start-process-shell-command "browse"
>>                                  "*scratch*"
>>                                  (concat file-manager " " dir-as-string))))
>>
>> I'd like to use that when in Dired mode: to be able to launch
>> the graphical file browser from the underlying OS.
>>
>> My problem is: how to pass the current directory argument?
> 
> If you're inside dired, you can use `dired-current-directory'.  So maybe
> this (untested) version does what you want:
> 
> --8<---------------cut here---------------start------------->8---
> (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)))
> --8<---------------cut here---------------end--------------->8---


I think there are better ways to do this. I have implemented this for MS
Windows in EmacsW32. It is in the file w32shell. (Unfortunately there is
no easy way to get that file, you have to install EmacsW32+Emacs.)




  reply	other threads:[~2008-09-22 12:45 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-22  8:31 Browsing dirs from Dired with graphical explorer Sébastien Vauban
2008-09-22 10:04 ` Tassilo Horn
2008-09-22 12:45   ` Lennart Borgman (gmail) [this message]
     [not found]   ` <mailman.19685.1222087548.18990.help-gnu-emacs@gnu.org>
2008-09-22 12:58     ` Sébastien Vauban
     [not found] ` <mailman.19679.1222078001.18990.help-gnu-emacs@gnu.org>
2008-09-22 12:05   ` Richard Riley
2008-09-22 13:06     ` Rupert Swarbrick
2008-09-22 13:37     ` Tassilo Horn
     [not found]     ` <mailman.19686.1222090826.18990.help-gnu-emacs@gnu.org>
2008-09-22 15:47       ` Richard Riley
2008-09-22 19:15         ` Tassilo Horn
     [not found]         ` <mailman.19711.1222111115.18990.help-gnu-emacs@gnu.org>
2008-09-22 22:07           ` Richard Riley
2008-09-23  7:58             ` Tassilo Horn
     [not found]             ` <mailman.19745.1222156700.18990.help-gnu-emacs@gnu.org>
2008-09-23 11:58               ` Richard Riley
2008-09-23 12:00                 ` Richard Riley
2008-09-24 17:28                   ` Richard Riley
2008-09-22 12:55   ` Rupert Swarbrick
2008-09-22 13:13   ` Sébastien Vauban

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48D79371.8080406@gmail.com \
    --to=lennart.borgman@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=tassilo@member.fsf.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).