From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Danan Subject: No completion when querying for property value in capture template Date: Thu, 7 Jun 2018 15:05:55 +0200 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="00000000000043054c056e0cf232" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55648) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fQucH-0007bj-9b for emacs-orgmode@gnu.org; Thu, 07 Jun 2018 09:06:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fQucC-0002ea-Ay for emacs-orgmode@gnu.org; Thu, 07 Jun 2018 09:06:13 -0400 Received: from mail-io0-f171.google.com ([209.85.223.171]:38783) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fQucC-0002e4-5U for emacs-orgmode@gnu.org; Thu, 07 Jun 2018 09:06:08 -0400 Received: by mail-io0-f171.google.com with SMTP id l19-v6so11707947ioj.5 for ; Thu, 07 Jun 2018 06:06:07 -0700 (PDT) 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: emacs-orgmode@gnu.org --00000000000043054c056e0cf232 Content-Type: text/plain; charset="UTF-8" Hello, There seems to be an old thread about this but I didn't find an answer there: http://lists.gnu.org/archive/html/emacs-orgmode/2011-10/msg01079.html If, from an org file containing two entries with respective values "foobar" and "foobaz" for property "prop", I call "org-set-property" to set property "prop", then the two values "foobar" and "foobaz" are offered as completions. But if I define a capture template with that file as target and the element "%^{prop}p" in the template, then no completetion is offered when I am queried for the property value. That makes this template element much less usable in my opinion. Is it a bug? I tested with "emacs -q" GNU Emacs 26.1 (build 1, x86_64-unknown-cygwin) of 2018-05-28 Org mode version 9.1.13 (9.1.13-elpaplus @ /c/test/.emacs.d/elpa/org-plus-contrib-20180604/) I'm happy to help with further testing if needed. Thanks in advance, Eric --00000000000043054c056e0cf232 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello,

There seems to be an = old thread about this but I didn't find an answer there:

=

If, from an org= file containing two entries with respective values "foobar" and = "foobaz" for property "prop", I call "org-set-prop= erty" to set property "prop", then the two values "foob= ar" and "foobaz" are offered as completions.

<= /div>
But if I define a capture template with that file as target and t= he element "%^{prop}p" in the template, then no completetion is o= ffered when I am queried for the property value. That makes this template e= lement much less usable in my opinion. Is it a bug?

I tested with "emacs -q"
GNU Emacs 26.1 (build 1,= x86_64-unknown-cygwin) of 2018-05-28
Org mode version 9.1.13= (9.1.13-elpaplus @ /c/test/.emacs.d/elpa/org-plus-contrib-20180604/)
=

I'm happy to help with further testing if needed.

Thanks in advance,

