From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id iMcoHiATBGbRDgEAqHPOHw:P1 (envelope-from ) for ; Wed, 27 Mar 2024 13:37:52 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id iMcoHiATBGbRDgEAqHPOHw (envelope-from ) for ; Wed, 27 Mar 2024 13:37:52 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=g11qCOeb; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=posteo.net ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1711543072; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=9foWqMRxrkqh5Q0/51yEW7HiZsQTFUeXPSoSy+hluHk=; b=gjBcYukVW7sZx58US3FsbzGEzCp/Mt1ZwouVbRkCwahgqBQin/r5V99aTVxbp6kEIEYWQA gTIujJ18+Dgq4wtB5bllNedcDWgINcvTam97OI46BEf7FQOihUsfrSczKdW6BRPhHoJVk/ UGJfbgN4Xyyq16FRH+5x9+kJZWXxoM3W7zeqixcxIOwQjdLz6nViVznRbtHDs8qpvVQWyk gZeKaKzNURxcYP2/6H9Di0FmHnipjXOg9rTwJJ5DCmOK0fgB5pzSjoK/hGVLCzcRgh6Z5Q J11WevBFWGF4l1ckGRq84lhUpKmDVPe7e9WWNCh7kZ+VZOJPuzZ41waFf8m+9g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=g11qCOeb; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=posteo.net ARC-Seal: i=1; s=key1; d=yhetil.org; t=1711543072; a=rsa-sha256; cv=none; b=XD+d+lghv37iLnlcuAaJxP1nljoqHp8xErZC1QXVCVKS33Kim1P2fH1KjWDKqqt8vj4n9r 3nAR+57Webq/+t2ss7sEfowuE79FKw1v6VZxgw3IUA/cxWQsvK39KSHXCjE/6EkxjNrlxj BBC+aq4CncyYBDhJHiLP+BpJHaW5hhxKzwyQ1FHgunUIeH0fpDfd59TIbRjRJW/AdLxfnZ vpeXuubQGTWgHhGfP+le6uBvcNnpNbklJBL9tKZZBJ1hQkUywnxDWrOEJbFswn0HIBmS6J nhqfdwKvMIF+/JCg2cx/zoDYDgi1xTxGl4DAe9bLcPP3fyqMutzWW5OR+xyyCg== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 5302D5E384 for ; Wed, 27 Mar 2024 13:37:52 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rpSWg-0000ff-Cg; Wed, 27 Mar 2024 08:37:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rpSWe-0000bz-1m for emacs-orgmode@gnu.org; Wed, 27 Mar 2024 08:37:04 -0400 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rpSWb-0001ag-QB for emacs-orgmode@gnu.org; Wed, 27 Mar 2024 08:37:03 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 5D695240027 for ; Wed, 27 Mar 2024 13:36:59 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1711543019; bh=+Cz1c2YgrGDSFMPeWmRzEz2x+A6LWC36v45Ik1JrzFY=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: From; b=g11qCOebcfsw8iSi0S1uxMVceYwbHLvKm8VVEeOSt3SJkAoim0E1COljHJOCO/hTW WQ53XkpFQFM64AP2WIjBcaqdACsSBdjJl/M9Cf1HYXEIb3DE788Nr4lnZ+vXIPtiEQ y7YOSNUvjxbLHckCh58h8eTigy0r37/OrL/U4OjEfZYGZOXcrOarQJqk0rOynu3i1y TF7+EmA1twV8nuMdQkimVZbfCmgIiOhV4pw+nEbJUi++8jWMUDNx3a7coMA6kfAPwP VqJ8zebOxOK4syIjXiDQYS1YDY53el6mjxIPUqoIMGcMOzuCFSvoOSsXIcSGNA8W7J DtEOt58P99/bg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4V4R4p3P2Yz6tvh; Wed, 27 Mar 2024 13:36:58 +0100 (CET) From: Ihor Radchenko To: Rens Oliemans Cc: emacs-orgmode@gnu.org Subject: Re: "Bad template" when creating org-capture for table-line without '|' In-Reply-To: <87cyrg3qaa.fsf@rensoliemans.nl> References: <87cyrg3qaa.fsf@rensoliemans.nl> Date: Wed, 27 Mar 2024 12:37:04 +0000 Message-ID: <877chnc0lr.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.65; envelope-from=yantar92@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Queue-Id: 5302D5E384 X-Spam-Score: -7.04 X-Migadu-Spam-Score: -7.04 X-Migadu-Scanner: mx11.migadu.com X-TUID: 5MHTnGzg98Cm Rens Oliemans writes: > ... > However, I did not know that the _template_ also has to start with '|', and org-capture > still inserts the string "| Bad template |", which does not suggest in any way that the > lacking '|' would be the problem (after all, it is smart enough to prepend a '|'). > ... > however, is this also what's ideal? I would suggest one of the following alternatives: > > - An error is signalled to the user with the root cause of the error: no '|' at start of > template. In addition, the org-capture-templates variable documentation string and the > manual would be updated. I am happy to create a patch for this. > > - org-capture could pre- and suffix a '|' if the user did not supply it in their template. > > What are your thoughts on this? Org mode is inconsistent here. `org-capture-place-entry' uses `org-capture-verify-tree' and throws an error when the template does not start from a headline or contains headings with lower level after higher level. Yet, `org-capture-place-item' prepends "-" when the template does not start from a list item. And, as you noticed, `org-capture-place-table-line' replaces the template with "Bad template". I think that the best course of action would be automatically fixing the templates, as you propose in option (2), changing `org-capture-place-entry' to automatically prepend "* " if necessary (still leaving the subtree check though). > I am also happy to create a patch for this, however that would be my first so such a > patch would perhaps have a few iterations ;) That would be welcome. We can take as many iterations as necessary. You may refer to https://orgmode.org/worg/org-contribute.html#first-patch for instructions. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at