From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: Use environment variable for location of templates? Date: Fri, 19 Jun 2009 22:47:06 -0400 Message-ID: <3181.1245466026@gamaville.dokosmarshall.org> References: <211769420906190939w5b608778oec6d1adb739699e1@mail.gmail.com> Reply-To: nicholas.dokos@hp.com Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MHqdA-0003SZ-R9 for emacs-orgmode@gnu.org; Fri, 19 Jun 2009 22:48:36 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MHqd9-0003Q1-0T for emacs-orgmode@gnu.org; Fri, 19 Jun 2009 22:48:36 -0400 Received: from [199.232.76.173] (port=36121 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MHqd8-0003Pw-U3 for emacs-orgmode@gnu.org; Fri, 19 Jun 2009 22:48:34 -0400 Received: from qmta05.westchester.pa.mail.comcast.net ([76.96.62.48]:44508) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MHqd8-0007XR-EQ for emacs-orgmode@gnu.org; Fri, 19 Jun 2009 22:48:34 -0400 In-Reply-To: Message from Jere McDevitt of "Fri\, 19 Jun 2009 20\:19\:39 EDT." 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: Jere McDevitt Cc: emacs-orgmode@gnu.org Jere McDevitt wrote: > I think the issue is that you need to supply a function to be invoked > to create the file name. >=20 > I tested your approach and found if you change the line to use a > lambda function >=20 > =C2=A0 =C2=A0 =C2=A0=C2=A0 ("Work Tasks" ?t "* TODO %U %?\n\n =C2=A0%i\n = =C2=A0%a" (lambda() (concat > org-directory "tasks.org"))) >=20 > seems to work.=C2=A0 Make sure that your environment variable ends in a / > so the path is constructed correctly. >=20 > Jere >=20 > On Fri, Jun 19, 2009 at 12:39 PM, Nathan Neff wro= te: >=20 > Hello, >=20=20=20=20 > I'm a beginner at lisp/emacs, and realize this is a basic question. >=20=20=20=20 > I would like to use an environment variable WORKDIR to specify the > directory whereOh, I'm familiar with the file variables and all, than= ks for the tip. >=20=20=20=20 > Since the org-remember code is written to support files that are > not in org-mode as targets of remember items, it just seemed to me > it shouldn't then switch back to assuming it was an org mode file > simply because the text being inserted resembles a particular type > of regexp. my remember templates are located. >=20=20=20=20 > I would like to have a template located in WORKDIR/tasks.org >=20=20=20=20 > Using the code below, when I invoke remember-mode and press "t", I get > the default > remember template instead of the WORKDIR/tasks.org. >=20=20=20=20 > ;; I can get the value of WORKDIR successfully > (setq org-directory (getenv "WORKDIR")) >=20=20=20=20 > (setq org-remember-templates > =C2=A0 =C2=A0 =C2=A0'( > =C2=A0 =C2=A0 =C2=A0 =C2=A0("Personal" ?p "* %U %?\n\n =C2=A0%i\n =C2= =A0%a" "~/Documents/personal/notes.org") > =C2=A0 =C2=A0 =C2=A0 =C2=A0("Work Tasks" ?t "* TODO %U %?\n\n =C2=A0%= i\n =C2=A0%a" (concat org-directory > "tasks.org")) > )) >=20=20=20=20 > Any help would be appreciated. >=20=20=20=20 Jere is right in general, but for this particular case, the simpler solution is to use just the file name: org interprets that to mean a file relative to org-directory: (setq org-directory (getenv "WORKDIR")) (setq org-remember-templates '( ("Personal" ?p "* %U %?\n\n =C2=A0%i\n =C2=A0%a" "~/Documents/perso= nal/notes.org") ("Work Tasks" ?t "* TODO %U %?\n\n =C2=A0%i\n =C2=A0%a" "tasks.org") )) Nick