emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Bastien <bzg@altern.org>
To: emacs-orgmode@gnu.org
Subject: Re: Adding path and file name into file links
Date: Sun, 18 Nov 2007 10:44:25 +0000	[thread overview]
Message-ID: <87hcjj7rzq.fsf@bzg.ath.cx> (raw)
In-Reply-To: <2c75873c0711180039y31135f57yc018c4bc6f122897@mail.gmail.com> (Graham Smith's message of "Sun, 18 Nov 2007 08:39:49 +0000")

"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

  reply	other threads:[~2007-11-18 10:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-18  8:39 Adding path and file name into file links Graham Smith
2007-11-18 10:44 ` Bastien [this message]
2007-11-18 11:21   ` Graham Smith
2007-11-19  3:04     ` Bastien
2007-11-19  7:47       ` Graham Smith

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87hcjj7rzq.fsf@bzg.ath.cx \
    --to=bzg@altern.org \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).