emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Emacs-orgmode] Managing files?


From: Ed Hirgelt
Subject: Re: [Emacs-orgmode] Managing files?
Date: Thu, 31 Aug 2006 09:19:14 -0700

On 8/31/06, Xiao-Yong Jin <address@hidden> 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 via email to

[Prev in Thread] Current Thread [Next in Thread]