From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bastien Subject: Re: open file link in dired? Date: Fri, 04 Jan 2013 16:55:58 +0100 Message-ID: <87vcbdlz75.fsf@bzg.ath.cx> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:60602) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tr9co-0006lI-LQ for emacs-orgmode@gnu.org; Fri, 04 Jan 2013 10:56:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tr9cm-0001dO-6W for emacs-orgmode@gnu.org; Fri, 04 Jan 2013 10:56:02 -0500 Received: from mail-wg0-f54.google.com ([74.125.82.54]:34611) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tr9cl-0001dK-Vu for emacs-orgmode@gnu.org; Fri, 04 Jan 2013 10:56:00 -0500 Received: by mail-wg0-f54.google.com with SMTP id fg15so7488681wgb.21 for ; Fri, 04 Jan 2013 07:55:59 -0800 (PST) In-Reply-To: (Alan Schmitt's message of "Fri, 04 Jan 2013 15:36:09 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Alan Schmitt Cc: "emacs-orgmode@gnu.org" Hi Alan, Alan Schmitt 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. But you can also setup `org-link-frame-setup' so that the function associated to the file entry does the right thing for you. HTH, -- Bastien