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 IHy8EAbh02KH3AAAbAwnHQ (envelope-from ) for ; Sun, 17 Jul 2022 12:14:30 +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 IBmOEAbh02KwawAAauVa8A (envelope-from ) for ; Sun, 17 Jul 2022 12:14:30 +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 E6E1F35B00 for ; Sun, 17 Jul 2022 12:14:29 +0200 (CEST) Received: from localhost ([::1]:47434 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oD1ID-0007Kz-45 for larch@yhetil.org; Sun, 17 Jul 2022 06:14:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34110) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oD1HM-0007KB-Rt for emacs-orgmode@gnu.org; Sun, 17 Jul 2022 06:13:37 -0400 Received: from mail-pg1-x52c.google.com ([2607:f8b0:4864:20::52c]:37552) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oD1HL-0002X8-4r for emacs-orgmode@gnu.org; Sun, 17 Jul 2022 06:13:36 -0400 Received: by mail-pg1-x52c.google.com with SMTP id bh13so8221247pgb.4 for ; Sun, 17 Jul 2022 03:13:34 -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; bh=ZlCCD5/xnKHM52hXzlLdWshp7G9gyvfmH2LqRld+X2w=; b=lyNGo5XfzVyPs0zTLf5m86e1N3Oo403+Fz/M1U0HEeCFhobFM2sIJaabXaQ5OMqQ5I i+vOc/RjXNtG6WUw85yQztpSOLsirNfj3GsQfgAkIR1PVYKxKEHUZHFbMvnqFCznZVQe rAcw8D2MhnmgE+GVOHfKN9Z+k9FRSo1NfDDC53sOBKmApqJK2f3cToIZ3BhqIv/nKZiD FH6SAlgAFRo7t8ESyuBO+n859aqwgDTjmlDDjNLG1Yhi0csjEqpmbhgxfA14rarLDkMH BI6+SwpHp7G1jxcvyRvGlGY9aYU5asvDcDlvzunebP7MmRY+Mw2tQfQcppvV2mevN1B0 Hehg== 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; bh=ZlCCD5/xnKHM52hXzlLdWshp7G9gyvfmH2LqRld+X2w=; b=bU1BJ2/mMC6LUthVdfMcLoNJYyYximK8+oXDXmWXlgicBmepg0kOajFJN1mNnJVg6S dDDzdKFSB2YuUY0MDhDyA2SJsR95dOjcILgchEgnpMHquZMzMiEwkzEsvc1c5BvfurNv C/7yd48jcNewO7MijSv9gviVMvsqj4eQBIbO0i1Q2H5fWcnmu+DdHSiyJjvokAImi8R8 kYzmf75D8TyuTC7fdUrSk51BPX0ttWggOGNxw9N9FxZzmhE8aCEPmup+lq7/Z21J3Hja lL+uy6XdkohH2UQ0mkteYpPY/G/DPlYMARcHniEDHdcPdAjZss+74HsI6OCGEM15eEeG ePPw== X-Gm-Message-State: AJIora8zIuCsJKCVFkcRbKaS6gNbkrzqozy9E/9vJ6gJf3CSsWV5/EIX II5EvbPYcZQWm/9dtV9dsdJYVPvRE4Txng== X-Google-Smtp-Source: AGRyM1tpbcCWZGk5+ctvkUIFazy66HlR1B+OCzfJ97wsyUN/bs48caIEd3qTiE403ZUeNsKMMkd9JA== X-Received: by 2002:a05:6a00:188e:b0:52a:af7f:e715 with SMTP id x14-20020a056a00188e00b0052aaf7fe715mr22882606pfh.2.1658052813676; Sun, 17 Jul 2022 03:13:33 -0700 (PDT) Received: from localhost ([2409:8a70:2bd:4d0:8ec6:81ff:fe70:339d]) by smtp.gmail.com with ESMTPSA id l4-20020a170903244400b0016bf24790e4sm7017063pls.21.2022.07.17.03.13.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Jul 2022 03:13:33 -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> <87a699e7zk.fsf@localhost> Date: Sun, 17 Jul 2022 18:14:36 +0800 Message-ID: <8735f082r7.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::52c; envelope-from=yantar92@gmail.com; helo=mail-pg1-x52c.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=1658052869; 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=ZlCCD5/xnKHM52hXzlLdWshp7G9gyvfmH2LqRld+X2w=; b=i1jv5B5K22z+maRPNDao+Bq4zOrGbhmaBCJo6cPJKiiyR59C+vi3L+kUCwldJiTKcBaT59 U/GWJjOfm0bCZDpWwe+CfYgVxS83VOcXVRvi1G4icro2PVRKs7sHtYdaNz6wyJhfbGFWld WqfI10It+UQ0ASNR1RVCc8bG12FIaIPGttGKOI3+pBE+xi7VVyogRQVDIvu3CaAweYcFio 6sznZzDq8y/sJA+pMrGjiG/9Pwrl523RHRFSsjoRvCJx+RtuFfnrMA0vCCRI4Diy7WRRhm r8RLXQVG440dmUHUUAWvgG7HZHvjc/5xQFG99OSs5mdYt2TvvUmoAVEI+gvPdw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1658052870; a=rsa-sha256; cv=none; b=JaacohsFBkCNfN8yoUrZFdbGo+GSd5jZq9mcXpN/vlH1Bpql2BFD6ybVPsVrEQwBDM7EYY 3wx757oxQMWVyRfkEenk+pgx5iOThtQ/DK5RjGQmzh90xVUyVVwXtzo8awVpehRap60dmK 272wbsgONJcEeN76D2nRS1CUaCBbESP9S7to4IR21GovXHocoBG256/eKrvNzX5g9SRlJY 9fikBqC38CxZJ8U16+ps2nrpSO3sD/4QK4l8ReJ5KNLFn2WCEt/wF4wpSV39meMaBxvYgh OtNLAUj436VzQxk99GAGqajHVT/bVDorGt/oEvyjrytizdjvFBIpknGS0ZEvvQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=lyNGo5Xf; 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: -4.93 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=lyNGo5Xf; 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: E6E1F35B00 X-Spam-Score: -4.93 X-Migadu-Scanner: scn0.migadu.com X-TUID: SwuNtPkM9u5e Christian Heinrich writes: > thanks for your feedback. I attached a patch, but I'm not sure why you said "all but the last line". > That last line for me was (org-set-tags tags), which proved important as otherwise the tags were not > set in the buffer. By "all but last line" I implied that the part that reads the tags should be factored out. That part should not modify the tags in file, just read the tags using the preferred interface and return the selected tag list. This return value can be used in org-set-tags-command to be passed to org-set-tags. For org-capture the return value can be used to insert the tags in place of %^g (rather than putting the tags under headline unconditionally). Now, after examining the code of org-set-tags-command more closely, I found out that org-fast-tag-selection is actually tricky to use as I described above. org-fast-tag-selection itself is changing the headline tags even before the user finishes the selection process. So, an appropriate patch would also need to alter org-fast-tag-selection in such a way that it could be called without side effects (changing buffer text) - it can be done by providing a new optional argument to org-fast-tag-selection. Best, Ihor