emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Ed Hirgelt" <ehirgelt@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: Managing files?
Date: Thu, 31 Aug 2006 09:19:14 -0700	[thread overview]
Message-ID: <44d0d9630608310919k47d10561o693ceefeb076a269@mail.gmail.com> (raw)
In-Reply-To: <87veo99c17.fsf@photon.homelinux.org>

On 8/31/06, Xiao-Yong Jin <xj2106@columbia.edu> wrote:
> Hi, I've been using emacs-org for a while.  And I always find it's so
> troublesome to manage various files in emacs-org.  ... moving files around,
> storing files and changing files corresponding to a typical project
> are not easily done in emacs-org and need much more work.

One way I handle this is to use environment variables to define the
root directory of a project.  Then your file links can look like
[[file:$proj1/Docs/foo.pdf]].

This requires a little hack to org-open-file to call
substitute-in-file-name. I've included below the start of that
function so you can see what I did.  It does make certain
restructuring easy.

Hope this helps.

Ed

(defun org-open-file (path &optional in-emacs line search)
  "Open the file at PATH.
First, this expands any special file name abbreviations.  Then the
configuration variable `org-file-apps' is checked if it contains an
entry for this file type, and if yes, the corresponding command is launched.
If no application is found, Emacs simply visits the file.
With optional argument IN-EMACS, Emacs will visit the file.
Optional LINE specifies a line to go to, optional SEARCH a string to
search for.  If LINE or SEARCH is given, the file will always be
opened in Emacs.
If the file does not exist, an error is thrown."
  (setq in-emacs (or in-emacs line search))
  (let* ((file (if (equal path "")
		   buffer-file-name
		 (substitute-in-file-name (expand-file-name path))))
	 (apps (append org-file-apps (org-default-apps)))




-- 
Ed Hirgelt
Discovery consists of seeing what everybody has seen
and thinking what nobody has thought.

  reply	other threads:[~2006-08-31 16:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-31 15:10 Managing files? Xiao-Yong Jin
2006-08-31 16:19 ` Ed Hirgelt [this message]
2006-09-01 17:03   ` Carsten Dominik
2006-08-31 18:08 ` Li Yuanqian-MGIA0534
2006-09-01 15:44   ` Carsten Dominik

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=44d0d9630608310919k47d10561o693ceefeb076a269@mail.gmail.com \
    --to=ehirgelt@gmail.com \
    --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).