From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bastien Subject: Re: Adding path and file name into file links Date: Sun, 18 Nov 2007 10:44:25 +0000 Message-ID: <87hcjj7rzq.fsf@bzg.ath.cx> References: <2c75873c0711180039y31135f57yc018c4bc6f122897@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ithdh-000528-3b for emacs-orgmode@gnu.org; Sun, 18 Nov 2007 05:44:33 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ithdf-0004z5-Fm for emacs-orgmode@gnu.org; Sun, 18 Nov 2007 05:44:32 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ithdf-0004ya-9d for emacs-orgmode@gnu.org; Sun, 18 Nov 2007 05:44:31 -0500 Received: from nf-out-0910.google.com ([64.233.182.184]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Ithdd-0000Rh-Qf for emacs-orgmode@gnu.org; Sun, 18 Nov 2007 05:44:30 -0500 Received: by nf-out-0910.google.com with SMTP id f5so1375789nfh for ; Sun, 18 Nov 2007 02:44:28 -0800 (PST) In-Reply-To: <2c75873c0711180039y31135f57yc018c4bc6f122897@mail.gmail.com> (Graham Smith's message of "Sun, 18 Nov 2007 08:39:49 +0000") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org "Graham Smith" writes: > When adding a file link, is there some way of searching for the file you > want to add while in the file link and then inserting the path and file > name of the found file rather than having to type the whole thing in. C-u C-c C-l to find the file, then RET RET to insert it with its name as the default description. > Or alternatively, can you search for the file with dired and then copy > and paste the path from dired into the file link. I'm not sure of what you mean. The usual way is to call `org-store-link' (`C-c l' here) on a file in dired then to insert this link back with `org-insert-link' (C-c C-l). Does that help? If you want to create a list of links from dired and copy this list to the kill-ring, maybe you can use something like this as well: (defun my-copy-dired-files-in-kill-ring () "Copy files names in the kill ring." (interactive) (let ((files (dired-map-over-marks (dired-get-filename) nil))) (kill-new (mapconcat (lambda (f) (concat "[[file:" f "][" (file-name-nondirectory f) "]]")) files "\n")) (message "%d Org links copied to the kill-ring" (length files)))) -- Bastien