From mboxrd@z Thu Jan 1 00:00:00 1970 From: Narendra Joshi Subject: Re: Dynamic Org-capture Templates Date: Sat, 04 Nov 2017 12:43:51 +0530 Message-ID: <874lqa5xe8.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:36227) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eAseY-0006yb-1g for emacs-orgmode@gnu.org; Sat, 04 Nov 2017 03:14:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eAseT-0006RV-3G for emacs-orgmode@gnu.org; Sat, 04 Nov 2017 03:14:02 -0400 Received: from mail-pg0-x243.google.com ([2607:f8b0:400e:c05::243]:46820) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eAseS-0006R7-Tn for emacs-orgmode@gnu.org; Sat, 04 Nov 2017 03:13:57 -0400 Received: by mail-pg0-x243.google.com with SMTP id k7so4272804pga.3 for ; Sat, 04 Nov 2017 00:13:56 -0700 (PDT) In-Reply-To: (Eric Thomas's message of "Fri, 3 Nov 2017 17:32:07 -0700") 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 Thomas Cc: emacs-orgmode@gnu.org Eric Thomas writes: > Does anyone know how to approach creating dynamic Org-capture > templates? I'm looking for IDO/Helm type of completion after a > template has been selected. If string does not exist, it is created > and added to future completions, similar to new files in emacs. > > Example: > > C-c c > "a" (activity) > Activity: math (<--need completion here) > Topic: multiplication (<--need completion here) > Date: 2017-09-11 (<--need default to todays date) > Start time: 07:00 AM (<--need to define AM/PM easily) > Duration: 20 (<--easier way to capture time?) > Unit: mins > > And > > C-c c > "a" (activity) > Activity: physical education (<--again, completion starts as "ph.." is typed) > Type: Yoga (<--completion) > Class: Level 2 flow (<--completion) > Date: 2017-09-11 (<--date picker of some kind) > Start time: 07:00 AM (<--define AM/PM easily) > Duration: 90 (<--easy method for capturing time) > Unit: mins > > > Maybe Org-capture templates are not the correct way to approach this? > Any direction is appreciated. >From doc string for `org-capture-templates`: %^{prompt} Prompt the user for a string and replace this sequence with it. A default value and a completion table ca be specified like this: %^{prompt|default|completion2|completion3|...}. I think to get completion you would need to dynamically build the value for `org-capture-templates` which would include the completion candidates for reach field. I think that's not a great way to do it. Someone else can suggest a better way, I think. -- Narendra Joshi