From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id iDm3GA5PN2JMMAAAgWs5BA (envelope-from ) for ; Sun, 20 Mar 2022 16:58:06 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id gE1TEQ5PN2KAugAAG6o9tA (envelope-from ) for ; Sun, 20 Mar 2022 16:58:06 +0100 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 DB92C3BD9F for ; Sun, 20 Mar 2022 16:58:05 +0100 (CET) Received: from localhost ([::1]:41074 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nVxwS-00038Z-Rr for larch@yhetil.org; Sun, 20 Mar 2022 11:58:04 -0400 Received: from eggs.gnu.org ([209.51.188.92]:45984) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nVxvW-00038Q-Kc for emacs-orgmode@gnu.org; Sun, 20 Mar 2022 11:57:06 -0400 Received: from [2607:f8b0:4864:20::f2e] (port=40541 helo=mail-qv1-xf2e.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nVxvU-0004gs-RK for emacs-orgmode@gnu.org; Sun, 20 Mar 2022 11:57:06 -0400 Received: by mail-qv1-xf2e.google.com with SMTP id gm1so9951704qvb.7 for ; Sun, 20 Mar 2022 08:57:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=PD9cKEF8ZiqXQLYJRUDxDNdf512wsHCkYPyRUNL3H+A=; b=mG6kP4wT+0M8QW2ULt0XlxjjL7t11pWgKD6hUt/5vhemHAcfKLiePTUxAYykB4G+q4 B0qd7EexKJnTYcIXwzV1LXsfW6cq7Zjc/Fk1Lp3pr4jFlqMKolQW+HqR72aV9KccF+c0 f/+VpjIMKboUNjihmLzxv3Wucb8qV1jJbdh6TLSl49uk7AGkpmyQbKrE9Vc2XGO5vUmG OVgdCTrldb0K3BCm/nYscVLbFOneGo2/7feZL+kvN2o/6kgVas7r8Tduv5zTQssH5xza O8LXNvYy0FFcfkJ5zu3xILDlzo+aSwxS9lTHhdrKXms56KeOsmXNG3RutV1WC803OOnC Wklw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=PD9cKEF8ZiqXQLYJRUDxDNdf512wsHCkYPyRUNL3H+A=; b=wPaQ6S9XyFFeTuipMClI07GrXe0y5L2z8R3jvH0HB0xOaddTDz7zbw0m78PEMWWrWL yV1AMINnrG51/49F9RXftWCiIWX+pYP66na4+NG7NhSskpjagjnp4xeTlmXHpe+99u6C fWzQGO7Eu1025G8XKM8dK5sMJdcCtM5t5kfiFCQYrfI+RiFUio9BMOw2b58sFHgBq8A0 bSXQgX+ONtlnc3CGucZpapAJ0Zyr4nkn5lGjc29aSmZ0mF8YSVWQRxkU8GMihJJ+BaPQ APOpHkMpeQ/Y7XOqkawtHt7KG7jsEYSQrLsIXL8G0LUNkTYl4+IPIWZL8LFtvSt72Bw6 iXXQ== X-Gm-Message-State: AOAM532CMsJEqffOWdisIRuFw9jWxQ4K0OJ2U6iwHwiRoa1E58roJaO+ 9xjKW3GQjd8vxRtAWmA7CoKL/7xOKtw= X-Google-Smtp-Source: ABdhPJykOcIMEcW8qVP+NbXPtqa1S25/hrbHOUjUVXvMwngeb41xeo2c6HyMleG5+FjEeZFbLnFmVw== X-Received: by 2002:a05:6214:29eb:b0:435:b299:3c8d with SMTP id jv11-20020a05621429eb00b00435b2993c8dmr13677253qvb.43.1647791822589; Sun, 20 Mar 2022 08:57:02 -0700 (PDT) Received: from smtpclient.apple (2603-8001-7a00-01a0-b002-04c7-9cea-7180.res6.spectrum.com. [2603:8001:7a00:1a0:b002:4c7:9cea:7180]) by smtp.gmail.com with ESMTPSA id j18-20020ac85c52000000b002e1b9897ae7sm9718423qtj.10.2022.03.20.08.57.00 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 20 Mar 2022 08:57:01 -0700 (PDT) From: Mark Barton Message-Id: <893BB307-6A88-4D3A-A66B-0E9E8ABF01FB@gmail.com> Content-Type: multipart/alternative; boundary="Apple-Mail=_ABD33390-8FDC-477C-AF74-3667F9AB29DC" Mime-Version: 1.0 (Mac OS X Mail 15.0 \(3693.60.0.1.1\)) Subject: Re: [RFC] DOCT: Declarative Org Capture Templates (easier template syntax) Date: Sun, 20 Mar 2022 08:56:59 -0700 In-Reply-To: <87czihdiyy.fsf@localhost> To: Ihor Radchenko References: <87wo66t8i7.fsf@gmail.com> <87y2qlgq33.fsf@nicolasgoaziou.fr> <87d07wkbkz.fsf@gmail.com> <87czihdiyy.fsf@localhost> X-Mailer: Apple Mail (2.3693.60.0.1.1) X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::f2e (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::f2e; envelope-from=mbarton98@gmail.com; helo=mail-qv1-xf2e.google.com X-Spam_score_int: -3 X-Spam_score: -0.4 X-Spam_bar: / X-Spam_report: (-0.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, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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: , Cc: emacs-orgmode@gnu.org, No Wayman , Nicolas Goaziou Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1647791886; 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=PD9cKEF8ZiqXQLYJRUDxDNdf512wsHCkYPyRUNL3H+A=; b=O/OiqPvTS/24hvm9Sa3ic65mjj6vA+ro9CoMvit7eaLJo/9b2nnF5N+nq1Lnfs7Rk+GmnM pmQ30cQxlAdTg4KHHDyyJKYRArcDKgwC3OhAHvbiRBf+g/AFERScg98p/7vwDTdhLL5yIx Jb0WpkDy3nVgOJJ3zzZWpPBMIEQE2pmDsrzBD0dMrV9j0BtkvovrpQ+S8B2Sp33yfCwg2j +cDwiIcjZN+oRCYsUBqkZ9NhmGSURR9zsZZJrwTZrCdr9HLOQ9OCZSs/sdYtDTZ1ptNDih CrcTggHBlxyl9Q4Qh5ctifwBF4REqX99bSn9MXg0y9gqtix1SqhKEa99rhy3VQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1647791886; a=rsa-sha256; cv=none; b=LoOEr5D+dfcRNoH3/qrOKys9FUwnjb0TODOrbttMOam2S7bMVPuLf4eKTBnPHaEwPsPUD0 THP9C8NR2Yfs854XMSeftEZ6Ir5EYaV9+1Xj/wcT6kkoOElJamp23f2JpeQSTV1WqgndFC Q7LeXMoVUcBEqNCo9DQsXPQnzyiASvV5sD1ZD2hsnD5oOCs1n8lQWFKhhA79EBs/gvExR1 G5ffZ+uBIOQq6u8rzybTI0lVlgiA4dZ+xigwbmxoLnfmu6S0XssYH0JdHUKv3qz8Opb3gC J9aJ99anuzUd+c8N4r8LlqKuINl3gayQlAhZ7E5mvKNdDRwa/rBnD+hLoM85lw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=mG6kP4wT; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); 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" X-Migadu-Spam-Score: 6.57 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=mG6kP4wT; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); 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" X-Migadu-Queue-Id: DB92C3BD9F X-Spam-Score: 6.57 X-Migadu-Scanner: scn1.migadu.com X-TUID: yeBAymr5w69W --Apple-Mail=_ABD33390-8FDC-477C-AF74-3667F9AB29DC Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii +1 as interested I saw this project a while ago https://github.com/progfolio/doct I was concerned about long term support and if I would be left with = templates I would have to rewrite again, plus I was too busy at the time = to adopt it and it stays in my list of TODOs that are not scheduled. = That being said, I use org capture daily, but to the points you raise, I = avoid changing or adding to to my capture templates. > On Mar 20, 2022, at 3:19 AM, Ihor Radchenko = wrote: >=20 > I am pinging this thread again because I believe that doct syntax is > much easier to write compared to current defaults. It should be added = to > Org core. >=20 > Also, if anyone agrees with my arguments below, do not stay silent and > drop a "+1" email below. Otherwise, this whole thing will be stalled. > There is no point discussing technical aspects, if there is no = interest. >=20 > Citing again an example illustrating the difference between a slightly > non-trivial capture template using current vs. doct syntax: >=20 > No Wayman writes: >=20 >> Without DOCT: >>=20 >> ;;rest of template configured elsewhere... >> ;;make sure you update this if you ever change the key for this=20 >> template! >> (defun my-org-template-hook () >> (when (string=3D (org-capture-get :key t) "t") >> (message "Template \"t\" selected."))) >>=20 >> (add-hook 'org-capture-mode-hook 'my-org-template-hook) >>=20 >> With DOCT: >>=20 >> (doct `("Example" :keys "t" :file "" >> :hook (lambda () (message "Template %s selected."=20 >> (doct-get :keys))))) >>=20 >> DOCT ensures that function is only run for that template without=20 >> having the user manually filter against `org-capture-plist's :key. >> It also allows the user to do this inline with the rest of the=20 >> declaration vs spreading it out. >=20 > I believe that the right way to introduce this syntax is creating an > easy-to-use macro like (org-declare-capture-template ...), which takes > care about fiddling with org-capture-templates variable and its = format. >=20 > The current format of a number of Org customisations is cumbersome. = For > example, org-capture-templates and org-agenda-custom-commands often > become long list of lists with each element that must have a very > specific position. Every single time I need to write a new template, I > have to carefully consult the docstring; and every single time I an > reviewing my templates, I have to consult the docstring again simply = to > understand the meaning of the first, second, ..., nth element of the > template. Having CL-style :keyword value plists is much more readable. >=20 > More generally, it would be useful to provide a doct-like = functionality > for org-agenda-custom-commands and similar variables (like > org-agenda-custom-commands, or say, also org-latex-classes). >=20 > Best, > Ihor >=20 --Apple-Mail=_ABD33390-8FDC-477C-AF74-3667F9AB29DC Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii +1 = as interested
I saw this project a while ago

I was concerned about long term support = and if I would be left with templates I would have to rewrite again, = plus I was too busy at the time to adopt it and it stays in my list of = TODOs that are not scheduled. That being said, I use org capture daily, = but to the points you raise, I avoid changing or adding to to my capture = templates.



On Mar 20, 2022, at 3:19 AM, Ihor Radchenko <yantar92@gmail.com> = wrote:

I am pinging this thread again because I believe that doct = syntax is
much easier to write compared to current = defaults. It should be added to
Org core.

Also, if anyone agrees with my arguments below, do not stay = silent and
drop a "+1" email below. Otherwise, this whole = thing will be stalled.
There is no point discussing = technical aspects, if there is no interest.

Citing again an example illustrating the difference between a = slightly
non-trivial capture template using current vs. = doct syntax:

No Wayman <iarchivedmywholelife@gmail.com> writes:

Without = DOCT:

;;rest of template configured = elsewhere...
;;make sure you update this if you ever = change the key for this
 template!
(defun my-org-template-hook ()
 (when = (string=3D (org-capture-get :key t) "t")
=    (message "Template \"t\" selected.")))
(add-hook 'org-capture-mode-hook 'my-org-template-hook)

With DOCT:

(doct = `("Example" :keys "t" :file ""
=        :hook (lambda () (message = "Template %s selected."
=        (doct-get :keys)))))

DOCT ensures that function is only run for = that template without
having the user manually filter = against `org-capture-plist's :key.
It also allows the user = to do this inline with the rest of the
declaration vs = spreading it out.

I believe = that the right way to introduce this syntax is creating an
easy-to-use macro like (org-declare-capture-template ...), = which takes
care about fiddling with org-capture-templates = variable and its format.

The current format = of a number of Org customisations is cumbersome. For
example, org-capture-templates and org-agenda-custom-commands = often
become long list of lists with each element that = must have a very
specific position. Every single time I = need to write a new template, I
have to carefully consult = the docstring; and every single time I an
reviewing my = templates, I have to consult the docstring again simply to
understand the meaning of the first, second, ..., nth element = of the
template. Having CL-style :keyword value plists is = much more readable.

More generally, it = would be useful to provide a doct-like functionality
for = org-agenda-custom-commands and similar variables (like
org-agenda-custom-commands, or say, also = org-latex-classes).

Best,
Ihor


= --Apple-Mail=_ABD33390-8FDC-477C-AF74-3667F9AB29DC--