From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yuri Lensky Subject: Re: [Patch] Fix handling of variable capture location Date: Fri, 19 May 2017 16:37:25 -0700 Message-ID: References: <87r2znr7pn.fsf@nicolasgoaziou.fr> <87vaoxorsc.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="001a11c14c02fc60fe054fe90022" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49801) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dBrSa-0003UV-Hq for emacs-orgmode@gnu.org; Fri, 19 May 2017 19:37:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dBrSZ-0003JD-AO for emacs-orgmode@gnu.org; Fri, 19 May 2017 19:37:28 -0400 Received: from mail-it0-x236.google.com ([2607:f8b0:4001:c0b::236]:35142) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dBrSZ-0003Iz-3w for emacs-orgmode@gnu.org; Fri, 19 May 2017 19:37:27 -0400 Received: by mail-it0-x236.google.com with SMTP id c15so127025052ith.0 for ; Fri, 19 May 2017 16:37:26 -0700 (PDT) In-Reply-To: <87vaoxorsc.fsf@nicolasgoaziou.fr> 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: Nicolas Goaziou Cc: "emacs-orgmode@gnu.org" , Yuri Lensky --001a11c14c02fc60fe054fe90022 Content-Type: text/plain; charset="UTF-8" Thanks! I now understand what you mean by the second call to symbol-value not being needed. The previous behavior only chose this "branch" of the cond if symbol-value was not nil. To keep this behavior but only have one call to symbol-value, why not change to (keep the symbol-value in the cond as opposed to the body of the branch): ((and (symbolp file) (boundp file) (symbol-value file))) to keep the old behavior of the cond statement? YL On Fri, May 19, 2017 at 7:16 AM, Nicolas Goaziou wrote: > Hello, > > Yuri Lensky writes: > > > The second call is indeed needed. > > AFAICT, it isn't. > > (cond ('foo) (t nil)) => 'foo > > > This is the case fixed by the patch: > > > > (setq org-default-notes-file (expand-file-name "~/docs/notes.org")) > > (setq org-capture-templates '(("t" "Todo" entry (file+olp > > org-default-notes-file "Inbox") "* TODO %?\n%i"))) > > OK, I see. I introduced this regression in > 88a3c2483ee47b342e9bb7d2c1645dce11179bf5. > > I applied your patch with a slight change: > > ((and (symbolp file) (boundp file) (symbol-value file)) (symbol-value > file)) > > => > > ((and (symbolp file) (boundp file)) (symbol-value file)) > > Thank you. > > Regards, > > -- > Nicolas Goaziou > --001a11c14c02fc60fe054fe90022 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thanks!

I now understand what you mean = by the second call to symbol-value not being needed. The previous behavior = only chose this "branch" of the cond if symbol-value was not nil.= To keep this behavior but only have one call to symbol-value, why not chan= ge to (keep the symbol-value in the cond as opposed to the body of the bran= ch):

((and (symbolp file) (boundp file) (symbol-va= lue file)))

to keep the old behavior of the cond s= tatement?

YL

On Fri, May 19, 2017 at 7:16 AM, Nicolas Go= aziou <mail@nicolasgoaziou.fr> wrote:
Hello,

Yuri Lensky <ydl@ydl.cm> writes:
> The second call is indeed needed.

AFAICT, it isn't.

=C2=A0 (cond ('foo) (t nil)) =3D> 'foo

> This is the case fixed by the patch:
>
> (setq org-default-notes-file (expand-file-name "~/docs/notes.org"= ))
> (setq org-capture-templates '(("t" "Todo" entr= y (file+olp
> org-default-notes-file "Inbox") "* TODO %?\n%i")))=

OK, I see. I introduced this regression in
88a3c2483ee47b342e9bb7d2c1645dce11179bf5.

I applied your patch with a slight change:

=C2=A0 ((and (symbolp file) (boundp file) (symbol-value file)) (symbol-valu= e file))

=3D>

=C2=A0 ((and (symbolp file) (boundp file)) (symbol-value file))

Thank you.

Regards,

--
Nicolas Goaziou

--001a11c14c02fc60fe054fe90022--