From mboxrd@z Thu Jan 1 00:00:00 1970 From: Giacomo M Subject: Parent path for links Date: Wed, 18 Feb 2015 17:55:13 -0800 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=089e0160a4060738ff050f673ac5 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:54195) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YOGKk-000153-6f for emacs-orgmode@gnu.org; Wed, 18 Feb 2015 20:55:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YOGKh-00025U-0b for emacs-orgmode@gnu.org; Wed, 18 Feb 2015 20:55:18 -0500 Received: from mail-la0-f44.google.com ([209.85.215.44]:32975) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YOGKg-00024H-QP for emacs-orgmode@gnu.org; Wed, 18 Feb 2015 20:55:14 -0500 Received: by labhz20 with SMTP id hz20so4995826lab.0 for ; Wed, 18 Feb 2015 17:55:13 -0800 (PST) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --089e0160a4060738ff050f673ac5 Content-Type: text/plain; charset=UTF-8 Dear all, I'm experimenting the following path structure: 1. ~/org/ is where I keep all my org files for organization purposes (e.g. project.org contains all TODOs, notes, events, and links related to "project") and is sync'd with a GIT server. 2. ~/working/project/ is where I keep all the non-organizational files related to "project", which are potentially big and thus the folder is saved on an external drive/Dropbox. What happens is that in project.org I end up specifying a lot of links all starting with ~/working/project/. This is useful as I can directly jump from "organization" to "action", or just to switch in a quicker way across project files. I know there is an header arg (i.e. dir) for the path of code execution, but I am not aware of anything similar for link referencing. Would you have any suggestions for reducing the redundancy of a common parent path for links in a subtree/file? Thanks, Giacomo --089e0160a4060738ff050f673ac5 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Dear all,
I= 9;m experimenting the following path structure:

1. ~/org/ is w= here I keep all my org files for organization purposes (e.g. project.org contains all TODOs, notes, events, and lin= ks related to "project") and is sync'd with a GIT server.
2. ~/working/project/ is where I keep all the non-organizational file= s related to "project", which are potentially big and thus the fo= lder is saved on an external drive/Dropbox.

What happens= is that in project.org I end up specify= ing a lot of links all starting with ~/working/project/. This is useful as = I can directly jump from "organization" to "action", or= just to switch in a quicker way across project files.

I know there = is an header arg (i.e. dir) for the path of code execution, but I am not aw= are of anything similar for link referencing.

Would you have a= ny suggestions for reducing the redundancy of a common parent path for link= s in a subtree/file?

Thanks,

Giacomo





