From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Danan Subject: Re: [PATCH] No completion when querying for property value in capture template Date: Sat, 16 Jun 2018 21:59:40 +0200 Message-ID: References: <87sh5y1v2s.fsf@gmail.com> <877emykbyo.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:48631) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fUHMY-0000HK-Dh for emacs-orgmode@gnu.org; Sat, 16 Jun 2018 15:59:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fUHMV-0005Rc-An for emacs-orgmode@gnu.org; Sat, 16 Jun 2018 15:59:54 -0400 Received: from mail-it0-f67.google.com ([209.85.214.67]:35892) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fUHMV-0005R7-5d for emacs-orgmode@gnu.org; Sat, 16 Jun 2018 15:59:51 -0400 Received: by mail-it0-f67.google.com with SMTP id j135-v6so7146711itj.1 for ; Sat, 16 Jun 2018 12:59:50 -0700 (PDT) In-Reply-To: <877emykbyo.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: mail@nicolasgoaziou.fr Cc: emacs-orgmode@gnu.org Thanks. I did some testing and it seems towork except in one case: if the template target is of type "file+headline" (I guess "file+olp" etc as well), the target file has an in-buffer setting "#+PROPERTY PROP_ALL AAA BBB", and the target entry has a property ":PROP_ALL: CCC DDD" overriding the in-buffer setting, then completion is done on "AAA BBB" whereas it would make more sense to me to do it on "CCC DDD". It is perhaps not a major issue, but could be a convenient way to specify different sets of allowed values for different target entries in the same file (it already works, however, if the target file has no in-buffer setting for the allowed values). An alternative could be to allow patterns of the form "%^{prop|allowed1|allowed2|...}p" in the capture template (that would in fact be even more flexible because it would allow to specify different sets of allowed values for different capture templates with the same target entry). Eric On Sat, Jun 16, 2018 at 5:06 PM Nicolas Goaziou wrote: > > Hello, > > Eric Danan writes: > > > OK I think I understand why it doesn't work. I'm attaching a simple > > patch that hopefully solves the issue. I've put comments in the commit > > message. Please let me know if anything is not clear or if you see > > issues. > > Thank you for the analysis and the patch. As you have guessed, the > problem is that the property is set in a different buffer than the > target buffer. > > I committed a different solution. Does it fix your problem? > > Regards, > > -- > Nicolas Goaziou