From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id IG90CxE41mJITAAAbAwnHQ (envelope-from ) for ; Tue, 19 Jul 2022 06:50:25 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id oBeNCxE41mI7/QAA9RJhRA (envelope-from ) for ; Tue, 19 Jul 2022 06:50:25 +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 A69ECAA06 for ; Tue, 19 Jul 2022 06:50:24 +0200 (CEST) Received: from localhost ([::1]:45062 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oDfBf-00041v-Bf for larch@yhetil.org; Tue, 19 Jul 2022 00:50:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48636) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDfA4-00041n-9w for emacs-orgmode@gnu.org; Tue, 19 Jul 2022 00:48:44 -0400 Received: from mail-qv1-xf33.google.com ([2607:f8b0:4864:20::f33]:33324) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oDfA2-00083M-9t for emacs-orgmode@gnu.org; Tue, 19 Jul 2022 00:48:44 -0400 Received: by mail-qv1-xf33.google.com with SMTP id d17so10389961qvs.0 for ; Mon, 18 Jul 2022 21:48:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:reply-to:from:date:message-id :subject:to:cc; bh=ascWkuc5kZzfivtZ3N+QIMgR5lYmDcAoAhK4sZRyXZQ=; b=DaBk6ufUeYUzWYLErT5OiP5vfaMGpauJa9UDr0j0oVOC2xX3fb12uiWBehYZoqL9iI fjIfFtYzIav/GSytiMYsTdiTbW0W+5hUtDbpuw9/0SJaTA7Fjjcz0K540JjVlvibYE5A ugbnSvpYvydy6Qgr4LRRHY1rS3g5yahYbWIIHt5ZIsRqxq3oKodT6hqdFU5/Bg1RO70t 7LKrMmq1Q7P59qI6IOXgpfRZzo/482TNV//2dhaL+rGrL/IlFfvEc4ooDqQnBKWXOM8D 8M4Mrz1Zw4duxbeXaikEczMBQg9igDdLtQhmxhMDsYmXoj9IEBv7AcqoGxQMCx80QosP dA6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=ascWkuc5kZzfivtZ3N+QIMgR5lYmDcAoAhK4sZRyXZQ=; b=iDFycX54fu2A9KjAtoQZfdy9taEG/LUmJCdkpm1mYPYtWLcJbp3K9tBtQ9LOVxA5Zk khtJ0EwLtKyBp/VSkf+9kfcf9nMHuAPmdMJ3B5cyDaO/SyA6apd5VhFpMmtHRNdXl7Bv n3/zh7Pn9/oKiiWfXZxr1++bt3sSqdBdTP8AzZCa4JqEmPxPsEcaBm+UrZcnjk4hR07F g/e2psAKwM69tlJkxWlCEiVqrs8Cc0ct3YW7P+tP+ROHg3k4HGbZFsvwxFiU2b3gfAov q6Qmntm2aoUG9890HENxCFN/AVKIcmtuWcpuZvs+YI4UTo95DeANTLie5j7tvzRGoee8 PM9w== X-Gm-Message-State: AJIora9J5akBZT+HfYjnIkvhuXzHumU53uAZyHvjfQXyyFNoZqW35eSH rIdMfPzCukODBqYcBz3d0ibwNQI7E7BLhdtiWg4= X-Google-Smtp-Source: AGRyM1vxG3yCRaCPVpPO3u5Xt+xGu951BgACMkdm5pc0P/K7E3+2Rvhrt01iT3bYRlJok/zgqmSD8ZjEL6Xfp8Q2D9s= X-Received: by 2002:a05:6214:23cb:b0:473:81c4:712e with SMTP id hr11-20020a05621423cb00b0047381c4712emr23889468qvb.31.1658206120649; Mon, 18 Jul 2022 21:48:40 -0700 (PDT) MIME-Version: 1.0 References: <87mtd7hzl3.fsf@localhost> In-Reply-To: <87mtd7hzl3.fsf@localhost> From: Noel Errenil Date: Tue, 19 Jul 2022 12:48:29 +0800 Message-ID: Subject: Re: `org-capture' loads all the files in `org-directory' To: Ihor Radchenko Cc: emacs-orgmode@gnu.org Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=2607:f8b0:4864:20::f33; envelope-from=errelinaaron@gmail.com; helo=mail-qv1-xf33.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-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: , Reply-To: errelinaaron@gmail.com 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=1658206224; h=from:from:sender:sender:reply-to: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=ascWkuc5kZzfivtZ3N+QIMgR5lYmDcAoAhK4sZRyXZQ=; b=U1ImFEjcAwbLaDwlsuNeivdetGxIT6pAYh+IF+9fNQNULH1kihW8cV2ol7Lai/pQf0cD7F XdiSQnCkv2B4qEX80F7uIpZ7yFEc9xK9tlxMWV6Sc1cStVIoempjKa8AkLyUCKZx++AEaK PWuiTckG/J3yRKvTPOkmygVJCD34KZewY4FnQ4/ms5zP+HHHwWO4yh2aNXp6gwWwJ54qyR Kc646gXERyeCRtgd8GM3eJCkS1nvBV9pIXGbCaFP/nMDNjQ6Fz9aTanK2Kxtc4PxYTOvWU zAVElwyNfkykLE8FM0k0OmqSJu+HGLCHDIvyEMLGcGWWPpr3R+1TERivsuo5rA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1658206224; a=rsa-sha256; cv=none; b=lZZO97IhgL2RquzmSg2j2qsOgZpJFWN7sHeWGJVQhoWWu7JmG09grbzj8LlErSqauvqo74 ALcKe6DJa6CMSDD1rBPOsALM2QI8jDJ0/2hAEe9rUusbk1slS6QiSGgz8mdBl85Rs70Iz5 pAQEvXC5j+uDqoabtj9J/nX7iRh5Mvu77T2/LfOrwBmx15ZiVbkoq2O/jOG08opjKdhMzS mPTKokxFjho80oD1ypg3veytN+0dk8RycDS8ixxZrqrZxtOCZe55EOZdQh6iAAZwxxMp/O xceYnWtBWhWOUIqSn3mDUEgi4T3M1Bn/gCcGqxT2y8w9/0XReyAfl/pljc0tog== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=DaBk6ufU; dmarc=pass (policy=none) header.from=gmail.com; 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: -5.24 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=DaBk6ufU; dmarc=pass (policy=none) header.from=gmail.com; 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: A69ECAA06 X-Spam-Score: -5.24 X-Migadu-Scanner: scn0.migadu.com X-TUID: XsmxnBJZ/ahK Hi Ihor, > ... > Note that you are using %^G, while implies (see org-capture-templates docstring): > > %^G Prompt for tags, with completion on all tags in all agenda files. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Thank you so much for the help. You are absolutely right! > Only the capture template is actually loaded. However, providing tag > completion for %^G requires Org to scan all the agenda files for > possible tags. Hence, agenda files must be opened and examined. This is an oversight and misunderstanding by me. Really appreciate your explanation. > The reason why the capture target buffer and the agenda file buffers are > not closed is efficiency. Opening all the agenda files may take > considerable amount of time and hence it is generally better to keep > them open for future use. We might change it in future or provide an > option to close the opened files if there is enough interest. Feel free > to write a feature request - we will judge the number of user responses > to the request. Currently, I'm happy with this behavior. I'll learn how to submit a feature request anyway in case in the future I feel a need to. After your first reply earlier, I came to realize that the pop-up buffer in which I am able to select a template is indeed some kind of agenda view/mode. This can be confirmed by looking up the source code. So my original problem indeed had sth to do with agenda, not `org-capture'. Then I found my setting of `org-agenda-files' was indeed wrong: Sth like: (setq org-agenda-files ("~/projects/org/agenda.org")) ;; ^^^^^^^^^^^^^^^^^^^^^^^^^^ empty file at the moment will actually make the whole ~/projects/org directory as the agenda source, hence all the files under it will be loaded once agenda function is activated. I did that, again, because I misunderstood the manual. I should use a list for agenda files or a plain text file in which I specify agenda files, one per line. Hope all the information in this thread will help whoever runs into the same issue as I did. Best, Noel On Mon, Jul 18, 2022 at 11:24 AM Ihor Radchenko wrote: > > Noel Errenil writes: > > > ... > > Then, I fire `org-capture', captur a note and `C-c C-c' to save the captured > > content. > > > > Suddenly all the files under ~/projects/org will be loaded into the buffer > > list, which confuses me so much. Those that have nothing to do with > > capturing or capture-templates are loaded into Emacs, which makes > > little sense to me. > > ... > > Currently I have `org-directory' set to `~/projects/org'. My > > `org-capture' config is as follows: > > ... > > org-default-notes-file (concat org-directory "/notes.org"))) > > ... > > ("td" "With Dealines" entry ; todos->deadline > > (file+headline "tasks.org" "Deadlines") > > "* TODO %? %^G\nDEADLINE: %T" :kill-buffer t :prepend t) > > Note that you are using %^G, while implies (see org-capture-templates docstring): > > %^G Prompt for tags, with completion on all tags in all agenda files. > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > > I just expect that only the capture template will be loaded during capturing > > and the template buffer should be killed (as config-ed) after capturing. > > Only the capture template is actually loaded. However, providing tag > completion for %^G requires Org to scan all the agenda files for > possible tags. Hence, agenda files must be opened and examined. > > The reason why the capture target buffer and the agenda file buffers are > not closed is efficiency. Opening all the agenda files may take > considerable amount of time and hence it is generally better to keep > them open for future use. We might change it in future or provide an > option to close the opened files if there is enough interest. Feel free > to write a feature request - we will judge the number of user responses > to the request. > > > What am I doing wrong? Any advice? Thank you so much in advance. > > You may either not use global tag completion (use %^g instead %^G in > your templates) or advice org-capture to close the opened files. > > Best, > Ihor