Eric
--00000000000043054c056e0cf232-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeremie Juste Subject: Re: No completion when querying for property value in capture template Date: Thu, 07 Jun 2018 17:21:15 +0200 Message-ID: <87sh5y1v2s.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:56576) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fQwj4-0001Ko-Vs for emacs-orgmode@gnu.org; Thu, 07 Jun 2018 11:21:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fQwj0-0008AN-W7 for emacs-orgmode@gnu.org; Thu, 07 Jun 2018 11:21:22 -0400 Received: from mail-wm0-x231.google.com ([2a00:1450:400c:c09::231]:39733) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fQwj0-00089z-Ov for emacs-orgmode@gnu.org; Thu, 07 Jun 2018 11:21:18 -0400 Received: by mail-wm0-x231.google.com with SMTP id p11-v6so19964686wmc.4 for ; Thu, 07 Jun 2018 08:21:18 -0700 (PDT) In-Reply-To: (Eric Danan's message of "Thu, 7 Jun 2018 15:05:55 +0200") 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: Eric Danan Cc: emacs-orgmode@gnu.org Hello, As far as I know it is not currently possible to get property auto-completion from the property list of the file itself. but you could still make use of the stock property in the template and auto-complete from there For instance: ("T" "TEST" entry (file+headline"/tmp/test.org" "drill") "** TEST \n :PROPERTIES:\n :Effort: %^{prompt|0:10|0:20|0:30|1:00|2:00|3:00}\n :END: \n %^{PROMPT} " ) see the rest of the thread for more details http://lists.gnu.org/archive/html/emacs-orgmode/2011-10/msg01339.html Would there be a way to for the capture template to read this info in the future? For instance to read the column format for the entire file like #+COLUMNS: %25ITEM %TAGS %PRIORITY %TODO HTH, Jeremie Eric Danan writes: > Hello, > > There seems to be an old thread about this but I didn't find an answer > there: > > http://lists.gnu.org/archive/html/emacs-orgmode/2011-10/msg01079.html > > If, from an org file containing two entries with respective values > "foobar" and "foobaz" for property "prop", I call "org-set-property" to > set property "prop", then the two values "foobar" and "foobaz" are > offered as completions. > > But if I define a capture template with that file as target and the > element "%^{prop}p" in the template, then no completetion is offered when > I am queried for the property value. That makes this template element > much less usable in my opinion. Is it a bug? > > I tested with "emacs -q" > GNU Emacs 26.1 (build 1, x86_64-unknown-cygwin) of 2018-05-28 > Org mode version 9.1.13 (9.1.13-elpaplus @ /c/test/.emacs.d/elpa/ > org-plus-contrib-20180604/) > > I'm happy to help with further testing if needed. > > Thanks in advance, > > Eric From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Danan Subject: Re: No completion when querying for property value in capture template Date: Thu, 7 Jun 2018 23:18:19 +0200 Message-ID: References: <87sh5y1v2s.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000003fb3a8056e13d3ec" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47095) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fR2In-0000jR-1T for emacs-orgmode@gnu.org; Thu, 07 Jun 2018 17:18:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fR2Ii-0002Ps-6F for emacs-orgmode@gnu.org; Thu, 07 Jun 2018 17:18:36 -0400 Received: from mail-io0-f170.google.com ([209.85.223.170]:46162) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fR2Ih-0002LW-Si for emacs-orgmode@gnu.org; Thu, 07 Jun 2018 17:18:32 -0400 Received: by mail-io0-f170.google.com with SMTP id d22-v6so13485751iof.13 for ; Thu, 07 Jun 2018 14:18:31 -0700 (PDT) In-Reply-To: <87sh5y1v2s.fsf@gmail.com> 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: =?UTF-8?B?SsOpcsOpbWllIEp1c3Rl?= Cc: emacs-orgmode@gnu.org --0000000000003fb3a8056e13d3ec Content-Type: text/plain; charset="UTF-8" Thanks. As far as I know it is not currently possible to get property > auto-completion from the property list of the file itself. > I don't understand: when I call "org-set-property" directly from the file (C-c C-x p), it does get all the property values in the file and proposes them for completion. I am probably missing your pint, could I ask you to explain? Only when I use the "%^{prop}p" capture template element are the values not offered. I don't understand why because looking at the code of "org-capture-fill-template", it seems to simply call "org-set-property" for this element. but you could still make use of the stock property in the template and > auto-complete > from there > > For instance: > > ("T" "TEST" entry (file+headline"/tmp/test.org" "drill") > "** TEST \n :PROPERTIES:\n :Effort: > %^{prompt|0:10|0:20|0:30|1:00|2:00|3:00}\n :END: \n %^{PROMPT} " ) > > see the rest of the thread for more details > http://lists.gnu.org/archive/html/emacs-orgmode/2011-10/msg01339.html > Yes I've read the rest of the thread, but that's not always feasible. In my use case, the property values are titles of academic journals, I can't list them all inside a "%^{prompt}" template element, I need them to be fetched from the file. Thanks again. Eric --0000000000003fb3a8056e13d3ec Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thanks.

As far as I know it is not currently possible to get property
auto-completion from the property list of the file itself.
=

I don't understand: when I call "org-set-prope= rty" directly from the file (C-c C-x p), it does get all the property = values in the file and proposes them for completion. I am probably missing = your pint, could I ask you to explain?

Only when I= use the "%^{prop}p" capture template element are the values not = offered. I don't understand why because looking at the code of "or= g-capture-fill-template", it seems to simply call "org-set-proper= ty" for this element.

but you could still make use of the stock property in the template and auto= -complete
from there

For instance:

("T" "TEST" entry (file+headline"/tmp/test.org" &qu= ot;drill")
=C2=A0 =C2=A0 =C2=A0 =C2=A0 "** TEST=C2=A0 \n :PROPERTIES:\n :Effort: = %^{prompt|0:10|0:20|0:30|1:00|2:00|3:00}\n :END: \n %^{PROMPT} " )

see the rest of the thread for more details http://lists.gnu.org/archive/html/emacs-orgmode/2011-10/msg013= 39.html

Yes I've read the rest of the thread, = but that's not always feasible. In my use case, the property values are= titles of academic journals, I can't list them all inside a "%^{p= rompt}" template element, I need them to be fetched from the file.

Thanks again.

Eric
=
--0000000000003fb3a8056e13d3ec-- 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: Fri, 8 Jun 2018 22:29:25 +0200 Message-ID: References: <87sh5y1v2s.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="0000000000003c9959056e2742a5" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:52563) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fRO10-0005ns-ER for emacs-orgmode@gnu.org; Fri, 08 Jun 2018 16:29:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fRO0x-000669-9T for emacs-orgmode@gnu.org; Fri, 08 Jun 2018 16:29:42 -0400 Received: from mail-it0-f67.google.com ([209.85.214.67]:33773) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fRO0x-00065d-1X for emacs-orgmode@gnu.org; Fri, 08 Jun 2018 16:29:39 -0400 Received: by mail-it0-f67.google.com with SMTP id k17-v6so5972461ita.0 for ; Fri, 08 Jun 2018 13:29:38 -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: =?UTF-8?B?SsOpcsOpbWllIEp1c3Rl?= Cc: emacs-orgmode@gnu.org --0000000000003c9959056e2742a5 Content-Type: text/plain; charset="UTF-8" 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. Eric On Thu, Jun 7, 2018 at 11:18 PM Eric Danan wrote: > > Thanks. > >> As far as I know it is not currently possible to get property >> auto-completion from the property list of the file itself. > > > I don't understand: when I call "org-set-property" directly from the file (C-c C-x p), it does get all the property values in the file and proposes them for completion. I am probably missing your pint, could I ask you to explain? > > Only when I use the "%^{prop}p" capture template element are the values not offered. I don't understand why because looking at the code of "org-capture-fill-template", it seems to simply call "org-set-property" for this element. > >> but you could still make use of the stock property in the template and auto-complete >> from there >> >> For instance: >> >> ("T" "TEST" entry (file+headline"/tmp/test.org" "drill") >> "** TEST \n :PROPERTIES:\n :Effort: %^{prompt|0:10|0:20|0:30|1:00|2:00|3:00}\n :END: \n %^{PROMPT} " ) >> >> see the rest of the thread for more details http://lists.gnu.org/archive/html/emacs-orgmode/2011-10/msg01339.html > > > Yes I've read the rest of the thread, but that's not always feasible. In my use case, the property values are titles of academic journals, I can't list them all inside a "%^{prompt}" template element, I need them to be fetched from the file. > > Thanks again. > > Eric --0000000000003c9959056e2742a5 Content-Type: application/x-patch; name="0001-org-capture.el-Offer-property-value-completions-in-c.patch" Content-Disposition: attachment; filename="0001-org-capture.el-Offer-property-value-completions-in-c.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_ji6f15jk0 RnJvbSA1ZGQ5YzViNTRkMzJhZjEwMjNlYjJlYTg0ZDhhZDcwMmNhZTMzMDdlIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBFcmljIERhbmFuIDxlcmljLmRhbmFuQHUtY2VyZ3kuZnI+CkRh dGU6IEZyaSwgOCBKdW4gMjAxOCAxNjoyNjoyMSArMDIwMApTdWJqZWN0OiBbUEFUQ0hdIG9yZy1j YXB0dXJlLmVsOiBPZmZlciBwcm9wZXJ0eSB2YWx1ZSBjb21wbGV0aW9ucyBpbiBjYXB0dXJlCiB0 ZW1wbGF0ZQoKKiBsaXNwL29yZy1jYXB0dXJlLmVsIChvcmctY2FwdHVyZS1maWxsLXRlbXBsYXRl KTogV2hlbiByZWFkaW5nIGEKICBwcm9wZXJ0eSdzIHZhbHVlIGZvciBhIGAlXntwcm9wfXAnIHRl bXBsYXRlIGVsZW1lbnQsIG9mZmVyCiAgY29tcGxldGlvbnMgb24gdGhlIHByb3BlcnR5J3MgYWxs b3dlZCBvciBleGlzdGluZyB2YWx1ZXMuCgpUaGlzIGlzIGRvbmUgYnkgdGVtcG9yYXJpbHkgcHJl cGVuZGluZyB0byB0aGUgdmFyaWFibGUKYG9yZy1maWxlLXByb3BlcnR5JyBhbmQgZW50cnkgYChw cm9wX2FsbCAuIHZhbHMpJyB3aGVyZSB2YWxzIGlzIGVpdGhlcgp0aGUgbG9jYWwgb3IgaW5oZXJp dGVkIHZhbHVlIG9mIGBwcm9wX2FsbCcgYXQgdGhlIHRhcmdldCBsb2NhdGlvbiBvciwKaWYgdGhh dCBpcyBuaWwsIHRoZSBzZXQgb2YgbG9jYWwgdmFsdWVzIG9mIGBwcm9wJyBpbiB0aGUgdGFyZ2V0 CmJ1Z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h1cGNhc2U/IChlcXVhbCAodXBjYXNlIGtleSkga2V5KSkKLS0gCjIuMTcuMAoK --0000000000003c9959056e2742a5-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [PATCH] No completion when querying for property value in capture template Date: Sat, 16 Jun 2018 17:06:23 +0200 Message-ID: <877emykbyo.fsf@nicolasgoaziou.fr> References: <87sh5y1v2s.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58952) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fUCmc-0007jq-Pu for emacs-orgmode@gnu.org; Sat, 16 Jun 2018 11:06:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fUCmZ-0003LT-LQ for emacs-orgmode@gnu.org; Sat, 16 Jun 2018 11:06:30 -0400 Received: from relay8-d.mail.gandi.net ([217.70.183.201]:41511) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fUCmZ-0003JO-Ea for emacs-orgmode@gnu.org; Sat, 16 Jun 2018 11:06:27 -0400 In-Reply-To: (Eric Danan's message of "Fri, 8 Jun 2018 22:29:25 +0200") 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: Eric Danan Cc: emacs-orgmode@gnu.org 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 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [PATCH] No completion when querying for property value in capture template Date: Sat, 16 Jun 2018 23:24:17 +0200 Message-ID: <87po0qifwe.fsf@nicolasgoaziou.fr> References: <87sh5y1v2s.fsf@gmail.com> <877emykbyo.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:32991) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fUIgN-0008F8-B7 for emacs-orgmode@gnu.org; Sat, 16 Jun 2018 17:24:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fUIgI-0005z6-E9 for emacs-orgmode@gnu.org; Sat, 16 Jun 2018 17:24:27 -0400 Received: from relay11.mail.gandi.net ([217.70.178.231]:36669) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fUIgI-0005wc-85 for emacs-orgmode@gnu.org; Sat, 16 Jun 2018 17:24:22 -0400 In-Reply-To: (Eric Danan's message of "Sat, 16 Jun 2018 21:59:40 +0200") 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: Eric Danan Cc: emacs-orgmode@gnu.org Eric Danan writes: > 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". I think this is now fixed. Thank you. 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: Sun, 17 Jun 2018 11:33:49 +0200 Message-ID: References: <87sh5y1v2s.fsf@gmail.com> <877emykbyo.fsf@nicolasgoaziou.fr> <87po0qifwe.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]:54723) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fUU4Q-00074O-Fb for emacs-orgmode@gnu.org; Sun, 17 Jun 2018 05:34:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fUU4N-0006OZ-C7 for emacs-orgmode@gnu.org; Sun, 17 Jun 2018 05:34:02 -0400 Received: from mail-io0-f178.google.com ([209.85.223.178]:45455) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fUU4N-0006OP-73 for emacs-orgmode@gnu.org; Sun, 17 Jun 2018 05:33:59 -0400 Received: by mail-io0-f178.google.com with SMTP id l25-v6so14302837ioh.12 for ; Sun, 17 Jun 2018 02:33:58 -0700 (PDT) In-Reply-To: <87po0qifwe.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 Indeed it works now, thanks! On Sat, Jun 16, 2018 at 11:24 PM Nicolas Goaziou wrote: > > Eric Danan writes: > > > 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". > > I think this is now fixed. Thank you.