Bastien writes: > Hi Alan, > > Alan Schmitt <alan.schm...@polytechnique.org> writes: > >> My google-fu has failed me, and >> http://orgmode.org/manual/Handling-links.html does not seem to have the >> answer: is it possible to open a file link in dired (i.e., a dired >> buffer in the enclosing directory with the cursor on the file)? > > I'd do something like this: > > (org-add-link-type "file+emacs+dired" 'org-open-file-with-emacs-dired) > > (defun org-open-file-with-emacs-dired (path) > "Open in dired." > (let ((d (file-name-directory path)) > (f (file-name-nondirectory path))) > (dired d) > (goto-char (point-min)) > (search-forward f nil t))) > > which will work for a new link type file+emacs+dired.
Thank you, this would work nicely. However I don't know how to specify, when I open the file, which link-type to use. Would I need to modify the link itself from "file" to "file+emacs+dired" before opening it? Alan