From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: set remember default file to be originating .org file Date: Wed, 3 Sep 2008 11:36:52 +0200 Message-ID: <3C0C6078-B259-4390-A00B-56ECCE9C3E99@uva.nl> References: <73kku8$832p@dmzms99901.na.baesystems.com> Mime-Version: 1.0 (Apple Message framework v926) Content-Type: multipart/mixed; boundary="===============0306144920==" Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KaonO-0005RJ-Dd for emacs-orgmode@gnu.org; Wed, 03 Sep 2008 05:37:02 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KaonL-0005Oz-O2 for emacs-orgmode@gnu.org; Wed, 03 Sep 2008 05:37:00 -0400 Received: from [199.232.76.173] (port=56492 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KaonL-0005OS-9A for emacs-orgmode@gnu.org; Wed, 03 Sep 2008 05:36:59 -0400 Received: from ug-out-1314.google.com ([66.249.92.171]:49629) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KaonK-0005gQ-Sp for emacs-orgmode@gnu.org; Wed, 03 Sep 2008 05:36:59 -0400 Received: by ug-out-1314.google.com with SMTP id m2so2428766uge.17 for ; Wed, 03 Sep 2008 02:36:58 -0700 (PDT) In-Reply-To: <73kku8$832p@dmzms99901.na.baesystems.com> 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: "Sullivan, Gregory (US SSA)" Cc: emacs-orgmode@gnu.org --===============0306144920== Content-Type: multipart/alternative; boundary=Apple-Mail-15--538239226 --Apple-Mail-15--538239226 Content-Type: text/plain; charset=WINDOWS-1252; format=flowed; delsp=yes Content-Transfer-Encoding: quoted-printable I applied, this patch, thank you very much. - Carsten P.S. Next time, please do a diff -u, this makes it easier for me to check =20 things. On Aug 6, 2008, at 10:54 PM, Sullivan, Gregory (US SSA) wrote: > OK =96 I did the following. I allow for functions in the filename =20 > positions of templates, changing org-remember.el as follows: > > > diff ../../org-6.05b/lisp/org-remember.el ./org-remember.el > 321,322c321 > < (file (if (and (nth 1 entry) (stringp (nth 1 entry)) > < (string-match "\\S-" (nth 1 entry))) > --- > > (file (if (nth 1 entry) > 351a351,353 > > (when (functionp file) > > (setq file (funcall file)) > > (message "after funcall file, file =3D [%S]" file)) > ~/emacs/org/lisp > > > > So my remember template list includes: > > ("Todo (local)" ?t "* TODO %? %i\n" > ,(lambda () (buffer-file-name org-select-template-original-=20 > buffer)) > > So if I invoke org-remember and choose =93t=94, it will save the =20 > resulting TODO item in the file from which I invoked remember. > > Could be made more robust, but it works for me. > Let me know if you think this might be generally useful. > > --Greg > -- > Gregory T. Sullivan, Ph.D. > BAE Systems Advanced Information Technologies > 6 New England Executive Park, Burlington, MA 01803 > 781-262-4553 (office), 978-430-3461 (cell) > gregory.sullivan@baesystems.com > ________________________________________ > From: = emacs-orgmode-bounces+gregory.sullivan=3Dbaesystems.com@gnu.org[mailto:ema= cs-orgmode-bounces+gregory.sullivan=3Dbaesystems.com@gnu.org=20 > ] On Behalf Of Sullivan, Gregory (US SSA) > Sent: Wednesday, August 06, 2008 11:55 AM > To: emacs-orgmode@gnu.org > Subject: [Orgmode] set remember default file to be originating .org =20= > file > > If I invoke remember from a .org file, e.g. =93foo.org=94, I would = like =20 > the default file to which the remembered note is saved to be that =20 > file, =93foo.org=94. > > I work on several projects at a time, and the project mix changes =20 > monthly. While on a project, I generate lots of project-specific =20 > notes and TODOs. So, I like to have project-specific .org files. > > Any ideas appreciated. > Thanks. > --Greg > -- > Gregory T. Sullivan, Ph.D. > BAE Systems Advanced Information Technologies > 6 New England Executive Park, Burlington, MA 01803 > 781-262-4553 (office), 978-430-3461 (cell) > gregory.sullivan@baesystems.com > > _______________________________________________ > Emacs-orgmode mailing list > Remember: use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode --Apple-Mail-15--538239226 Content-Type: text/html; charset=WINDOWS-1252 Content-Transfer-Encoding: quoted-printable I applied, this patch, thank = you very much.

- = Carsten

P.S.

Next = time, please do a diff -u, this makes it easier for me to check = things.

On Aug 6, 2008, at 10:54 PM, Sullivan, = Gregory (US SSA) wrote:

OK =96 I did the following.  = I allow for functions in the filename positions of templates, changing = org-remember.el as follows:
> diff = ../../org-6.05b/lisp/org-remember.el = ./org-remember.el
<    =      (file (if (and (nth 1 entry) (stringp (nth = 1 entry))
< =             &n= bsp;     (string-match "\\S-" (nth 1 = entry)))
>    =      (file (if (nth 1 = entry)
>    = (when (functionp file)
>    =   (message "after funcall file, file =3D [%S]" = file))
So my remember template list = includes:
     ("Todo = (local)" ?t "* TODO %? %i\n"
So if I invoke org-remember and = choose =93t=94, it will save the resulting TODO item in the file from = which I invoked remember.
Could be made more robust, but it = works for me.
Let me know if = you think this might be generally = useful.
Gregory T. Sullivan, = Ph.D.
BAE Systems Advanced Information = Technologies