From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Graham Smith" Subject: Re: Adding path and file name into file links Date: Sun, 18 Nov 2007 11:21:35 +0000 Message-ID: <2c75873c0711180321m74d8c599ic2b84c2b966c6b01@mail.gmail.com> References: <2c75873c0711180039y31135f57yc018c4bc6f122897@mail.gmail.com> <87hcjj7rzq.fsf@bzg.ath.cx> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0001520119==" Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1ItiDZ-00032l-Uy for emacs-orgmode@gnu.org; Sun, 18 Nov 2007 06:21:38 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1ItiDZ-00030u-2i for emacs-orgmode@gnu.org; Sun, 18 Nov 2007 06:21:37 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ItiDY-00030Y-Sr for emacs-orgmode@gnu.org; Sun, 18 Nov 2007 06:21:36 -0500 Received: from an-out-0708.google.com ([209.85.132.248]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1ItiDY-0001Fb-JQ for emacs-orgmode@gnu.org; Sun, 18 Nov 2007 06:21:36 -0500 Received: by an-out-0708.google.com with SMTP id c25so325344ana for ; Sun, 18 Nov 2007 03:21:36 -0800 (PST) In-Reply-To: <87hcjj7rzq.fsf@bzg.ath.cx> 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 --===============0001520119== Content-Type: multipart/alternative; boundary="----=_Part_19407_12480905.1195384895930" ------=_Part_19407_12480905.1195384895930 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Bastien, Thanks, the latter does exactly what I want, obviously a terminology thing confusing my question. With Explorer in Windows I can right click on a file and select copy file name to the clipboard which copies and the path and file name to the clipboard. I can then paste the path and file name into any other program. And 'org-store-link' seems to provide the same facility with dired and Org-mode/ However, I cant get C-u C-c C-l to work. I still seem to need to type in the file path and file name, rather than have the ability to search for a file. Presumably I am missing the obvious. Thanks, Graham On 18/11/2007, Bastien wrote: > > "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 > > > _______________________________________________ > Emacs-orgmode mailing list > Remember: use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode > ------=_Part_19407_12480905.1195384895930 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Bastien,

Thanks, the latter does exactly what I want, obviously a terminology thing confusing my question.

With Explorer in Windows I can right click on a file and select  copy file name to the clipboard which copies and the path and file name to the clipboard. I can then paste the path and file name into any other program. And  'org-store-link' seems to provide the same facility with dired and Org-mode/

However,  I cant get  C-u C-c C-l  to work.

I still seem to need to type in the file path and file name, rather than have the ability to search for a file. Presumably I am missing the obvious.

Thanks,

Graham

On 18/11/2007, Bastien <bzg@altern.org> wrote:
"Graham Smith" <myotisone@gmail.com> 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


_______________________________________________
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

------=_Part_19407_12480905.1195384895930-- --===============0001520119== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --===============0001520119==--