[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Orgmode] Adding path and file name into file links
From: |
Bastien |
Subject: |
Re: [Orgmode] Adding path and file name into file links |
Date: |
Sun, 18 Nov 2007 10:44:25 +0000 |
User-agent: |
Gnus/5.110007 (No Gnus v0.7) Emacs/23.0.0 (gnu/linux) |
"Graham Smith" <address@hidden> 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