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 eHBHLwGB0mLzdAEAbAwnHQ (envelope-from ) for ; Sat, 16 Jul 2022 11:12:33 +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 oG5iLwGB0mJrZAEA9RJhRA (envelope-from ) for ; Sat, 16 Jul 2022 11:12:33 +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 78695EE for ; Sat, 16 Jul 2022 11:12:33 +0200 (CEST) Received: from localhost ([::1]:52180 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oCdqi-0006nS-8K for larch@yhetil.org; Sat, 16 Jul 2022 05:12:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58964) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oCdq0-0006nH-BO for emacs-orgmode@gnu.org; Sat, 16 Jul 2022 05:11:48 -0400 Received: from mail-pg1-x52f.google.com ([2607:f8b0:4864:20::52f]:45631) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oCdpy-0003qZ-O3 for emacs-orgmode@gnu.org; Sat, 16 Jul 2022 05:11:48 -0400 Received: by mail-pg1-x52f.google.com with SMTP id f65so6375474pgc.12 for ; Sat, 16 Jul 2022 02:11:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-transfer-encoding; bh=3d0qs2rGVFzmozgTZ1AMUAPvXZYJC8moxXEkrg6it7U=; b=V9LYA8Fv4CU08eslLVndxfts/Y28xRll34Ibdc/7EBpwqnLFdrovNIHkdi6e9TNXVr YBA+eCUEBD0hQcEmISZvTOZuLlxbcjSglP77Dn7XxsPRChqy614DTIuHfit4A5xk/CQz xHTnbsYNhMJSRZ01FirEkQ/Haz1upcdaJZaBpLbf+L/cY6C4SRgLLOnuzJor/EdlBDce 5O3s0B/FyCKtsjeFfINubbdQxlP+0Tdque56AGQrdSpss+vlyuf3nlaox48DSFUA+MJB eralDbiyBc2D5ID6tkRErq4qO8QvaNbHEZlPRFTVB3KMgEQJHhWH0fmzIZ+9GyvXGvMJ rZhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version:content-transfer-encoding; bh=3d0qs2rGVFzmozgTZ1AMUAPvXZYJC8moxXEkrg6it7U=; b=V7hQEhfqK5ym88tgJgWCuQ4KuUMTVzAWKx5DALh3jr0MYXo4tPnIwDNVX3SVsiKNss rl6yu2nbkTQs+r7A6uQH0WaAB0PpOcqwjuJJE+JzBUki6EoZvI9InfWIbq8e7hikrEQR zYExbAbUBwauJDIqAb6pDobMgqkZ6gVtJ9uXLcrFnydChLuTmXMTqRXYQePt9wBmRy/q iaxPxBhpeESHcYs+AHfxhX1ilZDvg6zS+GT/r7B/quxCJaJgC9st+Ju9XIcllKKe//SC SuwhJM3j6X9o2VPQGU2r/tZJu5kfPdI8o73NZNaKuDdovLb4nLyqyes+C/yEurrtX/BP 4VRg== X-Gm-Message-State: AJIora8OJbk2tjFEMFCJPfC+zwf+dnwBj83um0WU9zxx+7jizAfjjk00 eXPtsKyO5WmQkr+ygp53cWYvwas04/U= X-Google-Smtp-Source: AGRyM1v6ehhw9WhVYxvbRW1J1l4PbERmmcDwj1B0pR0SytENdCUHMwFpl/3Y2lAMZf3GtLsxUs/l0g== X-Received: by 2002:a63:3542:0:b0:419:aea6:f8bc with SMTP id c63-20020a633542000000b00419aea6f8bcmr12080570pga.611.1657962704900; Sat, 16 Jul 2022 02:11:44 -0700 (PDT) Received: from localhost ([2409:8a70:2bd:4d0:8ec6:81ff:fe70:339d]) by smtp.gmail.com with ESMTPSA id i28-20020a056a00225c00b005289521b656sm5415396pfu.92.2022.07.16.02.11.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Jul 2022 02:11:44 -0700 (PDT) From: Ihor Radchenko To: Christian Heinrich Cc: emacs-orgmode@gnu.org Subject: Re: org-capture and fast selection of tags In-Reply-To: References: <72130bbc83403af80962f1b69160a74738436341.camel@gladbachcity.de> <87y1x0que5.fsf@localhost> Date: Sat, 16 Jul 2022 17:12:47 +0800 Message-ID: <87a699e7zk.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2607:f8b0:4864:20::52f; envelope-from=yantar92@gmail.com; helo=mail-pg1-x52f.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 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, 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: , 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=1657962753; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=3d0qs2rGVFzmozgTZ1AMUAPvXZYJC8moxXEkrg6it7U=; b=rpuhixNtKIsp+LwHvyTVI+u9RI8Y62AjosimtZ5NdqY53ItqPlm67U4006hwpgTqDS7fWL oCuc/i+XWC8SSuA2TPLkiptn7wA6PUiR1ciw13UoHkWnYdzAYg6mhGt6H82u85UbOP10+9 2LuZiO0O9sJTXekJ5fLdevPGSB8Yq97BS2FP9gWCHRWDIbPgriZkSodDbfrjQEAA+qwl9/ xlm9ibVwtFQrX8Gn1cCsyexR/8YNv0ejtZex4nseKcf7Nob2HVrHAVGedojwpj0cvil4FV SqGwGddP1Q/71rvtpQAm3AHzc2AciQe3gj878I519v2ecETtLUJLhzp9NF0epg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1657962753; a=rsa-sha256; cv=none; b=ALAGVG69nQMzODeW/9eYJ9Lfe+HX+HvwyZwNIQ+bdA4j1KmwMEQfPC9T8yWgCFt/2lt2qw ejtFImyCOpeU4+lf389RYNZGC3bfFWLzvLbHFN+iN0+D+P6e6brk9Jujmbg3hzlhivRO+4 Q2nYAYOBHaau2ArwtBBstn9IwBfhzJ4xDqybl2ufYMfE4KbgUEUGoZmS87osOnCl6LHToS ZXu4rGzIHOZVzyhFHEDrkWd5hE02PUx/+L0+f0KAs5wPRHbcuifanZK0sPynVo4TkPwReS VwQCkTERTxGAlT4Zx2QkrXQw50OjLuNZk3LGD/O2iD66rArgexGWqL88b2RJPg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=V9LYA8Fv; 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: -3.44 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=V9LYA8Fv; 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: 78695EE X-Spam-Score: -3.44 X-Migadu-Scanner: scn1.migadu.com X-TUID: 8dlG6s7Au9hf Christian Heinrich writes: > I looked at the code and came up with a patch that works for me (see belo= w). However, this may > change behavior for others: Thanks! > 1. The original %^g will work on non-headlines, but if (org-set-tags-comm= and) is called as I do, > this is no longer possible and would need to be checked (what would be a = good way here?) > > 2. Can I really deduce from (org-use-fast-tag-selection) being non-nil th= at fast selection should be > used in capture templates as well? Does it actually make sense to incorpo= rate this into %^g/G? > > I am neither a lisp programmer nor acquainted with the org codebase; this= is a draft I came up > with.=C2=A0If you can provide me with further feedback, I'm willing to ma= ke this more stable. The idea is reasonable, but using org-set-tags-command is not ideal indeed. Instead, you can take the relevant part of org-set-tags-command (it is all but last line of the "t" cond clause) and put it into a separate auxiliary function. Then, you can simply call that function inside the org-set-tags-command and inside the capture template code. Best, Ihor