From mboxrd@z Thu Jan 1 00:00:00 1970 From: Klarre N Subject: Re: Bug: Org Capture with Concatenated filenames [9.0 (9.0-elpa @ .emacs.d/elpa/org-20161102/)] Date: Fri, 4 Nov 2016 23:45:11 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=94eb2c0558bc7589100540816ee7 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:51417) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c2nEs-0002vz-V1 for emacs-orgmode@gnu.org; Fri, 04 Nov 2016 18:45:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c2nEr-0006SW-CY for emacs-orgmode@gnu.org; Fri, 04 Nov 2016 18:45:35 -0400 Received: from mail-yb0-x229.google.com ([2607:f8b0:4002:c09::229]:36152) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c2nEq-0006RA-Vx for emacs-orgmode@gnu.org; Fri, 04 Nov 2016 18:45:33 -0400 Received: by mail-yb0-x229.google.com with SMTP id v78so37414265ybe.3 for ; Fri, 04 Nov 2016 15:45:32 -0700 (PDT) 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" To: Kaushal Modi , emacs-orgmode@gnu.org --94eb2c0558bc7589100540816ee7 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Thanks for the quick answer! Oh I see, could you please provide an example how to write such a function wrapper (I am new to Elisp)? I defined several variables to directories where I have org-files, and capture to one or more files in those directories, for example: (defvar logs "path-to-logs/") then capture to logs.org, events.org and services.org in that directory. How could I do that with a function wrapper= ? Thanks you! On Fri, Nov 4, 2016 at 11:36 PM, Kaushal Modi wrote: > Hi Klarre, > > The org 9.0 release had deprecated use of S-exps in org-capture-templates= . > That, though, went undocumented. So for now, that deprecation is reverted > on the main branch and moved to the master/dev branch. > > http://orgmode.org/cgit.cgi/org-mode.git/commit/?id=3D > f5645675a336d8f56fa9e6bd63832bdbac71f315 > > So when org stable next updates on Elpa (probably on Monday?), that will > have this reverted commit in it. But going forward, when org 9.1 is > released, the use of S-exp will once again be deprecated. So it would be > best to replace that S-exp with a function wrapper. > > On Fri, Nov 4, 2016 at 6:19 PM Klarre N wrote: > >> Hi, >> concatenated filenames for org-capture templates no longer works (since >> 9.0). >> >> ECM: >> (setq org-default-notes-file "absolute-path/default.org") >> (defvar absolute "absolute-path/" >> "Path to Desired directory.") >> (setq org-capture-templates '( >> ("e" "Example" entry >> (file+headline (concat absolute "example.org") "Example") >> "* Capture" >> :empty-lines 1))) >> >> Expected result: >> Add "* Capture" to absolute-path/example.org. >> >> Result: "* Capture" is added to "absolute-path/default.org". >> >> This provides the desired result, but unable to use variable filenames >> (very useful): >> (setq org-default-notes-file "absolute-path/default.org") >> (setq org-capture-templates '( >> ("e" "Example" entry >> (file+headline "absolute-path/example.org" "Example") >> "* Capture" >> :empty-lines 1))) >> >> >> Thanks! >> > -- > > Kaushal Modi > --=20 Med v=C3=A4nliga h=C3=A4lsningar Klaus --94eb2c0558bc7589100540816ee7 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Thanks for the quick answer!
Oh I see, could you please provide an ex= ample how to write such a function wrapper (I am new to Elisp)?
I defined se= veral variables to directories where I have org-files, and capture to one o= r more files in those directories, for example:
(defvar logs <= /span>"path-to-logs/") then capture to logs.org, events.org and services.org in that directory. How could = I do that with a function wrapper?

Thanks you!

On Fri, Nov 4, 2016 at 11:3= 6 PM, Kaushal Modi <kaushal.modi@gmail.com> wrote:
<= blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px= #ccc solid;padding-left:1ex">
Hi Klarre,

The org 9.0 release had deprecated use of S-exps in org-capture-templates= . That, though, went undocumented. So for now, that deprecation is reverted= on the main branch and moved to the master/dev branch.


So when org stable next up= dates on Elpa (probably on Monday?), that will have this reverted commit in= it. But going forward, when org 9.1 is released, the use of S-exp will onc= e again be deprecated. So it would be best to replace that S-exp with a fun= ction wrapper.

On Fri, Nov 4, 2016 at 6:19 PM Klarre N <klarre@gmail.com> wrote:=
Hi,
concatenated filenames for org-capture templates no longer wo= rks (since 9.0).

ECM:(setq org-default-notes-file &quo= t;absolute-path/default.org")
(defvar absolute "absolute-path/"
=C2=A0=C2=A0=C2=A0 "Path to Desire= d directory.")
(setq org-c= apture-templates '(
=C2=A0 = ("e" "Example" entry
=C2=A0=C2=A0 (file+headline (concat absolute "example.org") "Example")
=C2=A0=C2=A0 "* Capture"
=C2=A0=C2=A0 :empty-lines 1)))

Expected result:
Add "* Capture"= to absolute-path/example.org.

Result: &qu= ot;* Capture" is added to "absolute-path/default.o= rg".

This provides the desired result,= but unable to use variable filenames (very useful):
(setq org-default-notes-file "absolute-path/default.org")
(setq= org-capture-templates '(
= =C2=A0 ("e" "Example" entry
=C2=A0=C2=A0 (file+headline "absolute-path/example.org" "Example")
=C2=A0=C2=A0 "* Capture"
=C2=A0=C2=A0 :empty-lines 1)))


Thanks!
--

Kaushal Modi




--
<= div>
Med v=C3=A4n= liga h=C3=A4lsningar
Klaus
--94eb2c0558bc7589100540816ee7--