help-gnu-emacs
[Top][All Lists]
Advanced

[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 14:06:15 +0100
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/22.2 (gnu/linux)

Richard Riley <rileyrgdev@gmail.com> writes:

>>
>> There's `xdg-open' which given a directory or file argument should open
>> it with the system's default application.
>
> Where is this defined? It does not exist on my debian system.

This may be a trifle OT but on my system:

rupert@hake:~ dpkg -S xdg-open 
xdg-utils: /usr/bin/xdg-open
xdg-utils: /usr/share/man/man1/xdg-open.1.gz
rupert@hake:~ apt-cache show xdg-utils
Package: xdg-utils
Priority: optional
Section: utils
Installed-Size: 256
Maintainer: Per Olofsson <pelle@debian.org>
Architecture: all
Version: 1.0.2-6
Recommends: iceweasel | www-browser, x11-utils, x11-xserver-utils, file, 
mime-support, shared-mime-info
Suggests: desktop-file-utils, libgnome2-0, exo-utils, libgnomevfs2-bin, 
kdelibs4c2a, konqueror, libgtk2.0-bin
Filename: pool/main/x/xdg-utils/xdg-utils_1.0.2-6_all.deb
Size: 53260
MD5sum: a7185ac590bf72ee8c490e4fd7abeb65
SHA1: 0f6be668c7a92a9da3bb2e682135cb79781ffd57
SHA256: 1786908c1abf66841f44f384fed1eb1a875f0c2d36ffb45ff4fe48ad55205e84
Description: desktop integration utilities from freedesktop.org
 xdg-utils contains utilities for integrating applications with the
 desktop environment, regardless of which desktop environment is used.
 They are part of freedesktop.org's Portland project.
 .
 The following utilities are included:
 .
  * xdg-desktop-menu - Install desktop menu items
  * xdg-desktop-icon - Install icons on the user's desktop
  * xdg-icon-resource - Install icon resources
  * xdg-mime - Gather MIME information about a file
  * xdg-open - Open a URL in the user's preferred application that
               handles the respective URL or file type
  * xdg-email - Open the user's preferred email client, potentially with
                subject and other info filled in
  * xdg-screensaver - Enable, disable, or suspend the screensaver
Homepage: http://portland.freedesktop.org/
Tag: devel::runtime, implemented-in::shell, interface::commandline, 
role::program, scope::utility
Task: desktop

rupert@hake:~ 

>
> Also would you know how to make "e" open the directory/file under the
> cursor? Your comments above indicate you thought this to be the case -
> it actually opens the current dir.
>
> e.g If I am in dired in ~, and the cursor is on .adobe (a dir) then
> hitting e should open .adobe in nautilus in my case
>

I didn't know the answer for this either, so this is how I found out: I
knew that hitting e in dired did what I wanted normally (ie worked out
what directory to use), so first I did C-h c e when in dired and found
that e was bound to dired-find-file.

I then had a look at the source code for dired-find-file in dired.el (if
you've got the sources installed, you can find it by doing C-h f
dired-find-file and then hitting enter on the filename, otherwise try
here [1]). The code is as follows:

(defun dired-find-file ()
  "In Dired, visit the file or directory named on this line."
  (interactive)
  ;; Bind `find-file-run-dired' so that the command works on directories
  ;; too, independent of the user's setting.
  (let ((find-file-run-dired t))
    (find-file (dired-get-file-for-visit))))

So I'd go for (dired-get-file-for-visit).


Rupert



[1] 
http://cvs.savannah.gnu.org/viewvc/emacs/lisp/dired.el?revision=1.410&root=emacs&view=markup

Attachment: pgpp8IMwKlWc4.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]