From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id +K1LHWXsz2JELAAAbAwnHQ (envelope-from ) for ; Thu, 14 Jul 2022 12:13:57 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id AA01HWXsz2IoQQEAauVa8A (envelope-from ) for ; Thu, 14 Jul 2022 12:13:57 +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 E632FEEF2 for ; Thu, 14 Jul 2022 12:13:56 +0200 (CEST) Received: from localhost ([::1]:35736 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oBvr1-0000NY-Sh for larch@yhetil.org; Thu, 14 Jul 2022 06:13:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60076) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBvpf-0000LC-1L for emacs-orgmode@gnu.org; Thu, 14 Jul 2022 06:12:31 -0400 Received: from gallois.livando.com ([31.170.109.33]:45836) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBvpc-0005As-Da for emacs-orgmode@gnu.org; Thu, 14 Jul 2022 06:12:30 -0400 X-PDA-ORIGIN: gallois.livando.com Received: (qmail 1120591 invoked from network); 14 Jul 2022 10:12:21 -0000 Received: by simscan 1.4.0 ppid: 1120579, pid: 1120584, t: 0.1278s scanners: clamav: 0.103.6/m:62/d:26600 Received: from unknown (HELO ?192.168.0.77?) (christian@gladbachcity.de@95.90.192.29) by 0 with SMTP; 14 Jul 2022 10:12:20 -0000 Message-ID: Subject: Re: org-capture and fast selection of tags From: Christian Heinrich To: emacs-orgmode@gnu.org Date: Thu, 14 Jul 2022 12:12:20 +0200 In-Reply-To: <87y1x0que5.fsf@localhost> References: <72130bbc83403af80962f1b69160a74738436341.camel@gladbachcity.de> <87y1x0que5.fsf@localhost> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-R6MSE3Cp8k4I5Cko1JCb" User-Agent: Evolution 3.44.2-1 MIME-Version: 1.0 Received-SPF: none client-ip=31.170.109.33; envelope-from=com-orgmode-mailinglist@gladbachcity.de; helo=gallois.livando.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, 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=1657793637; 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:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=IvA6rRuR+g3xtY5Ukk63Q9gKaBWw4+GvF1spUNK6K7Y=; b=gzXej39G30k02hSVzP/GUVhfU8hHhdO4pEIAM/bJawZlqG5ZXd3kUzyuQZW/0Xk2GFWun7 kijxqp/XEwt5+7bADviVUiLqDqCtKw+INxkB0HKXv5I9jhA4shRoS7vRZk//dYDbOUFD1n DreyncwSgAIUboeoj/fSCYQTdO4MYuqoLmloeVKpNw+yq3h4eobGDx+jug83AjKZR4u5Sz 88wk8UhegecFFO/w05da8JLGrzlDBfcn2zw4LN5oV4TEv5J+9R48PqX223xiZmFwDlfYe0 qi+xOCGJKPpNRD9eASkKtx59LPEgy3LMba9Yrjz6+5QYvmDQDCy4/yMEYOrUMw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1657793637; a=rsa-sha256; cv=none; b=KW5IVxT3Nxget+8lcFsHZI1uz7fc6J8eqcEpZuYYCddE03aXcT1t5LLSQpJiU0sKa4tDsw 7M9nnupesnxESqOt3DlvHoJZsBh2ZN7p4KltHY6G1XvL/0X7EQ0jGKQdBNWYboXE1ak6Xk 2XhAJT25MsvK16U6vTYoKO3xthY3IAcg9660Fkk1h/GlXCMeYftwqFcwRXT6POWe4sSm2H MUDIXq2dAtMJsCSHsSAnJl/pvTJyvV2LnlzCMZRn6ftuShdxGqaR54PQ/Gc6SDUzxQ3P39 Pcv4pSyszh2UFlxeBBUGtWeU1ALY6WCIQ2pQ7PEd96jeCLwRabg3jYWln0nzoA== 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: -4.85 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: E632FEEF2 X-Spam-Score: -4.85 X-Migadu-Scanner: scn1.migadu.com X-TUID: b3DtGhlOE8mj --=-R6MSE3Cp8k4I5Cko1JCb Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Ihor, thanks for your reply. I looked at the code and came up with a patch that works for me (see below)= . However, this may change behavior for others: 1. The original %^g will work on non-headlines, but if (org-set-tags-comman= d) is called as I do, this is no longer possible and would need to be checked (what would be a go= od way here?) 2. Can I really deduce from (org-use-fast-tag-selection) being non-nil that= fast selection should be used in capture templates as well? Does it actually make sense to incorpora= te this into %^g/G? I am neither a lisp programmer nor acquainted with the org codebase; this i= s a draft I came up with.=C2=A0If you can provide me with further feedback, I'm willing to make= this more stable. Best regards=20 Christian diff --git a/lisp/org-capture.el b/lisp/org-capture.el index 9ef160d16..a2a05c69d 100644 --- a/lisp/org-capture.el +++ b/lisp/org-capture.el @@ -72,6 +72,7 @@ (defvar crm-separator) (defvar org-end-time-was-given) (defvar org-keyword-properties) +(defvar org-use-fast-tag-selection) (defvar org-remember-default-headline) (defvar org-remember-templates) (defvar org-store-link-plist) @@ -1751,7 +1752,10 @@ Expansion occurs in a temporary Org mode buffer." (org-global-tags-completion-table (cond ((equal key "G") (org-agenda-files)) (file (list file)) - (t nil)))) + (t nil))))) + (if (and (boundp 'org-use-fast-tag-selection) (not (null o= rg-use-fast-tag- selection))) + (org-set-tags-command) + (let* ( (org-add-colon-after-tag-completion t) (ins (mapconcat #'identity @@ -1765,7 +1769,7 @@ Expansion occurs in a temporary Org mode buffer." (unless (eq (char-before) ?:) (insert ":")) (insert ins) (unless (eq (char-after) ?:) (insert ":")) - (when (org-at-heading-p) (org-align-tags))))) + (when (org-at-heading-p) (org-align-tags))))))) ((or "C" "L") (let ((insert-fun (if (equal key "C") #'insert (lambda (s) (org-insert-link 0 s))= ))) On Mon, 2022-07-11 at 10:02 +0800, Ihor Radchenko wrote: > Christian Heinrich writes: >=20 > > Today, I went through your init.org on github (it's ... huge) and could= n't find anything there > > either. >=20 > That's because I rarely need to set standard tags when capturing staff. > So, I am content with entering tags manually. >=20 > > ... Do you have an idea > > on how to use fast selection of tags (using shortcuts) when capturing a= n entry? > > ... > > I first thought that using %(org-set-tags-command) should work; but the= capture-buffer is > > narrowed > > (i.e., no tags are available),... >=20 > %(org-with-wide-buffer (org-set-tags-command)) may work. >=20 > Of course, we may also implement a proper capture selection for %^g > template. As usual, patches are welcome. >=20 > Best, > Ihor >=20 --=-R6MSE3Cp8k4I5Cko1JCb Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEE+9lGLw1S8YBUC27di84V01FvzDwFAmLP7AQACgkQi84V01Fv zDyIBw//fnqX8egJRaB2XUUQv1MJVCB1T7gNzZVqMttKtblZlvxctRyIjDfhtVq1 VTHxBcTzHVbHdQAftjISeZPpgUfZISGRRYDkltf8HSnoC9MLad0Pzbhqfma0tO7b 15Vtlh/n5pvSQRzdjuA69rOh7gnQEa4Leu8au+5W+w9DFE+RC9x1r1LaH80CVBid caXy4v0mgP3/J/2vIMlIbkOg8uK4O+CnKp/vKNiOpCrF4EyUQAIf13WEUKQzPMBV gOlh3ENjHFXEXcPAmV4LNRXQ+rvU+pd9EwXiLe+gGDqFjrBLa2jWnDx2dqj92aT7 iP0TeVI2pX4Ljc8PtXV5tyNOgLQ1xr05zmRUbSRL/Ek6jRPWDF9V2sN4RDsOEPc6 KLm8FPD/FA7CLWekStpUQaBSuRdsX19JAYVB1+SK5RgRjN4Th4RwLTdKwRYp7tp6 2grrzx0SFw+L+5JbtDNu0esza+5jl7v+zKLKgSRl5Wj2Cqf84p0UMZhGZldfRIWV 9e1h63HY9DVokqlV09DaJYaUuCwP4cE5iasyOfhnH8pE9OmFNrZgHfELJM4F5GyX xFF2/wQ69kchlku3r4ppoK70IUI+gJwdK17QwqwJDocaXqNnBvpJufKeblJ6qxTu Zi5a2DXWUGNiFfWU/mO7yGLPNKsuG0xUMVU91z0MphvNTG+m2aI= =xSUd -----END PGP SIGNATURE----- --=-R6MSE3Cp8k4I5Cko1JCb--