=
--089e0160a4060738ff050f673ac5-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kyle Meyer Subject: Re: Parent path for links Date: Thu, 19 Feb 2015 00:17:04 -0500 Message-ID: <87a90a4h0v.fsf@kmlap.domain.org> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47110) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YOJQE-0006WR-4f for emacs-orgmode@gnu.org; Thu, 19 Feb 2015 00:13:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YOJQA-00050x-3J for emacs-orgmode@gnu.org; Thu, 19 Feb 2015 00:13:10 -0500 Received: from mail-qc0-f170.google.com ([209.85.216.170]:33366) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YOJQ9-00050r-VQ for emacs-orgmode@gnu.org; Thu, 19 Feb 2015 00:13:06 -0500 Received: by mail-qc0-f170.google.com with SMTP id c9so4701679qcz.1 for ; Wed, 18 Feb 2015 21:13:05 -0800 (PST) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Giacomo M Cc: emacs-orgmode@gnu.org Giacomo M wrote: [...] > What happens is that in project.org I end up specifying a lot of links all > starting with ~/working/project/. This is useful as I can directly jump > from "organization" to "action", or just to switch in a quicker way across > project files. [...] > Would you have any suggestions for reducing the redundancy of a common > parent path for links in a subtree/file? Is the reason this redundancy bothers you visual? (I'm guessing it is because it shouldn't be any extra work to insert the link if you're using org-store-link.) In that case, you could make a command that adds a link description with the file base name (assuming these file links tend to not have descriptions). Another possibility (which I haven't really thought through or tested) is to use a custom link type that grabs the project directory from somewhere (below I use a property value) and then uses that as the default directory. #+begin_src elisp (org-add-link-type "project" 'km/org-project-open) (defun km/org-project-open (path) "Open PATH with `default-directory' set to PROJECT property." (let ((project (org-entry-get nil "PROJECT" 'inherit))) (if project (let ((default-directory project)) (org-open-link-from-string (concat "file:" path))) (user-error "Project property not defined")))) #+end_src (Notice that km/org-project-open is actually making an ordinary file link to support things like "::*heading"... definitely a hack). You could specify the property value at the top of the project file #+PROPERTY: project /path/to/project or as a project property on a heading * heading :PROPERTIES: :PROJECT: /path/to/project :END: This would then allow for links to a file name relative to the project directory, like project:file-name.org and project:file-name.org::*Heading -- Kyle From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christian Wittern Subject: Re: Parent path for links Date: Fri, 20 Feb 2015 08:49:21 +0900 Message-ID: <54E67681.1070907@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:48528) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YOaqY-0000T1-RU for emacs-orgmode@gnu.org; Thu, 19 Feb 2015 18:49:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YOaqV-0000bN-Fw for emacs-orgmode@gnu.org; Thu, 19 Feb 2015 18:49:30 -0500 Received: from mail-pd0-x231.google.com ([2607:f8b0:400e:c02::231]:38408) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YOaqV-0000bH-7x for emacs-orgmode@gnu.org; Thu, 19 Feb 2015 18:49:27 -0500 Received: by pdbfp1 with SMTP id fp1so3402874pdb.5 for ; Thu, 19 Feb 2015 15:49:25 -0800 (PST) Received: from mbp3a-2.local (180-145-157-187f1.kyt1.eonet.ne.jp. [180.145.157.187]) by mx.google.com with ESMTPSA id pf10sm24768548pbc.82.2015.02.19.15.49.23 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Feb 2015 15:49:24 -0800 (PST) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org On 2015-02-19 10:55, Giacomo M wrote: > What happens is that in project.org I end up specifying > a lot of links all starting with ~/working/project/. This is useful as I can > directly jump from "organization" to "action", or just to switch in a > quicker way across project files. > > I know there is an header arg (i.e. dir) for the path of code execution, but > I am not aware of anything similar for link referencing. Look at Section 4.6 Link Abbreviations in the manual. What you would want to do is having #+LINK: wp ~/working/project in your header, than you can reference it as [[wp:your-project.org]] instead of [[~/working/project/your-project.org]]. Best, Christian -- Christian Wittern, Kyoto From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kyle Meyer Subject: Re: Parent path for links Date: Thu, 19 Feb 2015 19:07:54 -0500 Message-ID: <87bnkpla1x.fsf@kyleam.com> References: <54E67681.1070907@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:51003) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YOb8W-0002WH-5I for emacs-orgmode@gnu.org; Thu, 19 Feb 2015 19:08:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YOb8R-0007Kb-2d for emacs-orgmode@gnu.org; Thu, 19 Feb 2015 19:08:04 -0500 Received: from mail-qg0-f54.google.com ([209.85.192.54]:45184) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YOb8Q-0007KP-VG for emacs-orgmode@gnu.org; Thu, 19 Feb 2015 19:07:59 -0500 Received: by mail-qg0-f54.google.com with SMTP id z60so10661239qgd.13 for ; Thu, 19 Feb 2015 16:07:56 -0800 (PST) In-Reply-To: <54E67681.1070907@gmail.com> (Christian Wittern's message of "Fri, 20 Feb 2015 08:49:21 +0900") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Christian Wittern Cc: emacs-orgmode@gnu.org Christian Wittern wrote: [...] > Look at Section 4.6 Link Abbreviations in the manual. What you would want > to do is having > > #+LINK: wp ~/working/project > > in your header, than you can reference it as [[wp:your-project.org]] instead > of [[~/working/project/your-project.org]]. Ahh... neat. I didn't know about that. Ignore my answer. -- Kyle