From mboxrd@z Thu Jan 1 00:00:00 1970 From: No Wayman Subject: [Patch] Document org-capture-templates entry type default strings Date: Tue, 31 Mar 2020 17:46:29 -0400 Message-ID: <87a73wnqoa.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; format=flowed Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:42034) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jJOiV-0007SB-Ln for emacs-orgmode@gnu.org; Tue, 31 Mar 2020 17:46:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jJOiU-0007pU-48 for emacs-orgmode@gnu.org; Tue, 31 Mar 2020 17:46:39 -0400 Received: from mail-qt1-x841.google.com ([2607:f8b0:4864:20::841]:40794) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jJOiS-0007jL-C2 for emacs-orgmode@gnu.org; Tue, 31 Mar 2020 17:46:36 -0400 Received: by mail-qt1-x841.google.com with SMTP id y25so935065qtv.7 for ; Tue, 31 Mar 2020 14:46:32 -0700 (PDT) Received: from arch ([2601:8b:c300:1024:1266:d0ff:1635:f964]) by smtp.gmail.com with ESMTPSA id y21sm160818qka.37.2020.03.31.14.46.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Mar 2020 14:46:30 -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-mx.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org I've included the default entry type strings for each entry type in org-capture-tempalte's docstring. Made a couple clarifying edits as well. IMO this is better than having the user hunt for the defaults in the source or experimenting by creating each type of template: diff --git a/lisp/org-capture.el b/lisp/org-capture.el index d292defd6..ac4d633cb 100644 --- a/lisp/org-capture.el +++ b/lisp/org-capture.el @@ -159,14 +159,20 @@ description A short string describing the template, will be shown during type The type of entry. Valid types are: entry an Org node, with a headline. Will be filed as the child of the target entry or as a - top-level entry. + top-level entry. Its default template is: + \"* %?\n %a\" item a plain list item, will be placed in the - first plain list at the target - location. + first plain list at the target location. + Its default template is: + \"- %?\" checkitem a checkbox item. This differs from the plain list item only in so far as it uses a - different default template. + different default template. Its default + template is: + \"- [ ] %?\" table-line a new line in the first table at target location. + Its default template is: + \"| %? |\" plain text to be inserted as it is. target Specification of where the captured item should be placed. @@ -214,9 +220,10 @@ target Specification of where the captured item should be placed. Most general way: write your own function which both visits the file and moves point to the right location -template The template for creating the capture item. If you leave this - empty, an appropriate default template will be used. See below - for more details. Instead of a string, this may also be one of +template The template for creating the capture item. + If it is an empty string or nil, a default template based on + the entry type will be used (see the \"type\" section above). + Instead of a string, this may also be one of: (file \"/path/to/template-file\") (function function-returning-the-template) ===File /mnt/data/programming/repos/org-mode/0001-Document-entry-type-default-template-strings.patch=== >From 1b91f8ad184d191e1ee09e79e150d7f51c0c3b18 Mon Sep 17 00:00:00 2001 From: Nicholas Vollmer Subject: [PATCH] Document entry type default template strings --- lisp/org-capture.el | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/lisp/org-capture.el b/lisp/org-capture.el index d292defd6..ac4d633cb 100644 --- a/lisp/org-capture.el +++ b/lisp/org-capture.el @@ -159,14 +159,20 @@ description A short string describing the template, will be shown during type The type of entry. Valid types are: entry an Org node, with a headline. Will be filed as the child of the target entry or as a - top-level entry. + top-level entry. Its default template is: + \"* %?\n %a\" item a plain list item, will be placed in the - first plain list at the target - location. + first plain list at the target location. + Its default template is: + \"- %?\" checkitem a checkbox item. This differs from the plain list item only in so far as it uses a - different default template. + different default template. Its default + template is: + \"- [ ] %?\" table-line a new line in the first table at target location. + Its default template is: + \"| %? |\" plain text to be inserted as it is. target Specification of where the captured item should be placed. @@ -214,9 +220,10 @@ target Specification of where the captured item should be placed. Most general way: write your own function which both visits the file and moves point to the right location -template The template for creating the capture item. If you leave this - empty, an appropriate default template will be used. See below - for more details. Instead of a string, this may also be one of +template The template for creating the capture item. + If it is an empty string or nil, a default template based on + the entry type will be used (see the \"type\" section above). + Instead of a string, this may also be one of: (file \"/path/to/template-file\") (function function-returning-the-template) -- 2.26.0 ============================================================