From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id kINBHuM4W2KzkgAAgWs5BA (envelope-from ) for ; Sat, 16 Apr 2022 23:45:07 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id GB58G+M4W2JugwEA9RJhRA (envelope-from ) for ; Sat, 16 Apr 2022 23:45:07 +0200 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 0389F39CFD for ; Sat, 16 Apr 2022 23:45:06 +0200 (CEST) Received: from localhost ([::1]:52370 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nfqE5-0001vK-Kp for larch@yhetil.org; Sat, 16 Apr 2022 17:45:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33806) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nfqDX-0001vB-U4 for emacs-orgmode@gnu.org; Sat, 16 Apr 2022 17:44:31 -0400 Received: from relay8-d.mail.gandi.net ([217.70.183.201]:35493) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nfqDW-0007AZ-2c for emacs-orgmode@gnu.org; Sat, 16 Apr 2022 17:44:31 -0400 Received: (Authenticated sender: cschockaert@citadels.be) by mail.gandi.net (Postfix) with ESMTPA id 156F31BF205 for ; Sat, 16 Apr 2022 21:44:26 +0000 (UTC) MIME-Version: 1.0 Date: Sat, 16 Apr 2022 23:44:26 +0200 From: Christophe Schockaert To: Emacs Orgmode Subject: Cascading Org-Capture templates Message-ID: <1add5505fd7731fb5feeda5806e98d7a@citadels.eu> X-Sender: R3vLibre@citadels.eu Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Received-SPF: none client-ip=217.70.183.201; envelope-from=R3vLibre@citadels.eu; helo=relay8-d.mail.gandi.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 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" 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=1650145507; 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: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=isOYRVRaMdXEFy2LEnUnI0+AM4k986eIppdpQI0IZm8=; b=hMJlFAahjK09scCaFrvoa5zn1RGTSVccWXiAmFTwMq/RlCsmjdyTo0YtT8CVDJUmq8Q1yu HpDvKSuUW9C0H30C3hooOsZSvlhjzAyhAXkf//Q0OwvyOxe18ElEjTLY5I0H+Ycq8xuHTL s4SlvKVnJOgYXbapZuoemUjeuQf4wOArOecgY3/9lNDuUUwljfr27wm/z4iN7zFjpg83d3 BBb73fW7zJ4LNmTHeE1iHJ5GufLMQOyL8uBvUeXX98gDH4rmJiXZs3HQAFHUaNF/6h7kz9 oiyGKfR6xom3G1EYsax8oBIRfV1gOSvjJ18rNbarvtEeatGfi1HGGAczoCEEbQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1650145507; a=rsa-sha256; cv=none; b=Yuaaozk544GZNjrnnEh1JwoC9riYqAfdGgVVP5XjHqUu4tj/Jo7yC5ZggwO676tJD8t573 S1at0VqAwTV9xLQlHciXZW1zdK4o44tbsKxHpmu8tiuzAaOWukF2v6FB1QDvxZZQOjrlOX u7pPKvZ5njlKaLWVNSeCtqMEopSn/QtrVmun5EFWzqBVv5y3Uf8xoj1GNLxC5+fJMImQyb KrDT+hLgWzbMg0bo7m+uvjLqBNqEovdrbERs88Otv8EmZvCKjySjivlCqx0cWztHH88mmP NzLqafdcXM3+/REGZ6D+BJpyzM5DI+PrAqM//7/+C7bED+QjA3kGeMdsEbVvvg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=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: -3.24 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=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: 0389F39CFD X-Spam-Score: -3.24 X-Migadu-Scanner: scn0.migadu.com X-TUID: rACoOZopFFeE Hi Org Fellows, I am revisiting my Org workflow, and I feel like that in order to make it the way I wish, I need to cascade capture templates. And after trying several approaches, I am not able to make it work. I know about the "don’t use every extra Org features", but this is what I came with, and how I like it :) So, these are the two things I want to achieve : 1) In an Org file, capture a new entry and clock it, this entry being a link to a new Org-Roam note 2) In an Org Journal file (org-journal), capture a new timestamp entry, which is a link to a newly captured entry in an Org file I first tried the first case, but I am stuck with the "Org Roam capture within the Org Capture", so I tried to figure out if I could make the "Org Capture within Org Capture" of the second case work, but without any success eventhough I am not far I think. In order to do this, I wrote this : (defun lisp/cascading-capture () (let* ((title "Cascading capture Heading")) (with-temp-buffer (org-capture nil "gc")) title)) (defun lisp/link-new-roam-log () (let* ((title "Note title from Heading") (node (org-roam-node-create :title title))) (org-roam-capture- :node node :props '(:immediate-finish t) :templates '(("d" "default" plain "%?" :target (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}\n") :unnarrowed t))) (org-link-make-string (concat "id:" (org-roam-node-id node)) title))) (setq org-capture-templates '(("g" "Org – GTD") ("gM" "Mails test-cascade" entry (file+olp+datetree cfg/org-gtd-inbox-file "Incoming") "* %U %i%? %(lisp/cascading-capture) :MAILS:\n** Réf. %a" :tree-type week) ("gL" "Log (new roam note - test)" ; Track progress of selected task entry (function org-back-to-heading-or-point-min) ; Create entry at beginning of current heading "* LOG lisp/link-new-roam-log\n%i%?" :immediate-finish t))) So, "gM" is related to the second case (2), and I end up with the following error : "Capture abort: Buffer is read-only: # https://www.citadels.earth Once it's perfectly aimed, the flying arrow goes straight to its target. Thus, don't worry when things go right. There will be enough time to worry about if they go wrong. Then, it's time to fire a new arrow towards another direction. Don't sink. Adapt yourself ! The archer has to shoot accurately and quickly. [Words of Erenthar, the bowman ranger] <---------------<<<<