From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id cM72Bmr5A2YnXAAA62LTzQ:P1 (envelope-from ) for ; Wed, 27 Mar 2024 11:48:10 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id cM72Bmr5A2YnXAAA62LTzQ (envelope-from ) for ; Wed, 27 Mar 2024 11:48:10 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=rensoliemans.nl header.s=soverin header.b=JppwCAwV; 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=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1711536490; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=zj+L1wz2jHtihbB5DJ9jqnmtVaaqkaiLr0rDdWp2nVw=; b=kmq5Mnr7xKyEAeFAWSQhCBopGDaC6SAfDGhB498gK7NV4YXdcjxupstNiNk94F3SJkbZSF 6YINS+dNUGilRpWAf/l+rh/Dd1eUCjAo0kH752C4MCU6XxJq9+HcJvlZFyiANcL5jezr+u Xo60Vc+vQuZmORd6dH0goeNbNfSACNNUiBYA4/IGZEc3N9Dkpbh4pLLahW2LccEr+IxajH 7jvViJKjXRoUySMxiVBKSIRJkBh9mk2r5NR5obYSgx9KQFX7hIq2O9B27QGqcjNeaN6Pih ylXe4BmqpE9cGuQoFrp6rksN8jAAeKChngZbIZm4koGuwEjXp0zJRQpOjZeK5g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=rensoliemans.nl header.s=soverin header.b=JppwCAwV; 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=none ARC-Seal: i=1; s=key1; d=yhetil.org; t=1711536490; a=rsa-sha256; cv=none; b=sTuS5rwZfAumIxp8XXyH1ZRIT7n9+DgelrYCLHKloKm44IMS+xDLEHYWFJ+ujObqxQ+44+ DE2WpfCYwFXYreIVryIzAPNPvFNZJGqM09bk+6hoCCUex+cgBj9ILDl/F73T0X/H41xUEh vEm6mB930JS81wzGEVYLPllDHJyC9vwq7IsdPD6KKfcwHheyf3z4AKKuVyj1Cz7v6KTmgb 7KbrpX3Peqc7kMhwltQlPKrGRqR6DowjYj11ngQZQv5xiZh9MTJuchnjg6xc5vfByKy13k xGFKJnY1Nd9WNvHLqwuflww20Mrnb3emSo1PArLOItTTKbxFRQYUwIOp63+ivA== 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 CEB9075C9E for ; Wed, 27 Mar 2024 11:48:09 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rpQoZ-0006po-Mb; Wed, 27 Mar 2024 06:47:27 -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 1rpQoU-0006pY-V2 for emacs-orgmode@gnu.org; Wed, 27 Mar 2024 06:47:23 -0400 Received: from outbound.soverin.net ([2a10:de80:1:4091:b9e9:2214:0:1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rpQoR-0005CO-A8 for emacs-orgmode@gnu.org; Wed, 27 Mar 2024 06:47:21 -0400 Received: from smtp.soverin.net (c04cst-smtp-sov01.int.sover.in [10.10.4.99]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by outbound.soverin.net (Postfix) with ESMTPS id 4V4Nf729wyz1f for ; Wed, 27 Mar 2024 10:47:11 +0000 (UTC) Received: from smtp.soverin.net (smtp.soverin.net [10.10.4.99]) by soverin.net (Postfix) with ESMTPSA id 4V4Nf56Wphz49 for ; Wed, 27 Mar 2024 10:47:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=rensoliemans.nl; s=soverin; t=1711536431; bh=1KO8p1qmJ7YX8Bcf0PQxoODCFiJv41ODblKWkGagBdE=; h=From:To:Subject:Date:From; b=JppwCAwVUC92wV/KKwg3H31t/04Ytqxsr7dqf2pTEE4iK3MuaPNyBGni8LSe2ULM0 Ggn48rGvm1GsVkUEJp4su0SbhVm8HG+qh+yhMk+orDkp7kSD5ApGcixAGXn7r599kY tdT5JPuK4SGCfcm6JSO178HszQGAo7E1y/D/2U2WRV2qnIYdEUw1aOejJNjtFljOqJ lb0nj9q9TV8Xy18tFM1xDtEoRl44GbuIamhBJt2/+dAC9BPmik38F9Ko9vWXSmHkDr JAegE4WzZAW/EyZE6kEHIguShfVMXGC66QuJGVEqAYdN842K8kYpNSHF9RXygE8vcP 7lvSinp1C5Wvg== From: Rens Oliemans To: emacs-orgmode@gnu.org Subject: "Bad template" when creating org-capture for table-line without '|' Date: Wed, 27 Mar 2024 11:47:09 +0100 Message-ID: <87cyrg3qaa.fsf@rensoliemans.nl> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2a10:de80:1:4091:b9e9:2214:0:1; envelope-from=hallo@rensoliemans.nl; helo=outbound.soverin.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, SPF_HELO_PASS=-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-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Queue-Id: CEB9075C9E X-Spam-Score: -2.45 X-Migadu-Spam-Score: -2.45 X-Migadu-Scanner: mx10.migadu.com X-TUID: 6ifG06VQ1X7a Hi, I was trying to create an org-capture for a table-line type, and I noticed that org-capture inserts the string "| Bad template |" when the template does not start with '|'. This could make sense, since a line is (only) considered part of a table when it starts with '|'. 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 '|'). Use this template to reproduce the behaviour, present on 9.7-pre (release_9.6.23-1318-g990b89): (setq org-capture-templates '(("t" "Test" table-line (file "test.org") "%^t"))) I did not see this documented anywhere: this was quite confusing, and the only way I got a hint at what I did wrong was to see the default template for table-line: "| %? |". It seems that this behaviour is intended, looking at org-capture.el:1358 @ 990b89d3: ... (pcase (org-trim (org-capture-get :template)) ((pred (string-match-p org-table-border-regexp)) "| %?Bad template |") (text (concat text "\n")))) ... 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. 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 ;) What are your thoughts on this? Best