From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Ed Hirgelt" Subject: Re: Managing files? Date: Thu, 31 Aug 2006 09:19:14 -0700 Message-ID: <44d0d9630608310919k47d10561o693ceefeb076a269@mail.gmail.com> References: <87veo99c17.fsf@photon.homelinux.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GIpGB-0007tM-0Z for emacs-orgmode@gnu.org; Thu, 31 Aug 2006 12:19:19 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GIpG7-0007oN-Rm for emacs-orgmode@gnu.org; Thu, 31 Aug 2006 12:19:18 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GIpG7-0007nR-BQ for emacs-orgmode@gnu.org; Thu, 31 Aug 2006 12:19:15 -0400 Received: from [64.233.166.176] (helo=py-out-1112.google.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GIpPm-0002nv-1U for emacs-orgmode@gnu.org; Thu, 31 Aug 2006 12:29:14 -0400 Received: by py-out-1112.google.com with SMTP id d42so608932pyd for ; Thu, 31 Aug 2006 09:19:14 -0700 (PDT) In-Reply-To: <87veo99c17.fsf@photon.homelinux.org> Content-Disposition: inline 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 On 8/31/06, Xiao-Yong Jin 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.